diff --git a/apps/web/lib/features/user-profile-plans.tsx b/apps/web/lib/features/user-profile-plans.tsx
index 8ad9a78a6..0ec07b9c9 100644
--- a/apps/web/lib/features/user-profile-plans.tsx
+++ b/apps/web/lib/features/user-profile-plans.tsx
@@ -10,7 +10,14 @@ import { IoCalendarOutline } from 'react-icons/io5';
import { formatDayPlanDate, formatIntegerToHour } from '@app/helpers';
import { handleDragAndDrop } from '@app/helpers/drag-and-drop';
-import { useAuthenticateUser, useCanSeeActivityScreen, useDailyPlan, useUserProfilePage } from '@app/hooks';
+import {
+ useAuthenticateUser,
+ useCanSeeActivityScreen,
+ useDailyPlan,
+ useTeamTasks,
+ useTimer,
+ useUserProfilePage
+} from '@app/hooks';
import { useDateRange } from '@app/hooks/useDateRange';
import { filterDailyPlan } from '@app/hooks/useFilterDateRange';
import { useLocalStorageState } from '@app/hooks/useLocalStorageState';
@@ -54,9 +61,7 @@ export function UserProfilePlans() {
const { todayPlan, futurePlans, pastPlans, outstandingPlans, sortedPlans, profileDailyPlans } = useDailyPlan();
const fullWidth = useAtomValue(fullWidthState);
const [currentOutstanding, setCurrentOutstanding] = useLocalStorageState('outstanding', 'ALL');
-
const [currentTab, setCurrentTab] = useLocalStorageState('daily-plan-tab', 'Today Tasks');
-
const [currentDataDailyPlan, setCurrentDataDailyPlan] = useAtom(dataDailyPlanState);
const { setDate, date } = useDateRange(currentTab);
@@ -77,6 +82,9 @@ export function UserProfilePlans() {
const dailyPlanSuggestionModalDate = window && window?.localStorage.getItem(DAILY_PLAN_SUGGESTION_MODAL_DATE);
const path = usePathname();
const haveSeenDailyPlanSuggestionModal = window?.localStorage.getItem(HAS_SEEN_DAILY_PLAN_SUGGESTION_MODAL);
+ const { hasPlan } = useTimer();
+ const { activeTeam } = useTeamTasks();
+ const requirePlan = useMemo(() => activeTeam?.requirePlanToTrack, [activeTeam?.requirePlanToTrack]);
// Set the tab plan tab to outstanding if user has no daily plan and there are outstanding tasks (on first load)
useEffect(() => {
@@ -85,7 +93,12 @@ export function UserProfilePlans() {
setCurrentTab('Outstanding');
}
if (haveSeenDailyPlanSuggestionModal == new Date().toISOString().split('T')[0]) {
- window.localStorage.setItem(DAILY_PLAN_SUGGESTION_MODAL_DATE, new Date().toISOString().split('T')[0]);
+ if (!requirePlan || (requirePlan && hasPlan)) {
+ window.localStorage.setItem(
+ DAILY_PLAN_SUGGESTION_MODAL_DATE,
+ new Date().toISOString().split('T')[0]
+ );
+ }
}
}
@@ -207,6 +220,9 @@ function AllPlans({ profile, currentTab = 'All Tasks' }: { profile: any; current
const [popupOpen, setPopupOpen] = useState(false);
const [currentDeleteIndex, setCurrentDeleteIndex] = useState(0);
const { date } = useDateRange(currentTab);
+ const { activeTeam } = useTeamTasks();
+ const requirePlan = useMemo(() => activeTeam?.requirePlanToTrack, [activeTeam?.requirePlanToTrack]);
+ const t = useTranslations();
if (currentTab === 'Today Tasks') {
filteredPlans.current = todayPlan;
@@ -338,21 +354,28 @@ function AllPlans({ profile, currentTab = 'All Tasks' }: { profile: any; current
variant="outline"
className="px-4 py-2 text-sm font-medium text-red-600 border border-red-600 rounded-md bg-light--theme-light dark:!bg-dark--theme-light"
>
- Delete this plan
+ {t('common.plan.DELETE_THIS_PLAN')}
}
>
{/*button confirm*/}
{/*button cancel*/}
diff --git a/apps/web/locales/ar.json b/apps/web/locales/ar.json
index 8d125389b..0cc29dff3 100644
--- a/apps/web/locales/ar.json
+++ b/apps/web/locales/ar.json
@@ -217,7 +217,8 @@
"EDIT_PLAN": "تعديل الخطة",
"TRACKED_TIME": "الوقت المتعقب",
"SEE_PLANS": "عرض الخطط",
- "ADD_PLAN": "إضافة خطة"
+ "ADD_PLAN": "إضافة خطة",
+ "DELETE_THIS_PLAN": "احذف هذه الخطة"
},
"timesheets": {
"SINGULAR": "ورقة الحضور",
diff --git a/apps/web/locales/bg.json b/apps/web/locales/bg.json
index 3f8b6fe8c..f401eaa36 100644
--- a/apps/web/locales/bg.json
+++ b/apps/web/locales/bg.json
@@ -217,7 +217,8 @@
"EDIT_PLAN": "Редактиране на план",
"TRACKED_TIME": "Проследено време",
"SEE_PLANS": "Виж планове",
- "ADD_PLAN": "Добави план"
+ "ADD_PLAN": "Добави план",
+ "DELETE_THIS_PLAN": "Изтрийте този план"
},
"timesheets": {
"SINGULAR": "Работен лист",
diff --git a/apps/web/locales/de.json b/apps/web/locales/de.json
index 133934101..f53a9a886 100644
--- a/apps/web/locales/de.json
+++ b/apps/web/locales/de.json
@@ -217,7 +217,8 @@
"EDIT_PLAN": "Plan bearbeiten",
"TRACKED_TIME": "Verfolgte Zeit",
"SEE_PLANS": "Pläne anzeigen",
- "ADD_PLAN": "Plan hinzufügen"
+ "ADD_PLAN": "Plan hinzufügen",
+ "DELETE_THIS_PLAN": "Diesen Plan löschen"
},
"timesheets": {
"SINGULAR": "Stundenzettel",
diff --git a/apps/web/locales/en.json b/apps/web/locales/en.json
index 4692276dc..4ec15a92e 100644
--- a/apps/web/locales/en.json
+++ b/apps/web/locales/en.json
@@ -217,7 +217,8 @@
"EDIT_PLAN": "Edit Plan",
"TRACKED_TIME": "Tracked time",
"SEE_PLANS": "See plans",
- "ADD_PLAN": "Add Plan"
+ "ADD_PLAN": "Add Plan",
+ "DELETE_THIS_PLAN": "Delete this plan"
},
"timesheets": {
"SINGULAR": "Timesheet",
diff --git a/apps/web/locales/es.json b/apps/web/locales/es.json
index 2bfadb58b..5f962410b 100644
--- a/apps/web/locales/es.json
+++ b/apps/web/locales/es.json
@@ -217,7 +217,8 @@
"ADD_PLAN": "Agregar Plan",
"TRACKED_TIME": "Tiempo registrado",
"SEE_PLANS": "Ver planes",
- "FOR_TOMORROW": "Plan de mañana"
+ "FOR_TOMORROW": "Plan de mañana",
+ "DELETE_THIS_PLAN": "Eliminar este plan"
},
"timesheets": {
"SINGULAR": "Hoja de horas",
diff --git a/apps/web/locales/fr.json b/apps/web/locales/fr.json
index 32440addd..2237827a9 100644
--- a/apps/web/locales/fr.json
+++ b/apps/web/locales/fr.json
@@ -217,7 +217,8 @@
"EDIT_PLAN": "Modifier le plan",
"TRACKED_TIME": "Temps suivi",
"SEE_PLANS": "Voir les plans",
- "ADD_PLAN": "Ajouter un plan"
+ "ADD_PLAN": "Ajouter un plan",
+ "DELETE_THIS_PLAN": "Supprimer ce plan"
},
"timesheets": {
"SINGULAR": "Feuille de temps",
diff --git a/apps/web/locales/he.json b/apps/web/locales/he.json
index 5d9df1e15..ed4bd8807 100644
--- a/apps/web/locales/he.json
+++ b/apps/web/locales/he.json
@@ -217,7 +217,8 @@
"EDIT_PLAN": "ערוך תוכנית",
"TRACKED_TIME": "זמן מעקב",
"SEE_PLANS": "ראה תוכניות",
- "ADD_PLAN": "הוסף תוכנית"
+ "ADD_PLAN": "הוסף תוכנית",
+ "DELETE_THIS_PLAN": "מחק את התוכנית הזו"
},
"timesheets": {
"SINGULAR": "דוח שעות",
diff --git a/apps/web/locales/it.json b/apps/web/locales/it.json
index bd11fbd71..ef56b6976 100644
--- a/apps/web/locales/it.json
+++ b/apps/web/locales/it.json
@@ -221,7 +221,8 @@
"EDIT_PLAN": "Modifica Piano",
"TRACKED_TIME": "Tempo tracciato",
"SEE_PLANS": "Vedi piani",
- "ADD_PLAN": "Aggiungi Piano"
+ "ADD_PLAN": "Aggiungi Piano",
+ "DELETE_THIS_PLAN": "Elimina questo piano"
},
"COPY_ISSUE_LINK": "Copia collegamento problema",
"MAKE_A_COPY": "Fai una copia",
diff --git a/apps/web/locales/nl.json b/apps/web/locales/nl.json
index c59d6f29d..dec963075 100644
--- a/apps/web/locales/nl.json
+++ b/apps/web/locales/nl.json
@@ -221,7 +221,8 @@
"EDIT_PLAN": "Plan bewerken",
"TRACKED_TIME": "Gegeneraliseerde tijd",
"SEE_PLANS": "Plannen bekijken",
- "ADD_PLAN": "Plan toevoegen"
+ "ADD_PLAN": "Plan toevoegen",
+ "DELETE_THIS_PLAN": "Verwijder dit plan"
},
"COPY_ISSUE_LINK": "Probleemlink kopiëren",
"MAKE_A_COPY": "Maak een kopie",
diff --git a/apps/web/locales/pl.json b/apps/web/locales/pl.json
index 013652426..566aec919 100644
--- a/apps/web/locales/pl.json
+++ b/apps/web/locales/pl.json
@@ -221,7 +221,8 @@
"EDIT_PLAN": "Edytuj plan",
"TRACKED_TIME": "Śledzony czas",
"SEE_PLANS": "Zobacz plany",
- "ADD_PLAN": "Dodaj plan"
+ "ADD_PLAN": "Dodaj plan",
+ "DELETE_THIS_PLAN": "Usuń ten plan"
},
"COPY_ISSUE_LINK": "Skopiuj link do zgłoszenia",
"MAKE_A_COPY": "Zrób kopię",
diff --git a/apps/web/locales/pt.json b/apps/web/locales/pt.json
index a21389cf1..e907d74e9 100644
--- a/apps/web/locales/pt.json
+++ b/apps/web/locales/pt.json
@@ -221,7 +221,8 @@
"EDIT_PLAN": "Editar Plano",
"TRACKED_TIME": "Tempo rastreado",
"SEE_PLANS": "Ver planos",
- "ADD_PLAN": "Adicionar Plano"
+ "ADD_PLAN": "Adicionar Plano",
+ "DELETE_THIS_PLAN": "Excluir este plano"
},
"COPY_ISSUE_LINK": "Copiar link do problema",
"MAKE_A_COPY": "Fazer uma cópia",
diff --git a/apps/web/locales/ru.json b/apps/web/locales/ru.json
index 7c58dd7a6..63081f89b 100644
--- a/apps/web/locales/ru.json
+++ b/apps/web/locales/ru.json
@@ -221,7 +221,8 @@
"EDIT_PLAN": "Редактировать план",
"TRACKED_TIME": "Отслеживаемое время",
"SEE_PLANS": "Посмотреть планы",
- "ADD_PLAN": "Agregar Plan"
+ "ADD_PLAN": "Agregar Plan",
+ "DELETE_THIS_PLAN": "Удалить этот план"
},
"COPY_ISSUE_LINK": "Скопировать ссылку на проблему",
"MAKE_A_COPY": "Сделать копию",
diff --git a/apps/web/locales/zh.json b/apps/web/locales/zh.json
index 5e8860b36..b3e5bae92 100644
--- a/apps/web/locales/zh.json
+++ b/apps/web/locales/zh.json
@@ -221,7 +221,8 @@
"EDIT_PLAN": "编辑计划",
"TRACKED_TIME": "跟踪时间",
"SEE_PLANS": "查看计划",
- "ADD_PLAN": "添加计划"
+ "ADD_PLAN": "添加计划",
+ "DELETE_THIS_PLAN": "删除此计划"
},
"COPY_ISSUE_LINK": "复制问题链接",
"MAKE_A_COPY": "制作副本",