Skip to content

Commit

Permalink
Updated Text
Browse files Browse the repository at this point in the history
  • Loading branch information
badalkhatri0924 committed Nov 10, 2023
1 parent 6115622 commit 5950610
Show file tree
Hide file tree
Showing 14 changed files with 193 additions and 132 deletions.
259 changes: 140 additions & 119 deletions apps/web/lib/settings/integration-setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@
import { useGitHubIntegration, useIntegrationTenant, useIntegrationTypes, useOrganizationTeams } from '@app/hooks';
import { ChangeEvent, useCallback, useEffect, useMemo, useState } from 'react';
import { GITHUB_APP_NAME } from '@app/constants';
import Link from 'next/link';
import { useOrganizationProjects } from '@app/hooks';
import { TrashIcon } from 'lib/components/svgs';
import { Button, InputField, Text } from 'lib/components';
import { Button, InputField } from 'lib/components';
import { getActiveProjectIdCookie } from '@app/helpers';
import { Switch } from '@headlessui/react';
import debounce from 'lodash/debounce';
import Link from 'next/link';

export const IntegrationSetting = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -165,139 +165,160 @@ export const IntegrationSetting = () => {

return (
<div className="flex flex-col gap-5 mt-5">
<div className="flex flex-row items-center gap-2 w-full justify-between">
<div className="flex flex-row items-center gap-2">
<div className="border-2 border-black p-0.5 rounded-lg bg-black dark:bg-white">
<GitHubLogoIcon width={40} height={40} className="text-white dark:text-black" />
</div>

{/* Divider */}
<div className="h-0.5 bg-[#FFFFFF14]"></div>

<div className="flex flex-col">
<div className="font-medium text-black dark:text-light--theme-light">
{t('pages.settingsTeam.GITHUB')}
<>
<div className="flex flex-row items-center gap-2 w-full justify-between">
<div className="flex flex-row items-center gap-2">
<div className="border-2 border-black p-0.5 rounded-lg bg-black dark:bg-white">
<GitHubLogoIcon width={40} height={40} className="text-white dark:text-black" />
</div>

{/* Divider */}
<div className="h-0.5 bg-[#FFFFFF14]"></div>

<div className="flex flex-col">
{integrationGithubRepositories?.total_count === 0 && (
<div className="font-medium text-black dark:text-light--theme-light">
{t('pages.settingsTeam.GITHUB')}
</div>

<div className="flex flex-col">
{integrationGithubRepositories?.total_count === 0 && (
<div className="text-black dark:text-light--theme-light">
{t('pages.settingsTeam.GITHUB_INTEGRATION_DESCRIPTION')}
</div>
)}

<div className="text-black dark:text-light--theme-light">
{t('pages.settingsTeam.GITHUB_INTEGRATION_DESCRIPTION')}
{t('common.GITHUB_INTEGRATION_SUBTITLE_TEXT')}
</div>
)}

<div className="text-black dark:text-light--theme-light">Lorem impsum</div>
</div>
</div>
</div>
</div>

<Button variant="outline-danger" onClick={handleDeleteIntegrationTenant} className="w-28 h-8 min-w-0">
Remove
</Button>
</div>

<div className="flex flex-col gap-5">
<div className="flex flex-row items-center justify-between">
<div className="flex flex-col gap-1">
<p className="font-semibold text-black">Auto Synk Tasks</p>
<p>
Lorem ipsum dolor sit amet consectetur. In gravida egestas quis arcu mauris sed et mauris.
</p>
</div>
<div>
<Switch
checked={isTasksAutoSync}
onChange={() => {
handleEditOrganizationProject({
autoSync: !isTasksAutoSync
});
setIsTasksAutoSync(!isTasksAutoSync);
}}
className={`${isTasksAutoSync ? 'bg-[#DBD3FA]' : 'bg-[#80808061]'}
relative inline-flex h-[38px] w-[74px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`}
{integrationGithubRepositories && integrationGithubRepositories?.total_count > 0 && (
<Button
variant="outline-danger"
onClick={handleDeleteIntegrationTenant}
className="w-28 h-8 min-w-0"
>
<span className="sr-only">Use setting</span>
<span
aria-hidden="true"
className={`${isTasksAutoSync ? 'translate-x-9 bg-[#3826A6]' : 'bg-white translate-x-1'}
pointer-events-none inline-block h-[30px] w-[30px] mt-[2.5px] transform rounded-full bg-[#3826A6] shadow-lg ring-0 transition duration-200 ease-in-out`}
/>
</Switch>
</div>
Remove
</Button>
)}

{(!integrationGithubRepositories || integrationGithubRepositories?.total_count === 0) && (
<Link
href={url}
className="min-w-0 w-24 bg-primary dark:bg-primary-light text-white text-sm flex flex-row items-center justify-center py-3 px-4 gap-3 rounded-md"
>
{t('pages.settingsTeam.INSTALL')}
</Link>
)}
</div>

<div className="flex flex-row items-center justify-between gap-2">
<div className="flex flex-col gap-1">
<p className="font-semibold text-black">Sync Tasks with specific Label</p>
<p>
Lorem ipsum dolor sit amet consectetur. In gravida egestas quis arcu mauris sed et mauris.
</p>
</div>
<div>
<Switch
checked={isTasksAutoSyncOnLabel}
onChange={() => {
handleEditOrganizationProject({
autoSyncOnLabel: !isTasksAutoSyncOnLabel
});
setIsTasksAutoSyncOnLabel(!isTasksAutoSyncOnLabel);
}}
className={`${isTasksAutoSyncOnLabel ? 'bg-[#DBD3FA]' : 'bg-[#80808061]'}
{integrationGithubRepositories && integrationGithubRepositories?.total_count > 0 && (
<div className="flex flex-col gap-5">
<div className="flex flex-row items-center justify-between">
<div className="flex flex-col gap-1">
<p className="font-semibold text-black">Auto Synk Tasks</p>
<p>{t('common.GITHUB_INTEGRATION_AUTO_SYNC_TASK_TEXT')}</p>
</div>
<div>
<Switch
checked={isTasksAutoSync}
onChange={() => {
handleEditOrganizationProject({
autoSync: !isTasksAutoSync
});
setIsTasksAutoSync(!isTasksAutoSync);
}}
className={`${isTasksAutoSync ? 'bg-[#DBD3FA]' : 'bg-[#80808061]'}
relative inline-flex h-[38px] w-[74px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`}
>
<span className="sr-only">Use setting</span>
<span
aria-hidden="true"
className={`${
isTasksAutoSyncOnLabel ? 'translate-x-9 bg-[#3826A6]' : 'bg-white translate-x-1'
}
>
<span className="sr-only">Use setting</span>
<span
aria-hidden="true"
className={`${
isTasksAutoSync ? 'translate-x-9 bg-[#3826A6]' : 'bg-white translate-x-1'
}
pointer-events-none inline-block h-[30px] w-[30px] mt-[2.5px] transform rounded-full bg-[#3826A6] shadow-lg ring-0 transition duration-200 ease-in-out`}
/>
</Switch>
</div>
</div>
/>
</Switch>
</div>
</div>

<div className="w-full flex flex-row h-10 justify-end">
<div className="flex flex-row items-center gap-2 w-1/2">
<Select value={selectedRepo || undefined} onValueChange={handleSelectRepo}>
<SelectTrigger className="w-96 overflow-hidden text-ellipsis whitespace-nowrap h-full border-[#00000014] dark:border-[#7B8089] dark:bg-dark--theme-light dark:text-white focus:ring-0">
<SelectValue
placeholder={t('pages.settingsTeam.SELECT_REPOSITORY')}
className="dark:bg-dark--theme-light"
/>
</SelectTrigger>
<SelectContent className="w-96">
{integrationGithubRepositories?.repositories?.map((item) => (
<SelectItem
key={item.id}
value={`${item.id}`}
className=" dark:bg-dark--theme-light focus:ring-0"
>
{item.name}
</SelectItem>
))}
</SelectContent>
</Select>

{selectedRepo && (
<Button variant="ghost" className="min-w-0" onClick={handleRemoveRepo}>
<TrashIcon />
</Button>
)}
</div>
<div className="flex flex-row items-center justify-between gap-2">
<div className="flex flex-col gap-1">
<p className="font-semibold text-black">Sync Tasks with specific Label</p>
<p>{t('common.GITHUB_INTEGRATION_LABEL_SYNC_TASK_TEXT')}</p>
</div>
<div>
<Switch
checked={isTasksAutoSyncOnLabel}
onChange={() => {
handleEditOrganizationProject({
autoSyncOnLabel: !isTasksAutoSyncOnLabel
});
setIsTasksAutoSyncOnLabel(!isTasksAutoSyncOnLabel);
}}
className={`${isTasksAutoSyncOnLabel ? 'bg-[#DBD3FA]' : 'bg-[#80808061]'}
relative inline-flex h-[38px] w-[74px] shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75`}
>
<span className="sr-only">Use setting</span>
<span
aria-hidden="true"
className={`${
isTasksAutoSyncOnLabel
? 'translate-x-9 bg-[#3826A6]'
: 'bg-white translate-x-1'
}
pointer-events-none inline-block h-[30px] w-[30px] mt-[2.5px] transform rounded-full bg-[#3826A6] shadow-lg ring-0 transition duration-200 ease-in-out`}
/>
</Switch>
</div>
</div>

{integrationGithubRepositories && integrationGithubRepositories?.total_count > 0 && (
<div className="flex flex-row items-center gap-2 w-1/2">
<InputField
onChange={debounce(handleEditSyncTag, 1000)}
defaultValue={syncTag}
placeholder="Select Auto-sync Label"
className="h-10"
/>
<div className="w-full flex flex-row h-10 justify-end">
<div className="flex flex-row items-center gap-2 w-1/2">
<Select value={selectedRepo || undefined} onValueChange={handleSelectRepo}>
<SelectTrigger className="w-96 overflow-hidden text-ellipsis whitespace-nowrap h-full border-[#00000014] dark:border-[#7B8089] dark:bg-dark--theme-light dark:text-white focus:ring-0">
<SelectValue
placeholder={t('pages.settingsTeam.SELECT_REPOSITORY')}
className="dark:bg-dark--theme-light"
/>
</SelectTrigger>
<SelectContent className="w-96">
{integrationGithubRepositories?.repositories?.map((item) => (
<SelectItem
key={item.id}
value={`${item.id}`}
className=" dark:bg-dark--theme-light focus:ring-0"
>
{item.name}
</SelectItem>
))}
</SelectContent>
</Select>

{selectedRepo && (
<Button variant="ghost" className="min-w-0" onClick={handleRemoveRepo}>
<TrashIcon />
</Button>
)}
</div>

{integrationGithubRepositories?.total_count > 0 && (
<div className="flex flex-row items-center gap-2 w-1/2">
<InputField
onChange={debounce(handleEditSyncTag, 1000)}
defaultValue={syncTag}
placeholder={t('common.GITHUB_AUTO_SYNC_LABEL')}
className="h-10"
/>
</div>
)}
</div>
)}
</div>
</div>
</div>
)}
</>
</div>
);
};
5 changes: 4 additions & 1 deletion apps/web/public/locales/ar/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@
"FILTER_UNSUBSCRIBE": "إلغاء الاشتراك",

"KEYBOARD_SHORTCUTS": "اختصارات لوحة المفاتيح",
"GITHUB_LOADING_TEXT": "نحن الآن في عملية تثبيت التكامل الخاص بك على GitHub، توكّل."
"GITHUB_LOADING_TEXT": "نحن الآن في عملية تثبيت التكامل الخاص بك على GitHub، توكّل.",
"GITHUB_INTEGRATION_AUTO_SYNC_TASK_TEXT": "قم بمزامنة المهام تلقائيًا في تطبيقك لتحديثات سلسة وفعّالة.",
"GITHUB_INTEGRATION_LABEL_SYNC_TASK_TEXT": "تزامن المهام بشكل انتقائي عن طريق ربطها بتصنيف معين.",
"GITHUB_AUTO_SYNC_LABEL": "اختر تسمية التزامن التلقائي"
},
"alerts": {
"ALERT_DELETE_ACCOUNT": "سيتم إزالة الحساب من جميع الفرق، باستثناء حيث أنت المدير فقط",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/public/locales/bg/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@
"FILTER_UNSUBSCRIBE": "Отпиши се",

"KEYBOARD_SHORTCUTS": "Клавишни комбинации",
"GITHUB_LOADING_TEXT": "В момента инсталираме вашия GitHub интеграция, изчакайте..."
"GITHUB_LOADING_TEXT": "В момента инсталираме вашия GitHub интеграция, изчакайте...",
"GITHUB_INTEGRATION_AUTO_SYNC_TASK_TEXT": "Автоматично синхронизирайте задачите в приложението си за безпроблемни и ефективни актуализации.",
"GITHUB_INTEGRATION_LABEL_SYNC_TASK_TEXT": "Синхронизирайте задачите избирателно, като ги свържете с конкретен етикет.",
"GITHUB_AUTO_SYNC_LABEL": "Изберете етикет за автоматична синхронизация"
},
"alerts": {
"ALERT_DELETE_ACCOUNT": "Профилът ще бъде премахнат от всички отбори, освен където сте само мениджър",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/public/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@

"KEYBOARD_SHORTCUTS": "Tastenkombinationen",

"GITHUB_LOADING_TEXT": "Wir installieren jetzt Ihre GitHub-Integration, warten Sie..."
"GITHUB_LOADING_TEXT": "Wir installieren jetzt Ihre GitHub-Integration, warten Sie...",
"GITHUB_INTEGRATION_AUTO_SYNC_TASK_TEXT": "Synchronisieren Sie Aufgaben in Ihrer Anwendung automatisch für nahtlose und effiziente Aktualisierungen.",
"GITHUB_INTEGRATION_LABEL_SYNC_TASK_TEXT": "Synchronisieren Sie Aufgaben selektiv, indem Sie sie mit einem bestimmten Label verknüpfen.",
"GITHUB_AUTO_SYNC_LABEL": "Auto-Sync-Label auswählen"
},
"alerts": {
"ALERT_DELETE_ACCOUNT": "Das Konto wird von allen Teams entfernt, außer wo Sie nur Manager sind",
Expand Down
6 changes: 5 additions & 1 deletion apps/web/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,11 @@

"KEYBOARD_SHORTCUTS": "Keyboard Shortcuts",

"GITHUB_LOADING_TEXT": "We are now installing your GitHub Integration, hold on..."
"GITHUB_LOADING_TEXT": "We are now installing your GitHub Integration, hold on...",
"GITHUB_INTEGRATION_SUBTITLE_TEXT": "Activate GitHub integration for project & repository sync",
"GITHUB_INTEGRATION_AUTO_SYNC_TASK_TEXT": "Automatically synchronize tasks in your application for seamless and efficient updates.",
"GITHUB_INTEGRATION_LABEL_SYNC_TASK_TEXT": "Synchronize tasks selectively by associating them with specific label.",
"GITHUB_AUTO_SYNC_LABEL": "Select Auto-Sync Label"
},
"alerts": {
"ALERT_DELETE_ACCOUNT": "Account will be removed from all teams, except where you are only the manager",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/public/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@
"FILTER_HISTORY": "Historial",
"FILTER_UNSUBSCRIBE": "Darse de baja",
"KEYBOARD_SHORTCUTS": "Atajos de teclado",
"GITHUB_LOADING_TEXT": "Estamos instalando su integración de GitHub, espere..."
"GITHUB_LOADING_TEXT": "Estamos instalando su integración de GitHub, espere...",
"GITHUB_INTEGRATION_AUTO_SYNC_TASK_TEXT": "Sincronice automáticamente tareas en su aplicación para actualizaciones fluidas y eficientes.",
"GITHUB_INTEGRATION_LABEL_SYNC_TASK_TEXT": "Sincronice tareas de manera selectiva asociándolas con una etiqueta específica.",
"GITHUB_AUTO_SYNC_LABEL": "Seleccionar etiqueta de sincronización automática"
},
"alerts": {
"ALERT_DELETE_ACCOUNT": "La cuenta será eliminada de todos los equipos, excepto donde eres sólo el administrador",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/public/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@
"FILTER_UNSUBSCRIBE": "Se désabonner",

"KEYBOARD_SHORTCUTS": "Raccourcis clavier",
"GITHUB_LOADING_TEXT": "Nous installons actuellement votre intégration GitHub, veuillez patienter..."
"GITHUB_LOADING_TEXT": "Nous installons actuellement votre intégration GitHub, veuillez patienter...",
"GITHUB_INTEGRATION_AUTO_SYNC_TASK_TEXT": "Synchronisez automatiquement les tâches dans votre application pour des mises à jour fluides et efficaces.",
"GITHUB_INTEGRATION_LABEL_SYNC_TASK_TEXT": "Synchronisez sélectivement les tâches en les associant à une étiquette spécifique.",
"GITHUB_AUTO_SYNC_LABEL": "Sélectionner l'étiquette de synchronisation automatique"
},
"alerts": {
"ALERT_DELETE_ACCOUNT": "Le compte sera supprimé de toutes les équipes, sauf si vous êtes uniquement le gestionnaire",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/public/locales/he/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@

"KEYBOARD_SHORTCUTS": "קיצורי מקלדת",

"GITHUB_LOADING_TEXT": "אנו מתקינים כעת את אינטגרציית ה-GitHub שלך, המתינו."
"GITHUB_LOADING_TEXT": "אנו מתקינים כעת את אינטגרציית ה-GitHub שלך, המתינו.",
"GITHUB_INTEGRATION_AUTO_SYNC_TASK_TEXT": "סנכרן משימות באופן אוטומטי באפליקציה שלך לעדכונים חלקים ויעילים.",
"GITHUB_INTEGRATION_LABEL_SYNC_TASK_TEXT": "סנכרן משימות באופן בררני על ידי הקשרתן לתג מסוים.",
"GITHUB_AUTO_SYNC_LABEL": "בחר תגית אוטומטית לסנכרון"
},
"alerts": {
"ALERT_DELETE_ACCOUNT": "החשבון יוסר מכל הצוותים, למעט היכן שאתה רק המנהל",
Expand Down
5 changes: 4 additions & 1 deletion apps/web/public/locales/it/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@

"KEYBOARD_SHORTCUTS": "Keyboard Shortcuts",

"GITHUB_LOADING_TEXT": "Stiamo installando la tua integrazione GitHub, attendi..."
"GITHUB_LOADING_TEXT": "Stiamo installando la tua integrazione GitHub, attendi...",
"GITHUB_INTEGRATION_AUTO_SYNC_TASK_TEXT": "Sincronizza automaticamente le attività nella tua applicazione per aggiornamenti senza intoppi ed efficienti.",
"GITHUB_INTEGRATION_LABEL_SYNC_TASK_TEXT": "Sincronizza le attività in modo selettivo associandole a un'etichetta specifica.",
"GITHUB_AUTO_SYNC_LABEL": "Seleziona etichetta di sincronizzazione automatica"
},
"alerts": {
"ALERT_DELETE_ACCOUNT": "Account will be removed from all teams, except where you are only the manager",
Expand Down
Loading

0 comments on commit 5950610

Please sign in to comment.