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] 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 (