diff --git a/apps/web/lib/settings/integration-setting.tsx b/apps/web/lib/settings/integration-setting.tsx index 602087332..03c3e990d 100644 --- a/apps/web/lib/settings/integration-setting.tsx +++ b/apps/web/lib/settings/integration-setting.tsx @@ -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(); @@ -164,37 +164,128 @@ export const IntegrationSetting = () => { }, [integrationTenant, deleteIntegrationTenant, getIntegrationTenant]); return ( -
-
-
-
+
+ <> +
+
-
+ {/* Divider */} +
+ +
{t('pages.settingsTeam.GITHUB')}
- {integrationGithubRepositories?.total_count === 0 && ( + +
+ {integrationGithubRepositories?.total_count === 0 && ( +
+ {t('pages.settingsTeam.GITHUB_INTEGRATION_DESCRIPTION')} +
+ )} +
- {t('pages.settingsTeam.GITHUB_INTEGRATION_DESCRIPTION')} + {t('common.GITHUB_INTEGRATION_SUBTITLE_TEXT')}
- )} +
-
- {integrationGithubRepositories && integrationGithubRepositories?.total_count > 0 && ( -
+ {integrationGithubRepositories && integrationGithubRepositories?.total_count > 0 && ( + + )} + + {(!integrationGithubRepositories || integrationGithubRepositories?.total_count === 0) && ( + + {t('pages.settingsTeam.INSTALL')} + + )} +
+ + {integrationGithubRepositories && integrationGithubRepositories?.total_count > 0 && ( +
+
+
+

Auto Synk Tasks

+

{t('common.GITHUB_INTEGRATION_AUTO_SYNC_TASK_TEXT')}

+
+
+ { + 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`} + > + Use setting + +
+
+ +
+
+

Sync Tasks with specific Label

+

{t('common.GITHUB_INTEGRATION_LABEL_SYNC_TASK_TEXT')}

+
+
+ { + 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`} + > + Use setting + +
+
+ +
+