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 0da4e830a..91c268620 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 f73fbe295..e9ebc3679 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 b049c9a1c..1b48517ba 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 54788f7c5..d1213f176 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 a62f626cb..06f9b989f 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 80b432fa3..437192acd 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 5da647fee..8f914ae23 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 4b4b34e18..0391518dd 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 e3bb4f1d8..73a033cbf 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 e8e514ad6..3983423ca 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 8573c0e08..79169e006 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 780f91e95..5ea6dcfce 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 a04ec4398..fa75ac959 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": "制作副本",