diff --git a/apps/web/app/[locale]/timesheet/components/CalendarView.tsx b/apps/web/app/[locale]/timesheet/[memberId]/components/CalendarView.tsx similarity index 100% rename from apps/web/app/[locale]/timesheet/components/CalendarView.tsx rename to apps/web/app/[locale]/timesheet/[memberId]/components/CalendarView.tsx diff --git a/apps/web/app/[locale]/timesheet/components/FilterWithStatus.tsx b/apps/web/app/[locale]/timesheet/[memberId]/components/FilterWithStatus.tsx similarity index 93% rename from apps/web/app/[locale]/timesheet/components/FilterWithStatus.tsx rename to apps/web/app/[locale]/timesheet/[memberId]/components/FilterWithStatus.tsx index f03c3f2e4..008a1fa04 100644 --- a/apps/web/app/[locale]/timesheet/components/FilterWithStatus.tsx +++ b/apps/web/app/[locale]/timesheet/[memberId]/components/FilterWithStatus.tsx @@ -26,11 +26,11 @@ export function FilterWithStatus({ key={index} className={clsxm( 'group flex items-center justify-start h-[2.2rem] rounded-xl border w-full', - 'dark:bg-dark--theme-light dark:border-gray-700 bg-[#e2e8f0aa] text[#71717A] w-[80px]', + 'dark:bg-dark--theme-light dark:border-gray-700 bg-transparent text[#71717A] w-[80px]', activeStatus === label && 'text-primary bg-white shadow-lg font-bold' )} onClick={() => onToggle(label)}> - {label} + {label} {count} ))} diff --git a/apps/web/app/[locale]/timesheet/components/FrequencySelect.tsx b/apps/web/app/[locale]/timesheet/[memberId]/components/FrequencySelect.tsx similarity index 97% rename from apps/web/app/[locale]/timesheet/components/FrequencySelect.tsx rename to apps/web/app/[locale]/timesheet/[memberId]/components/FrequencySelect.tsx index f9cf9a678..d94137daf 100644 --- a/apps/web/app/[locale]/timesheet/components/FrequencySelect.tsx +++ b/apps/web/app/[locale]/timesheet/[memberId]/components/FrequencySelect.tsx @@ -39,7 +39,7 @@ export function FrequencySelect() { @@ -122,7 +131,7 @@ function TimeSheetPage() {
{timesheetNavigator === 'ListView' ? - + : }
@@ -133,9 +142,9 @@ function TimeSheetPage() { ) -} +}) -export default withAuthentication(TimeSheetPage, { displayName: 'TimeSheet' }); +export default withAuthentication(TimeSheet, { displayName: 'TimeSheet' }); const FooterTimeSheet: React.FC = ({ fullWidth }) => { return ( diff --git a/apps/web/app/helpers/date.ts b/apps/web/app/helpers/date.ts index 5bc4349fa..c038dceeb 100644 --- a/apps/web/app/helpers/date.ts +++ b/apps/web/app/helpers/date.ts @@ -198,3 +198,20 @@ export function formatTimeString(timeString: string): string { return result.length ? result : '0h 00m'; } + +export const getGreeting = () => { + const GREETING_TIMES = { + MORNING_START: 5, + AFTERNOON_START: 12, + EVENING_START: 18 + } as const + const currentHour = new Date().getHours(); + + if (currentHour >= GREETING_TIMES.MORNING_START && currentHour < GREETING_TIMES.AFTERNOON_START) { + return "Good morning"; + } else if (currentHour >= GREETING_TIMES.AFTERNOON_START && currentHour < GREETING_TIMES.EVENING_START) { + return "Good afternoon"; + } else { + return "Good evening"; + } +} diff --git a/apps/web/components/app-sidebar.tsx b/apps/web/components/app-sidebar.tsx index 8465d56c1..44536f9a5 100644 --- a/apps/web/components/app-sidebar.tsx +++ b/apps/web/components/app-sidebar.tsx @@ -69,60 +69,60 @@ export function AppSidebar({ publicTeam, ...props }: AppSidebarProps) { items: favoriteTasks && favoriteTasks.length > 0 ? favoriteTasks - .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase())) - .map((task, index) => ({ - title: task?.title, - url: '#', - component: ( - - - - {task && ( - // Show task issue and task number - - )} - - - #{task?.taskNumber} - - - {task?.title} - + .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase())) + .map((task, index) => ({ + title: task?.title, + url: '#', + component: ( + + + + {task && ( + // Show task issue and task number + + )} + + + #{task?.taskNumber} + + + {task?.title} - - toggleFavorite(task)} - /> - - - ) - })) + + + toggleFavorite(task)} + /> + + + ) + })) : [ - { - title: t('common.NO_FAVORITE_TASK'), - url: '#', - label: 'no-task' - } - ] + { + title: t('common.NO_FAVORITE_TASK'), + url: '#', + label: 'no-task' + } + ] }, { title: t('sidebar.TASKS'), @@ -142,73 +142,73 @@ export function AppSidebar({ publicTeam, ...props }: AppSidebarProps) { }, ...(userManagedTeams && userManagedTeams.length > 0 ? [ - { - title: t('sidebar.PROJECTS'), - label: 'projects', - url: '#', - icon: FolderKanban, - items: [ - ...userManagedTeams - .sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())) - .map((team, index) => ({ - title: team.name, - url: '#', - component: ( - - - - ) - })), - { - title: t('common.NO_PROJECT'), + { + title: t('sidebar.PROJECTS'), + label: 'projects', + url: '#', + icon: FolderKanban, + items: [ + ...userManagedTeams + .sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase())) + .map((team, index) => ({ + title: team.name, url: '#', component: ( - - + + + + + ) - } - ] - } - ] + })), + { + title: t('common.NO_PROJECT'), + url: '#', + component: ( + + + + ) + } + ] + } + ] : []), { title: t('sidebar.MY_WORKS'), @@ -227,42 +227,42 @@ export function AppSidebar({ publicTeam, ...props }: AppSidebarProps) { }, ...(isTeamManager ? [ - { - title: t('sidebar.REPORTS'), - url: '#', - icon: SquareActivity, - items: [ - { - title: t('sidebar.TIMESHEETS'), - url: '#' - }, - { - title: t('sidebar.MANUAL_TIME_EDIT'), - url: '#' - }, - { - title: t('sidebar.WEEKLY_LIMIT'), - url: '#' - }, - { - title: t('sidebar.ACTUAL_AND_EXPECTED_HOURS'), - url: '#' - }, - { - title: t('sidebar.PAYMENTS_DUE'), - url: '#' - }, - { - title: t('sidebar.PROJECT_BUDGET'), - url: '#' - }, - { - title: t('sidebar.TIME_AND_ACTIVITY'), - url: '#' - } - ] - } - ] + { + title: t('sidebar.REPORTS'), + url: '#', + icon: SquareActivity, + items: [ + { + title: t('sidebar.TIMESHEETS'), + url: `/timesheet/${user?.id}?name=${username || ''}` + }, + { + title: t('sidebar.MANUAL_TIME_EDIT'), + url: '#' + }, + { + title: t('sidebar.WEEKLY_LIMIT'), + url: '#' + }, + { + title: t('sidebar.ACTUAL_AND_EXPECTED_HOURS'), + url: '#' + }, + { + title: t('sidebar.PAYMENTS_DUE'), + url: '#' + }, + { + title: t('sidebar.PROJECT_BUDGET'), + url: '#' + }, + { + title: t('sidebar.TIME_AND_ACTIVITY'), + url: '#' + } + ] + } + ] : []) ] }; diff --git a/apps/web/components/ui/data-table.tsx b/apps/web/components/ui/data-table.tsx index 8a9ceaf8e..09c74e340 100644 --- a/apps/web/components/ui/data-table.tsx +++ b/apps/web/components/ui/data-table.tsx @@ -86,9 +86,9 @@ function DataTable({ columns, data, footerRows, isHeader }: DataT {header.isPlaceholder ? null : flexRender( - header.column.columnDef.header, - header.getContext() - )} + header.column.columnDef.header, + header.getContext() + )} diff --git a/apps/web/lib/components/custom-select/multi-select.tsx b/apps/web/lib/components/custom-select/multi-select.tsx index a88cb2e65..3b8a298b4 100644 --- a/apps/web/lib/components/custom-select/multi-select.tsx +++ b/apps/web/lib/components/custom-select/multi-select.tsx @@ -1,8 +1,10 @@ +import { clsxm } from '@/app/utils'; import { Button } from '@components/ui/button'; import { Popover, PopoverContent, PopoverTrigger } from '@components/ui/popover'; import { cn } from 'lib/utils'; import { useEffect, useState, useRef } from 'react'; import { MdOutlineKeyboardArrowDown, MdClose } from 'react-icons/md'; +import { statusColor } from '..'; interface MultiSelectProps { items: T[]; @@ -134,7 +136,11 @@ export function MultiSelect({ {selectedItems.map((item) => (
{itemToString(item)} - - - -
+
+ + Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount()} + + + + +
- + + ) } @@ -334,8 +335,6 @@ export function SelectFilter({ selectedStatus }: { selectedStatus?: string }) { default: return "text-gray-500 border-gray-200"; } - - }; @@ -409,11 +408,11 @@ const TaskActionMenu = ({ idTasks }: { idTasks: any }) => { const TaskDetails = ({ description, name }: { description: string; name: string }) => { return ( -
-
- ever +
+
+ ever
- + {name}
{description}
@@ -423,22 +422,43 @@ const TaskDetails = ({ description, name }: { description: string; name: string export const StatusTask = () => { return ( - - - Status - - - - {statusOptions?.map((status, index) => ( - + <> + + + Change status + + + + {statusOptions?.map((status, index) => ( + +
+
+ {status.label} +
+
+ ))} +
+
+
+ + + Billable + + + +
-
- {status.label} + Oui
- ))} -
-
-
+ +
+ No +
+
+
+
+
+ ) } diff --git a/apps/web/lib/features/integrations/calendar/time-sheet-filter-popover.tsx b/apps/web/lib/features/integrations/calendar/time-sheet-filter-popover.tsx index d441894e2..40a1eb39f 100644 --- a/apps/web/lib/features/integrations/calendar/time-sheet-filter-popover.tsx +++ b/apps/web/lib/features/integrations/calendar/time-sheet-filter-popover.tsx @@ -1,5 +1,5 @@ import { useOrganizationTeams, useTeamTasks } from "@app/hooks"; -import { Button } from "@components/ui/button" +import { Button } from "@components/ui/button"; import { Modal } from "lib/components"; import { statusOptions } from "@app/constants"; import { MultiSelect } from "lib/components/custom-select/multi-select"; diff --git a/apps/web/lib/features/user-profile-plans.tsx b/apps/web/lib/features/user-profile-plans.tsx index 0ec07b9c9..203d5808e 100644 --- a/apps/web/lib/features/user-profile-plans.tsx +++ b/apps/web/lib/features/user-profile-plans.tsx @@ -444,9 +444,8 @@ export function PlanHeader({ plan, planMode }: { plan: IDailyPlan; planMode: Fil return (
{/* Planned Time */}