@@ -364,22 +367,29 @@ export function PlanHeader({ plan, planMode }: { plan: IDailyPlan; planMode: Fil
const [time, setTime] = useState
(0);
const { updateDailyPlan, updateDailyPlanLoading } = useDailyPlan();
const { isTeamManager } = useAuthenticateUser();
- const t = useTranslations()
+ const t = useTranslations();
// Get all tasks's estimations time
// Helper function to sum times
- const sumTimes = (tasks: ITeamTask[], key: any) =>
- tasks
- ?.map((task: any) => task[key])
- .filter((time): time is number => typeof time === 'number')
- .reduce((acc, cur) => acc + cur, 0) ?? 0;
+ const sumTimes = useCallback((tasks: ITeamTask[], key: any) => {
+ return (
+ tasks
+ ?.map((task: any) => task[key])
+ .filter((time): time is number => typeof time === 'number')
+ .reduce((acc, cur) => acc + cur, 0) ?? 0
+ );
+ }, []);
// Get all tasks' estimation and worked times
- const estimatedTime = sumTimes(plan.tasks!, 'estimate');
- const totalWorkTime = sumTimes(plan.tasks!, 'totalWorkedTime');
+ const estimatedTime = useMemo(() => (plan.tasks ? sumTimes(plan.tasks, 'estimate') : 0), [plan.tasks]);
+ const totalWorkTime = useMemo(() => (plan.tasks ? sumTimes(plan.tasks, 'totalWorkedTime') : 0), [plan.tasks]);
// Get completed and ready tasks from a plan
- const completedTasks = plan.tasks?.filter((task) => task.status === 'completed').length ?? 0;
- const readyTasks = plan.tasks?.filter((task) => task.status === 'ready').length ?? 0;
+ const completedTasks = useMemo(
+ () => plan.tasks?.filter((task) => task.status === 'completed').length ?? 0,
+ [plan.tasks]
+ );
+
+ const readyTasks = useMemo(() => plan.tasks?.filter((task) => task.status === 'ready').length ?? 0, [plan.tasks]);
// Total tasks for the plan
const totalTasks = plan.tasks?.length ?? 0;
@@ -499,14 +509,12 @@ export function PlanHeader({ plan, planMode }: { plan: IDailyPlan; planMode: Fil
}
export function EmptyPlans({ planMode }: { planMode?: FilterTabs }) {
- const t = useTranslations()
+ const t = useTranslations();
return (
}
/>
diff --git a/apps/web/lib/settings/integration-setting.tsx b/apps/web/lib/settings/integration-setting.tsx
index 926e55207..abf9ed0fa 100644
--- a/apps/web/lib/settings/integration-setting.tsx
+++ b/apps/web/lib/settings/integration-setting.tsx
@@ -77,7 +77,7 @@ export const IntegrationSetting = () => {
}
}, [metaData, integrationTenant]);
- const { loading: loadingIntegrationTypes, integrationTypes, getIntegrationTypes } = useIntegrationTypes();
+ const { getIntegrationTypes } = useIntegrationTypes();
useEffect(() => {
if (!integrationTenantLoading && integrationTenant && integrationTenant.length) {
@@ -86,15 +86,13 @@ export const IntegrationSetting = () => {
}, [integrationTenantLoading, integrationTenant, getRepositories]);
useEffect(() => {
- if (!loadingIntegrationTypes && integrationTypes.length === 0) {
- getIntegrationTypes().then((types) => {
- const allIntegrations = types.find((item: any) => item.name === 'All Integrations');
- if (allIntegrations && allIntegrations?.id) {
- getIntegrationTenant('Github');
- }
- });
- }
- }, [loadingIntegrationTypes, integrationTypes, getIntegrationTypes, getIntegrationTenant]);
+ getIntegrationTypes().then((types) => {
+ const allIntegrations = types.find((item: any) => item.name === 'All Integrations');
+ if (allIntegrations && allIntegrations?.id) {
+ getIntegrationTenant('Github');
+ }
+ });
+ }, [getIntegrationTypes, getIntegrationTenant]);
const handleSelectRepo = useCallback(
(value: string) => {
diff --git a/apps/web/lib/settings/member-setting.tsx b/apps/web/lib/settings/member-setting.tsx
index 247edc5c8..d270f32fb 100644
--- a/apps/web/lib/settings/member-setting.tsx
+++ b/apps/web/lib/settings/member-setting.tsx
@@ -2,7 +2,7 @@ import { useAuthenticateUser, useModal, useOrganizationTeams } from '@app/hooks'
import { Button, InputField, NoData, Text } from 'lib/components';
import { SearchNormalIcon } from 'assets/svg';
import { InviteFormModal } from 'lib/features/team/invite/invite-form-modal';
-import { ChangeEvent, useState } from 'react';
+import { ChangeEvent, useMemo, useState } from 'react';
import { useTranslations } from 'next-intl';
import { MemberTable } from './member-table';
@@ -15,12 +15,15 @@ export const MemberSetting = () => {
const { user } = useAuthenticateUser();
const { isOpen, closeModal } = useModal();
- const members =
- activeTeam?.members.filter(
- (member) =>
- member.employee.fullName.toLowerCase().includes(filterString) ||
- member.employee.user?.email.toLowerCase().includes(filterString)
- ) || [];
+ const members = useMemo(() => {
+ return (
+ activeTeam?.members.filter(
+ (member) =>
+ member.employee.fullName.toLowerCase().includes(filterString) ||
+ member.employee.user?.email.toLowerCase().includes(filterString)
+ ) || []
+ );
+ }, [activeTeam, filterString]);
return (
diff --git a/apps/web/lib/settings/version-form.tsx b/apps/web/lib/settings/version-form.tsx
index feaf8b2f0..342c7a3bc 100644
--- a/apps/web/lib/settings/version-form.tsx
+++ b/apps/web/lib/settings/version-form.tsx
@@ -85,7 +85,7 @@ export const VersionForm = ({ formOnly = false, onCreated, onVersionCreated }: S
});
}
},
- [edit, createNew, formOnly, onCreated, editTaskVersion, user, reset, createTaskVersion, refetch]
+ [edit, createNew, formOnly, onCreated, editTaskVersion, user, reset, createTaskVersion, refetch, $onVersionCreated]
);
return (
diff --git a/apps/web/locales/ar.json b/apps/web/locales/ar.json
index cd91c9370..5f56fd779 100644
--- a/apps/web/locales/ar.json
+++ b/apps/web/locales/ar.json
@@ -296,7 +296,8 @@
"LOGIN": "تسجيل الدخول",
"SELECT_WORKSPACE": "تحديد مساحة العمل",
"ENTER_EMAIL": "أدخل البريد الإلكتروني",
- "WORKSPACES_NOT_FOUND": "لم يتم العثور على مساحات عمل"
+ "WORKSPACES_NOT_FOUND": "لم يتم العثور على مساحات عمل",
+ "INVALID_CODE_TRY_AGAIN": "رمز غير صالح. الرجاء المحاولة مرة أخرى."
},
"authPasscode": {
"HEADING_TITLE": "الانضمام إلى فريق موجود",
diff --git a/apps/web/locales/bg.json b/apps/web/locales/bg.json
index c2b557261..209e832c9 100644
--- a/apps/web/locales/bg.json
+++ b/apps/web/locales/bg.json
@@ -296,7 +296,8 @@
"LOGIN": "Вход",
"SELECT_WORKSPACE": "Избери работно пространство",
"ENTER_EMAIL": "Въведи имейл",
- "WORKSPACES_NOT_FOUND": "Работни пространства не са намерени"
+ "WORKSPACES_NOT_FOUND": "Работни пространства не са намерени",
+ "INVALID_CODE_TRY_AGAIN": "Невалиден код. Моля, опитайте отново."
},
"authPasscode": {
"HEADING_TITLE": "Присъединяване към съществуващ отбор",
diff --git a/apps/web/locales/de.json b/apps/web/locales/de.json
index d4f4703d2..f7c2b4f45 100644
--- a/apps/web/locales/de.json
+++ b/apps/web/locales/de.json
@@ -296,7 +296,8 @@
"LOGIN": "Anmelden",
"SELECT_WORKSPACE": "Arbeitsbereich auswählen",
"ENTER_EMAIL": "E-Mail-Adresse eingeben",
- "WORKSPACES_NOT_FOUND": "Keine Arbeitsbereiche gefunden"
+ "WORKSPACES_NOT_FOUND": "Keine Arbeitsbereiche gefunden",
+ "INVALID_CODE_TRY_AGAIN": "Ungültiger Code. Bitte versuchen Sie es erneut."
},
"authPasscode": {
"HEADING_TITLE": "Bestehendem Team beitreten",
diff --git a/apps/web/locales/en.json b/apps/web/locales/en.json
index 2404933a2..b065e7ef2 100644
--- a/apps/web/locales/en.json
+++ b/apps/web/locales/en.json
@@ -296,7 +296,8 @@
"LOGIN": "Login",
"SELECT_WORKSPACE": "Select Workspace",
"ENTER_EMAIL": "Enter Email",
- "WORKSPACES_NOT_FOUND": "Workspaces Not Found"
+ "WORKSPACES_NOT_FOUND": "Workspaces Not Found",
+ "INVALID_CODE_TRY_AGAIN": "Invalid code. Please try again."
},
"authPasscode": {
"HEADING_TITLE": "Join existing Team",
diff --git a/apps/web/locales/es.json b/apps/web/locales/es.json
index 8a1aaa7bc..eb6061601 100644
--- a/apps/web/locales/es.json
+++ b/apps/web/locales/es.json
@@ -296,7 +296,8 @@
"LOGIN": "Iniciar sesión",
"SELECT_WORKSPACE": "Seleccionar espacio de trabajo",
"ENTER_EMAIL": "Ingresar correo electrónico",
- "WORKSPACES_NOT_FOUND": "Espacios de trabajo no encontrados"
+ "WORKSPACES_NOT_FOUND": "Espacios de trabajo no encontrados",
+ "INVALID_CODE_TRY_AGAIN": "Código inválido. Por favor, inténtelo de nuevo."
},
"authPasscode": {
"HEADING_TITLE": "Unirse a equipo existente",
diff --git a/apps/web/locales/fr.json b/apps/web/locales/fr.json
index 355ccf4da..00bb80be0 100644
--- a/apps/web/locales/fr.json
+++ b/apps/web/locales/fr.json
@@ -296,7 +296,8 @@
"LOGIN": "Connexion",
"SELECT_WORKSPACE": "Sélectionner un espace de travail",
"ENTER_EMAIL": "Saisissez votre adresse e-mail",
- "WORKSPACES_NOT_FOUND": "Aucun espace de travail trouvé"
+ "WORKSPACES_NOT_FOUND": "Aucun espace de travail trouvé",
+ "INVALID_CODE_TRY_AGAIN": "Code invalide. Veuillez réessayer."
},
"authPasscode": {
"HEADING_TITLE": "Rejoindre une équipe existante",
diff --git a/apps/web/locales/he.json b/apps/web/locales/he.json
index 67d706cd6..58dee1f99 100644
--- a/apps/web/locales/he.json
+++ b/apps/web/locales/he.json
@@ -296,7 +296,8 @@
"LOGIN": "התחברות",
"SELECT_WORKSPACE": "בחר סביבת עבודה",
"ENTER_EMAIL": "הכנס אימייל",
- "WORKSPACES_NOT_FOUND": "סביבות עבודה לא נמצאו"
+ "WORKSPACES_NOT_FOUND": "סביבות עבודה לא נמצאו",
+ "INVALID_CODE_TRY_AGAIN": "קוד לא תקין. אנא נסה שוב."
},
"authPasscode": {
"HEADING_TITLE": "הצטרף לצוות קיים",
diff --git a/apps/web/locales/it.json b/apps/web/locales/it.json
index 6e51df61f..9c31d6ef1 100644
--- a/apps/web/locales/it.json
+++ b/apps/web/locales/it.json
@@ -296,7 +296,8 @@
"LOGIN": "Accesso",
"SELECT_WORKSPACE": "Seleziona Spazio di Lavoro",
"ENTER_EMAIL": "Inserisci l'Email",
- "WORKSPACES_NOT_FOUND": "Spazi di Lavoro Non Trovati"
+ "WORKSPACES_NOT_FOUND": "Spazi di Lavoro Non Trovati",
+ "INVALID_CODE_TRY_AGAIN": "Codice non valido. Riprova."
},
"authPasscode": {
"HEADING_TITLE": "Unisciti a un Team esistente",
diff --git a/apps/web/locales/nl.json b/apps/web/locales/nl.json
index 906620c98..b5dd23f75 100644
--- a/apps/web/locales/nl.json
+++ b/apps/web/locales/nl.json
@@ -296,7 +296,8 @@
"LOGIN": "Inloggen",
"SELECT_WORKSPACE": "Selecteer werkruimte",
"ENTER_EMAIL": "Voer e-mail in",
- "WORKSPACES_NOT_FOUND": "Werkruimtes niet gevonden"
+ "WORKSPACES_NOT_FOUND": "Werkruimtes niet gevonden",
+ "INVALID_CODE_TRY_AGAIN": "Ongeldige code. Probeer opnieuw."
},
"authPasscode": {
"HEADING_TITLE": "Bestaand team joinen",
diff --git a/apps/web/locales/pl.json b/apps/web/locales/pl.json
index e53b3b7c0..6f9576da1 100644
--- a/apps/web/locales/pl.json
+++ b/apps/web/locales/pl.json
@@ -296,7 +296,8 @@
"LOGIN": "Zaloguj się",
"SELECT_WORKSPACE": "Wybierz Przestrzeń Roboczą",
"ENTER_EMAIL": "Wprowadź E-mail",
- "WORKSPACES_NOT_FOUND": "Nie znaleziono Przestrzeni Roboczych"
+ "WORKSPACES_NOT_FOUND": "Nie znaleziono Przestrzeni Roboczych",
+ "INVALID_CODE_TRY_AGAIN": "Nieprawidłowy Kod. Proszę spróbować ponownie."
},
"authPasscode": {
"HEADING_TITLE": "Dołącz do istniejącego zespołu",
diff --git a/apps/web/locales/pt.json b/apps/web/locales/pt.json
index f8f97c59e..c9ccab653 100644
--- a/apps/web/locales/pt.json
+++ b/apps/web/locales/pt.json
@@ -296,7 +296,8 @@
"LOGIN": "Login",
"SELECT_WORKSPACE": "Selecionar Espaço de Trabalho",
"ENTER_EMAIL": "Inserir E-mail",
- "WORKSPACES_NOT_FOUND": "Espaços de trabalho não encontrados"
+ "WORKSPACES_NOT_FOUND": "Espaços de trabalho não encontrados",
+ "INVALID_CODE_TRY_AGAIN": "Código inválido. Por favor, tente novamente."
},
"authPasscode": {
"HEADING_TITLE": "Participar de uma Equipe Existente",
diff --git a/apps/web/locales/ru.json b/apps/web/locales/ru.json
index 23351cc4c..6b77428b1 100644
--- a/apps/web/locales/ru.json
+++ b/apps/web/locales/ru.json
@@ -296,7 +296,8 @@
"LOGIN": "Войти",
"SELECT_WORKSPACE": "Выберите рабочее пространство",
"ENTER_EMAIL": "Введите электронную почту",
- "WORKSPACES_NOT_FOUND": "Рабочие пространства не найдены"
+ "WORKSPACES_NOT_FOUND": "Рабочие пространства не найдены",
+ "INVALID_CODE_TRY_AGAIN": "Неверный код. Пожалуйста, попробуйте еще раз."
},
"authPasscode": {
"HEADING_TITLE": "Присоединиться к существующей команде",
diff --git a/apps/web/locales/zh.json b/apps/web/locales/zh.json
index 41eaf0ad4..3a0522790 100644
--- a/apps/web/locales/zh.json
+++ b/apps/web/locales/zh.json
@@ -296,7 +296,8 @@
"LOGIN": "登录",
"SELECT_WORKSPACE": "选择工作区",
"ENTER_EMAIL": "输入电子邮箱",
- "WORKSPACES_NOT_FOUND": "工作区未找到"
+ "WORKSPACES_NOT_FOUND": "工作区未找到",
+ "INVALID_CODE_TRY_AGAIN": "无效的代码。请重试。"
},
"authPasscode": {
"HEADING_TITLE": "加入已有团队",