From 05bd6ad55aee2d37f5fa5e9cc52c1d237486b6e2 Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Tue, 20 Aug 2024 01:36:42 +0200 Subject: [PATCH 1/8] feat: redirect to 'unassigned' if no oustanding / assigned (SOFT FLOW) --- apps/web/lib/features/task/task-filters.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/apps/web/lib/features/task/task-filters.tsx b/apps/web/lib/features/task/task-filters.tsx index a519e2c17..afa7f4908 100644 --- a/apps/web/lib/features/task/task-filters.tsx +++ b/apps/web/lib/features/task/task-filters.tsx @@ -121,7 +121,7 @@ export function useTaskFilter(profile: I_UserProfilePage) { if (activeTeam?.shareProfileView || canSeeActivity) { tabs.push({ tab: 'dailyplan', - name: t('common.DAILYPLAN'as DottedLanguageObjectStringPaths) , + name: t('common.DAILYPLAN' as DottedLanguageObjectStringPaths), description: t('task.tabFilter.DAILYPLAN_DESCRIPTION' as DottedLanguageObjectStringPaths), count: profile.tasksGrouped.planned }); @@ -174,8 +174,10 @@ export function useTaskFilter(profile: I_UserProfilePage) { if (!getTotalTasks(todayPlan)) { if (estimatedTotalTime(outstandingPlans).totalTasks) { setTab('dailyplan'); - } else { + } else if (profile.tasksGrouped.assignedTasks.length) { setTab('assigned'); + } else { + setTab('unassigned'); } } } @@ -377,11 +379,7 @@ function InputFilters({ hook, profile }: Props) { - + ); } From c1bd454af8af1a43f13f08a70b4e80acf7d6620f Mon Sep 17 00:00:00 2001 From: "Thierry CH." Date: Wed, 21 Aug 2024 22:23:24 +0200 Subject: [PATCH 2/8] fixbug: SOFT FLOW, popups logic when user added the today plan yesterday :ok_hand: (#2941) --- apps/web/app/hooks/features/useStartStopTimerHandler.ts | 6 +++++- .../daily-plan/add-daily-plan-work-hours-modal.tsx | 6 +++--- .../daily-plan/add-task-estimation-hours-modal.tsx | 7 ++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/apps/web/app/hooks/features/useStartStopTimerHandler.ts b/apps/web/app/hooks/features/useStartStopTimerHandler.ts index 9760a68c0..48c5d74f8 100644 --- a/apps/web/app/hooks/features/useStartStopTimerHandler.ts +++ b/apps/web/app/hooks/features/useStartStopTimerHandler.ts @@ -88,7 +88,11 @@ export function useStartStopTimerHandler() { startTimer(); } } else { - openAddTasksEstimationHoursModal(); + if (tasksEstimateHoursModalDate != currentDate) { + openAddTasksEstimationHoursModal(); + } else { + startTimer(); + } } } else { startTimer(); diff --git a/apps/web/lib/features/daily-plan/add-daily-plan-work-hours-modal.tsx b/apps/web/lib/features/daily-plan/add-daily-plan-work-hours-modal.tsx index 115b7c694..aa66a0d35 100644 --- a/apps/web/lib/features/daily-plan/add-daily-plan-work-hours-modal.tsx +++ b/apps/web/lib/features/daily-plan/add-daily-plan-work-hours-modal.tsx @@ -28,13 +28,13 @@ export function AddDailyPlanWorkHourModal(props: IAddDailyPlanWorkHoursModalProp const handleCloseModal = useCallback(() => { localStorage.setItem(DAILY_PLAN_ESTIMATE_HOURS_MODAL_DATE, currentDate); closeModal(); - }, [closeModal, currentDate]); + startTimer(); + }, [closeModal, currentDate, startTimer]); const handleSubmit = useCallback(() => { updateDailyPlan({ workTimePlanned }, plan.id ?? ''); - startTimer(); handleCloseModal(); - }, [handleCloseModal, plan.id, startTimer, updateDailyPlan, workTimePlanned]); + }, [handleCloseModal, plan.id, updateDailyPlan, workTimePlanned]); return ( diff --git a/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx b/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx index f415c0413..dda0385bb 100644 --- a/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx +++ b/apps/web/lib/features/daily-plan/add-task-estimation-hours-modal.tsx @@ -31,13 +31,14 @@ export function AddTasksEstimationHoursModal(props: IAddTasksEstimationHoursModa const handleCloseModal = useCallback(() => { localStorage.setItem(TASKS_ESTIMATE_HOURS_MODAL_DATE, currentDate); closeModal(); - }, [closeModal, currentDate]); + startTimer(); + }, [closeModal, currentDate, startTimer]); const handleSubmit = useCallback(() => { updateDailyPlan({ workTimePlanned }, plan.id ?? ''); - startTimer(); + handleCloseModal(); - }, [handleCloseModal, plan.id, startTimer, updateDailyPlan, workTimePlanned]); + }, [handleCloseModal, plan.id, updateDailyPlan, workTimePlanned]); return ( From b3c01385861b59773692c4d581a8b0e132489152 Mon Sep 17 00:00:00 2001 From: AKILIMAILI CIZUNGU Innocent <51681130+Innocent-Akim@users.noreply.github.com> Date: Thu, 22 Aug 2024 07:52:01 +0200 Subject: [PATCH 3/8] Feat: refact timesheet (#2940) * feat: refact timesheet * fix: cspell * fix: setCalendarTimeSheet is defined but never used. * improv: timesheet --- .cspell.json | 1 + apps/web/app/[locale]/calendar/component.tsx | 103 +++++---- apps/web/app/[locale]/calendar/page.tsx | 17 +- apps/web/components/ui/badge.tsx | 36 +++ .../calendar/calendar-component.tsx | 17 +- .../integrations/calendar/helper-calendar.ts | 91 ++++++++ .../calendar/setup-full-calendar.tsx | 21 +- .../calendar/setup-time-sheet.tsx | 13 +- .../calendar/table-time-sheet.tsx | 214 +++++++++--------- .../calendar/time-sheet-filter-popover.tsx | 13 +- apps/web/lib/features/task/task-filters.tsx | 26 ++- 11 files changed, 365 insertions(+), 187 deletions(-) create mode 100644 apps/web/components/ui/badge.tsx diff --git a/.cspell.json b/.cspell.json index 0da70ed82..7d564cd35 100644 --- a/.cspell.json +++ b/.cspell.json @@ -33,6 +33,7 @@ "Bowser", "Btns", "Konviser", + "Ruslan", "Bugsnag", "buildjet", "cacheable", diff --git a/apps/web/app/[locale]/calendar/component.tsx b/apps/web/app/[locale]/calendar/component.tsx index 3a44ef27e..4be0c2305 100644 --- a/apps/web/app/[locale]/calendar/component.tsx +++ b/apps/web/app/[locale]/calendar/component.tsx @@ -17,6 +17,7 @@ import { CalendarDays } from "lucide-react"; import React from "react"; import { DateRange } from "react-day-picker"; import { LuCalendarDays } from "react-icons/lu"; +import { Input } from "@components/ui/input"; export function HeadCalendar({ openModal, @@ -65,54 +66,65 @@ export function HeadTimeSheet({ timesheet }: { timesheet?: timesheetCalendar }) from: new Date(2022, 0, 20), to: addDays(new Date(2022, 0, 20), 20) }); - console.log(timesheet); return (
{timesheet === 'TimeSheet' && ( -
-
- -
- - - - - } - mode={'range'} - numberOfMonths={2} - initialFocus - defaultMonth={date?.from} - selected={date} - onSelect={(value) => { - value && setDate(value); - }} +
+ -
- + +
+
+ +
+
+ + + + + } + mode={'range'} + numberOfMonths={2} + initialFocus + defaultMonth={date?.from} + selected={date} + onSelect={(value) => { + value && setDate(value); + }} + /> +
+
+ +
)} @@ -133,9 +145,8 @@ export function CustomSelect() { return (