@open-mercato/core 0.7.1-develop.7178.1.ab93fbaf4e → 0.7.1-develop.7180.1.9717fbbb43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/dist/generated/entities/staff_time_entry/index.js +14 -0
- package/dist/generated/entities/staff_time_entry/index.js.map +2 -2
- package/dist/generated/entities/staff_time_entry_tag/index.js +15 -0
- package/dist/generated/entities/staff_time_entry_tag/index.js.map +7 -0
- package/dist/generated/entities/staff_time_project/index.js +16 -0
- package/dist/generated/entities/staff_time_project/index.js.map +2 -2
- package/dist/generated/entities/staff_time_report/index.js +57 -0
- package/dist/generated/entities/staff_time_report/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_entry/index.js +27 -0
- package/dist/generated/entities/staff_time_report_entry/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_event/index.js +21 -0
- package/dist/generated/entities/staff_time_report_event/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_project/index.js +15 -0
- package/dist/generated/entities/staff_time_report_project/index.js.map +7 -0
- package/dist/generated/entities/staff_time_tag/index.js +21 -0
- package/dist/generated/entities/staff_time_tag/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task/index.js +37 -0
- package/dist/generated/entities/staff_time_task/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_comment/index.js +21 -0
- package/dist/generated/entities/staff_time_task_comment/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_status/index.js +29 -0
- package/dist/generated/entities/staff_time_task_status/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_tag/index.js +15 -0
- package/dist/generated/entities/staff_time_task_tag/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +11 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +149 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/timesheetFixtures.js +7 -0
- package/dist/helpers/integration/timesheetFixtures.js.map +2 -2
- package/dist/modules/auth/cli.js +16 -0
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/lib/backendChrome.js +1 -0
- package/dist/modules/auth/lib/backendChrome.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerRoleAcls.js +44 -0
- package/dist/modules/customer_accounts/lib/customerRoleAcls.js.map +7 -0
- package/dist/modules/customer_accounts/setup.js +1 -28
- package/dist/modules/customer_accounts/setup.js.map +2 -2
- package/dist/modules/data_sync/api/options.js +2 -0
- package/dist/modules/data_sync/api/options.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +39 -17
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/lib/start-controls.js +42 -0
- package/dist/modules/data_sync/lib/start-controls.js.map +7 -0
- package/dist/modules/staff/acl.js +9 -1
- package/dist/modules/staff/acl.js.map +2 -2
- package/dist/modules/staff/ai-agents.js +142 -0
- package/dist/modules/staff/ai-agents.js.map +7 -0
- package/dist/modules/staff/ai-tools/time-tracking-pack.js +348 -0
- package/dist/modules/staff/ai-tools/time-tracking-pack.js.map +7 -0
- package/dist/modules/staff/ai-tools/types.js +54 -0
- package/dist/modules/staff/ai-tools/types.js.map +7 -0
- package/dist/modules/staff/ai-tools.js +8 -0
- package/dist/modules/staff/ai-tools.js.map +7 -0
- package/dist/modules/staff/analytics.js +84 -1
- package/dist/modules/staff/analytics.js.map +2 -2
- package/dist/modules/staff/api/guards.js +37 -3
- package/dist/modules/staff/api/guards.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/accept/route.js +1 -3
- package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/reject/route.js +1 -3
- package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
- package/dist/modules/staff/api/portal/time-reports/[id]/route.js +131 -0
- package/dist/modules/staff/api/portal/time-reports/[id]/route.js.map +7 -0
- package/dist/modules/staff/api/portal/time-reports/route.js +179 -0
- package/dist/modules/staff/api/portal/time-reports/route.js.map +7 -0
- package/dist/modules/staff/api/team-members/self/route.js +1 -3
- package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/assign/route.js +1 -3
- package/dist/modules/staff/api/team-members/tags/assign/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/unassign/route.js +1 -3
- package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js +174 -0
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js.map +7 -0
- package/dist/modules/staff/api/timesheets/access-requests/route.js +226 -0
- package/dist/modules/staff/api/timesheets/access-requests/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js +15 -8
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/route.js +13 -1
- package/dist/modules/staff/api/timesheets/my-projects/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-work/myWorkAggregate.js +42 -0
- package/dist/modules/staff/api/timesheets/my-work/myWorkAggregate.js.map +7 -0
- package/dist/modules/staff/api/timesheets/my-work/route.js +383 -0
- package/dist/modules/staff/api/timesheets/my-work/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js +14 -2
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js +168 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js +246 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js +183 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js +164 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/preview/route.js +360 -0
- package/dist/modules/staff/api/timesheets/reports/preview/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/route.js +316 -0
- package/dist/modules/staff/api/timesheets/reports/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/shared.js +63 -0
- package/dist/modules/staff/api/timesheets/reports/shared.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js +164 -0
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/rounding-impact/route.js +168 -0
- package/dist/modules/staff/api/timesheets/settings/rounding-impact/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/route.js +199 -0
- package/dist/modules/staff/api/timesheets/settings/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/access.js +76 -0
- package/dist/modules/staff/api/timesheets/tags/access.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js +235 -0
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/route.js +160 -0
- package/dist/modules/staff/api/timesheets/tags/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js +233 -0
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/task-statuses/route.js +188 -0
- package/dist/modules/staff/api/timesheets/task-statuses/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js +399 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js +210 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/route.js +333 -0
- package/dist/modules/staff/api/timesheets/tasks/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js +228 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js +29 -10
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js +31 -18
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js +21 -7
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js +27 -7
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js +215 -32
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js +378 -0
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js +340 -0
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/route.js +238 -26
- package/dist/modules/staff/api/timesheets/time-entries/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js +23 -8
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js +209 -0
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-projects/[id]/employees/route.js +59 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/employees/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/route.js +264 -22
- package/dist/modules/staff/api/timesheets/time-projects/route.js.map +2 -2
- package/dist/modules/staff/backend/staff/time-tracking/board/page.js +110 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.js +981 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.js +583 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.meta.js +15 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.js +65 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.js +229 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.js +1014 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.js +97 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.js +1040 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.meta.js +19 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.js +353 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.js +457 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.js +697 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.js +174 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.js +546 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/GridView.js +710 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/GridView.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.js +646 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/page.js +4 -793
- package/dist/modules/staff/backend/staff/timesheets/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/page.meta.js +2 -7
- package/dist/modules/staff/backend/staff/timesheets/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.js +5 -136
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js +5 -445
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js.map +3 -3
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.js +4 -76
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js +4 -613
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.meta.js +2 -17
- package/dist/modules/staff/backend/staff/timesheets/projects/page.meta.js.map +2 -2
- package/dist/modules/staff/ce.js +40 -0
- package/dist/modules/staff/ce.js.map +2 -2
- package/dist/modules/staff/cli.js +166 -1
- package/dist/modules/staff/cli.js.map +2 -2
- package/dist/modules/staff/commands/index.js +5 -0
- package/dist/modules/staff/commands/index.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-entries.js +569 -21
- package/dist/modules/staff/commands/timesheets-entries.js.map +3 -3
- package/dist/modules/staff/commands/timesheets-projects.js +450 -7
- package/dist/modules/staff/commands/timesheets-projects.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-reports.js +1036 -0
- package/dist/modules/staff/commands/timesheets-reports.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-tags.js +1015 -0
- package/dist/modules/staff/commands/timesheets-tags.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-task-comments.js +438 -0
- package/dist/modules/staff/commands/timesheets-task-comments.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-task-statuses.js +723 -0
- package/dist/modules/staff/commands/timesheets-task-statuses.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-tasks.js +834 -0
- package/dist/modules/staff/commands/timesheets-tasks.js.map +7 -0
- package/dist/modules/staff/data/enrichers.js +426 -12
- package/dist/modules/staff/data/enrichers.js.map +2 -2
- package/dist/modules/staff/data/entities.js +552 -3
- package/dist/modules/staff/data/entities.js.map +2 -2
- package/dist/modules/staff/data/extensions.js +41 -0
- package/dist/modules/staff/data/extensions.js.map +7 -0
- package/dist/modules/staff/data/validators.js +254 -9
- package/dist/modules/staff/data/validators.js.map +2 -2
- package/dist/modules/staff/di.js +42 -1
- package/dist/modules/staff/di.js.map +2 -2
- package/dist/modules/staff/events.js +84 -6
- package/dist/modules/staff/events.js.map +2 -2
- package/dist/modules/staff/events.payloads.js +158 -0
- package/dist/modules/staff/events.payloads.js.map +7 -0
- package/dist/modules/staff/extension-points.js +261 -0
- package/dist/modules/staff/extension-points.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.js +138 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.js +12 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.js +133 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.js +19 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.js.map +7 -0
- package/dist/modules/staff/lib/crud.js +11 -1
- package/dist/modules/staff/lib/crud.js.map +2 -2
- package/dist/modules/staff/lib/time-tracking/access.js +92 -0
- package/dist/modules/staff/lib/time-tracking/access.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/billability.js +39 -0
- package/dist/modules/staff/lib/time-tracking/billability.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/capacity.js +68 -0
- package/dist/modules/staff/lib/time-tracking/capacity.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/componentContracts.js +15 -0
- package/dist/modules/staff/lib/time-tracking/componentContracts.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/cost.js +82 -0
- package/dist/modules/staff/lib/time-tracking/cost.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/duration.js +55 -0
- package/dist/modules/staff/lib/time-tracking/duration.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/featureAccess.js +41 -0
- package/dist/modules/staff/lib/time-tracking/featureAccess.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/interval.js +72 -0
- package/dist/modules/staff/lib/time-tracking/interval.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/migrateProjectCodes.js +88 -0
- package/dist/modules/staff/lib/time-tracking/migrateProjectCodes.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/moneyVisibility.js +10 -0
- package/dist/modules/staff/lib/time-tracking/moneyVisibility.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/overlap.js +87 -0
- package/dist/modules/staff/lib/time-tracking/overlap.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/portalRecipients.js +27 -0
- package/dist/modules/staff/lib/time-tracking/portalRecipients.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/portalReports.js +16 -0
- package/dist/modules/staff/lib/time-tracking/portalReports.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/projectCode.js +135 -0
- package/dist/modules/staff/lib/time-tracking/projectCode.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/reapplyRounding.js +187 -0
- package/dist/modules/staff/lib/time-tracking/reapplyRounding.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/recalculationRunner.js +80 -0
- package/dist/modules/staff/lib/time-tracking/recalculationRunner.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/recalculations.js +56 -0
- package/dist/modules/staff/lib/time-tracking/recalculations.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/invoke.js +63 -0
- package/dist/modules/staff/lib/time-tracking/registries/invoke.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/registry.js +62 -0
- package/dist/modules/staff/lib/time-tracking/registries/registry.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/scope.js +21 -0
- package/dist/modules/staff/lib/time-tracking/registries/scope.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/rollup.js +34 -0
- package/dist/modules/staff/lib/time-tracking/rollup.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/rounding.js +66 -0
- package/dist/modules/staff/lib/time-tracking/rounding.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/roundingImpact.js +39 -0
- package/dist/modules/staff/lib/time-tracking/roundingImpact.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/settingKeys.js +214 -0
- package/dist/modules/staff/lib/time-tracking/settingKeys.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/settings.js +87 -0
- package/dist/modules/staff/lib/time-tracking/settings.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/sqlInClause.js +9 -0
- package/dist/modules/staff/lib/time-tracking/sqlInClause.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/timeEntrySources.js +48 -0
- package/dist/modules/staff/lib/time-tracking/timeEntrySources.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/BoardFilterChips.js +283 -0
- package/dist/modules/staff/lib/time-tracking-ui/BoardFilterChips.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/CustomerPicker.js +324 -0
- package/dist/modules/staff/lib/time-tracking-ui/CustomerPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/DurationInput.js +121 -0
- package/dist/modules/staff/lib/time-tracking-ui/DurationInput.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryDetailsFields.js +188 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryDetailsFields.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryFilterBar.js +89 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryFilterBar.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanBoard.js +855 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanBoard.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanCard.js +360 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanCard.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanColumn.js +259 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanColumn.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/NewTaskDialog.js +238 -0
- package/dist/modules/staff/lib/time-tracking-ui/NewTaskDialog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/NoProjectAccess.js +130 -0
- package/dist/modules/staff/lib/time-tracking-ui/NoProjectAccess.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/PeriodSelector.js +98 -0
- package/dist/modules/staff/lib/time-tracking-ui/PeriodSelector.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/PhasePlaceholder.js +27 -0
- package/dist/modules/staff/lib/time-tracking-ui/PhasePlaceholder.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCodeField.js +166 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCodeField.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.js +295 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectFormSections.js +212 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectFormSections.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.js +729 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ReportSheet.js +217 -0
- package/dist/modules/staff/lib/time-tracking-ui/ReportSheet.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TagPicker.js +158 -0
- package/dist/modules/staff/lib/time-tracking-ui/TagPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskBoardScreen.js +224 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskBoardScreen.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskCommentThread.js +93 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskCommentThread.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskDrawer.js +1196 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskDrawer.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskListView.js +176 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskListView.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskPicker.js +307 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskQuickLog.js +284 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskQuickLog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.js +73 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDialog.js +1499 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDialog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.js +95 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetCalendar.js +188 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetCalendar.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.js +61 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.js +45 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardDirectory.js +176 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardDirectory.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardFilters.js +82 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardFilters.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardSummary.js +5 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardSummary.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/kanbanBoardData.js +152 -0
- package/dist/modules/staff/lib/time-tracking-ui/kanbanBoardData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/projectTeamAssignment.js +92 -0
- package/dist/modules/staff/lib/time-tracking-ui/projectTeamAssignment.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/taskDrawerData.js +111 -0
- package/dist/modules/staff/lib/time-tracking-ui/taskDrawerData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryDialogState.js +243 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryDialogState.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryListData.js +151 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryListData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.js +105 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetData.js +132 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetPeriod.js +205 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetPeriod.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetTargets.js +53 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetTargets.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/useBoardFilters.js +77 -0
- package/dist/modules/staff/lib/time-tracking-ui/useBoardFilters.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.js +151 -0
- package/dist/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.js.map +7 -0
- package/dist/modules/staff/lib/timeTrackingSeeds.js +809 -0
- package/dist/modules/staff/lib/timeTrackingSeeds.js.map +7 -0
- package/dist/modules/staff/lib/timesheets/timeEntryCacheInvalidation.js +2 -3
- package/dist/modules/staff/lib/timesheets/timeEntryCacheInvalidation.js.map +2 -2
- package/dist/modules/staff/lib/timesheets/timeEntryDecoration.js +152 -0
- package/dist/modules/staff/lib/timesheets/timeEntryDecoration.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetBurn.js +36 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetBurn.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThreshold.js +66 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThreshold.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThresholdState.js +78 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThresholdState.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectFinancials.js +81 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectFinancials.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/reportSelection.js +44 -0
- package/dist/modules/staff/lib/timesheets-projects/reportSelection.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.js +169 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.js +22 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectCard.js +51 -1
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectCard.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.js +70 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js +63 -0
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js +170 -0
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/pdf.js +205 -0
- package/dist/modules/staff/lib/timesheets-reports/pdf.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportApprovalPolicies.js +68 -0
- package/dist/modules/staff/lib/timesheets-reports/reportApprovalPolicies.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigData.js +135 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigState.js +48 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigState.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExport.js +262 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExport.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExportFormats.js +34 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExportFormats.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportGroupings.js +79 -0
- package/dist/modules/staff/lib/timesheets-reports/reportGroupings.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportLabels.js +11 -0
- package/dist/modules/staff/lib/timesheets-reports/reportLabels.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportReference.js +83 -0
- package/dist/modules/staff/lib/timesheets-reports/reportReference.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportRows.js +42 -0
- package/dist/modules/staff/lib/timesheets-reports/reportRows.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportSheetData.js +107 -0
- package/dist/modules/staff/lib/timesheets-reports/reportSheetData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportTotals.js +289 -0
- package/dist/modules/staff/lib/timesheets-reports/reportTotals.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/xlsx.js +145 -0
- package/dist/modules/staff/lib/timesheets-reports/xlsx.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/computeTaskRollups.js +116 -0
- package/dist/modules/staff/lib/timesheets-tasks/computeTaskRollups.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.js +50 -0
- package/dist/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/seedProjectStatuses.js +27 -0
- package/dist/modules/staff/lib/timesheets-tasks/seedProjectStatuses.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusPositions.js +65 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusPositions.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusSlug.js +31 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusSlug.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHierarchy.js +31 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHierarchy.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHoursTotals.js +17 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHoursTotals.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskReference.js +51 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskReference.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/CreateProjectDialog.js +11 -4
- package/dist/modules/staff/lib/timesheets-ui/CreateProjectDialog.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-ui/ListView.js +369 -111
- package/dist/modules/staff/lib/timesheets-ui/ListView.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-ui/TimerBar.js +47 -2
- package/dist/modules/staff/lib/timesheets-ui/TimerBar.js.map +2 -2
- package/dist/modules/staff/migrations/Migration20260813073131_staff.js +79 -0
- package/dist/modules/staff/migrations/Migration20260813073131_staff.js.map +7 -0
- package/dist/modules/staff/migrations/Migration20260824143357_staff.js +15 -0
- package/dist/modules/staff/migrations/Migration20260824143357_staff.js.map +7 -0
- package/dist/modules/staff/notifications.client.js +16 -0
- package/dist/modules/staff/notifications.client.js.map +7 -0
- package/dist/modules/staff/notifications.handlers.js +80 -0
- package/dist/modules/staff/notifications.handlers.js.map +7 -0
- package/dist/modules/staff/notifications.js +168 -0
- package/dist/modules/staff/notifications.js.map +2 -2
- package/dist/modules/staff/search.js +159 -1
- package/dist/modules/staff/search.js.map +2 -2
- package/dist/modules/staff/setup.js +20 -1
- package/dist/modules/staff/setup.js.map +2 -2
- package/dist/modules/staff/subscribers/time-project-access-requested-notification.js +68 -0
- package/dist/modules/staff/subscribers/time-project-access-requested-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-project-budget-threshold-notification.js +149 -0
- package/dist/modules/staff/subscribers/time-project-budget-threshold-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-report-approved-notification.js +78 -0
- package/dist/modules/staff/subscribers/time-report-approved-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-report-portal-broadcast.js +78 -0
- package/dist/modules/staff/subscribers/time-report-portal-broadcast.js.map +7 -0
- package/dist/modules/staff/translations.js +4 -1
- package/dist/modules/staff/translations.js.map +2 -2
- package/dist/modules/staff/widgets/components.js +7 -0
- package/dist/modules/staff/widgets/components.js.map +7 -0
- package/dist/modules/staff/widgets/injection/timer-sidebar-indicator/widget.js +5 -4
- package/dist/modules/staff/widgets/injection/timer-sidebar-indicator/widget.js.map +2 -2
- package/dist/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.js +135 -0
- package/dist/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.js.map +7 -0
- package/dist/modules/staff/widgets/notifications/index.js +5 -0
- package/dist/modules/staff/widgets/notifications/index.js.map +7 -0
- package/dist/modules/staff/workers/timesheets-reapply-rounding.js +43 -0
- package/dist/modules/staff/workers/timesheets-reapply-rounding.js.map +7 -0
- package/generated/entities/staff_time_entry/index.ts +7 -0
- package/generated/entities/staff_time_entry_tag/index.ts +6 -0
- package/generated/entities/staff_time_project/index.ts +8 -0
- package/generated/entities/staff_time_report/index.ts +27 -0
- package/generated/entities/staff_time_report_entry/index.ts +12 -0
- package/generated/entities/staff_time_report_event/index.ts +9 -0
- package/generated/entities/staff_time_report_project/index.ts +6 -0
- package/generated/entities/staff_time_tag/index.ts +9 -0
- package/generated/entities/staff_time_task/index.ts +17 -0
- package/generated/entities/staff_time_task_comment/index.ts +9 -0
- package/generated/entities/staff_time_task_status/index.ts +13 -0
- package/generated/entities/staff_time_task_tag/index.ts +6 -0
- package/generated/entities.ids.generated.ts +11 -1
- package/generated/entity-fields-registry.ts +149 -0
- package/package.json +7 -7
- package/src/helpers/integration/timesheetFixtures.ts +31 -1
- package/src/modules/auth/README.md +1 -1
- package/src/modules/auth/cli.ts +35 -1
- package/src/modules/auth/i18n/de.json +7 -0
- package/src/modules/auth/i18n/en.json +7 -0
- package/src/modules/auth/i18n/es.json +7 -0
- package/src/modules/auth/i18n/ko.json +7 -0
- package/src/modules/auth/i18n/pl.json +7 -0
- package/src/modules/auth/lib/backendChrome.tsx +1 -0
- package/src/modules/customer_accounts/lib/customerRoleAcls.ts +79 -0
- package/src/modules/customer_accounts/setup.ts +1 -45
- package/src/modules/data_sync/AGENTS.md +34 -0
- package/src/modules/data_sync/api/options.ts +2 -0
- package/src/modules/data_sync/backend/data-sync/page.tsx +82 -33
- package/src/modules/data_sync/i18n/de.json +1 -0
- package/src/modules/data_sync/i18n/en.json +1 -0
- package/src/modules/data_sync/i18n/es.json +1 -0
- package/src/modules/data_sync/i18n/ko.json +1 -0
- package/src/modules/data_sync/i18n/pl.json +1 -0
- package/src/modules/data_sync/lib/adapter.ts +45 -0
- package/src/modules/data_sync/lib/start-controls.ts +89 -0
- package/src/modules/staff/AGENTS.md +769 -1
- package/src/modules/staff/acl.ts +9 -0
- package/src/modules/staff/ai-agents.ts +189 -0
- package/src/modules/staff/ai-tools/time-tracking-pack.ts +494 -0
- package/src/modules/staff/ai-tools/types.ts +82 -0
- package/src/modules/staff/ai-tools.ts +13 -0
- package/src/modules/staff/analytics.ts +113 -0
- package/src/modules/staff/api/guards.ts +85 -3
- package/src/modules/staff/api/leave-requests/accept/route.ts +0 -2
- package/src/modules/staff/api/leave-requests/reject/route.ts +0 -2
- package/src/modules/staff/api/portal/time-reports/[id]/route.ts +182 -0
- package/src/modules/staff/api/portal/time-reports/route.ts +270 -0
- package/src/modules/staff/api/team-members/self/route.ts +0 -2
- package/src/modules/staff/api/team-members/tags/assign/route.ts +0 -2
- package/src/modules/staff/api/team-members/tags/unassign/route.ts +0 -2
- package/src/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.ts +292 -0
- package/src/modules/staff/api/timesheets/access-requests/route.ts +299 -0
- package/src/modules/staff/api/timesheets/my-projects/[projectId]/route.ts +15 -7
- package/src/modules/staff/api/timesheets/my-projects/route.ts +14 -1
- package/src/modules/staff/api/timesheets/my-work/myWorkAggregate.ts +90 -0
- package/src/modules/staff/api/timesheets/my-work/route.ts +475 -0
- package/src/modules/staff/api/timesheets/projects/kpis/route.ts +15 -2
- package/src/modules/staff/api/timesheets/reports/[id]/close/route.ts +203 -0
- package/src/modules/staff/api/timesheets/reports/[id]/export/route.ts +315 -0
- package/src/modules/staff/api/timesheets/reports/[id]/sheet/route.ts +220 -0
- package/src/modules/staff/api/timesheets/reports/[id]/unlock/route.ts +208 -0
- package/src/modules/staff/api/timesheets/reports/preview/route.ts +449 -0
- package/src/modules/staff/api/timesheets/reports/route.ts +386 -0
- package/src/modules/staff/api/timesheets/reports/shared.ts +121 -0
- package/src/modules/staff/api/timesheets/settings/reapply-rounding/route.ts +205 -0
- package/src/modules/staff/api/timesheets/settings/rounding-impact/route.ts +226 -0
- package/src/modules/staff/api/timesheets/settings/route.ts +242 -0
- package/src/modules/staff/api/timesheets/tags/access.ts +134 -0
- package/src/modules/staff/api/timesheets/tags/entry-assignments/route.ts +290 -0
- package/src/modules/staff/api/timesheets/tags/route.ts +177 -0
- package/src/modules/staff/api/timesheets/tags/task-assignments/route.ts +294 -0
- package/src/modules/staff/api/timesheets/task-statuses/route.ts +232 -0
- package/src/modules/staff/api/timesheets/tasks/[id]/comments/route.ts +532 -0
- package/src/modules/staff/api/timesheets/tasks/[id]/status/route.ts +271 -0
- package/src/modules/staff/api/timesheets/tasks/route.ts +443 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.ts +306 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.ts +32 -10
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/route.ts +32 -17
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.ts +27 -6
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.ts +36 -6
- package/src/modules/staff/api/timesheets/time-entries/bulk/route.ts +331 -34
- package/src/modules/staff/api/timesheets/time-entries/copy-day/route.ts +533 -0
- package/src/modules/staff/api/timesheets/time-entries/overlaps/route.ts +457 -0
- package/src/modules/staff/api/timesheets/time-entries/route.ts +378 -24
- package/src/modules/staff/api/timesheets/time-entries/start-timer/route.ts +31 -9
- package/src/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.ts +246 -0
- package/src/modules/staff/api/timesheets/time-projects/[id]/employees/route.ts +62 -2
- package/src/modules/staff/api/timesheets/time-projects/route.ts +397 -22
- package/src/modules/staff/backend/staff/time-tracking/board/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/board/page.tsx +151 -0
- package/src/modules/staff/backend/staff/time-tracking/entries/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/entries/page.tsx +1229 -0
- package/src/modules/staff/backend/staff/time-tracking/page.meta.ts +11 -0
- package/src/modules/staff/backend/staff/time-tracking/page.tsx +823 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.tsx +81 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.tsx +275 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/page.tsx +1420 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/create/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/create/page.tsx +109 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/page.meta.ts +15 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/page.tsx +1254 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.ts +466 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/[id]/page.tsx +632 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/create/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/create/page.tsx +867 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/page.tsx +246 -0
- package/src/modules/staff/backend/staff/time-tracking/settings/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/settings/page.tsx +701 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/GridView.tsx +953 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/page.tsx +800 -0
- package/src/modules/staff/backend/staff/timesheets/page.meta.ts +6 -6
- package/src/modules/staff/backend/staff/timesheets/page.tsx +12 -1010
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.tsx +4 -158
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.tsx +4 -609
- package/src/modules/staff/backend/staff/timesheets/projects/create/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/create/page.tsx +3 -89
- package/src/modules/staff/backend/staff/timesheets/projects/page.meta.ts +2 -19
- package/src/modules/staff/backend/staff/timesheets/projects/page.tsx +3 -778
- package/src/modules/staff/ce.ts +63 -0
- package/src/modules/staff/cli.ts +207 -1
- package/src/modules/staff/commands/index.ts +5 -0
- package/src/modules/staff/commands/timesheets-entries.ts +1006 -28
- package/src/modules/staff/commands/timesheets-projects.ts +593 -7
- package/src/modules/staff/commands/timesheets-reports.ts +1329 -0
- package/src/modules/staff/commands/timesheets-tags.ts +1315 -0
- package/src/modules/staff/commands/timesheets-task-comments.ts +583 -0
- package/src/modules/staff/commands/timesheets-task-statuses.ts +889 -0
- package/src/modules/staff/commands/timesheets-tasks.ts +1121 -0
- package/src/modules/staff/data/enrichers.ts +675 -10
- package/src/modules/staff/data/entities.ts +494 -2
- package/src/modules/staff/data/extensions.ts +68 -0
- package/src/modules/staff/data/validators.ts +348 -3
- package/src/modules/staff/di.ts +96 -0
- package/src/modules/staff/events.payloads.ts +268 -0
- package/src/modules/staff/events.ts +87 -5
- package/src/modules/staff/extension-points.ts +308 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.ts +10 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.tsx +225 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.ts +17 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/page.tsx +182 -0
- package/src/modules/staff/i18n/de.json +899 -0
- package/src/modules/staff/i18n/en.json +899 -0
- package/src/modules/staff/i18n/es.json +899 -0
- package/src/modules/staff/i18n/ko.json +899 -0
- package/src/modules/staff/i18n/pl.json +899 -0
- package/src/modules/staff/lib/crud.ts +14 -3
- package/src/modules/staff/lib/time-tracking/access.ts +155 -0
- package/src/modules/staff/lib/time-tracking/billability.ts +68 -0
- package/src/modules/staff/lib/time-tracking/capacity.ts +124 -0
- package/src/modules/staff/lib/time-tracking/componentContracts.ts +26 -0
- package/src/modules/staff/lib/time-tracking/cost.ts +144 -0
- package/src/modules/staff/lib/time-tracking/duration.ts +68 -0
- package/src/modules/staff/lib/time-tracking/featureAccess.ts +115 -0
- package/src/modules/staff/lib/time-tracking/interval.ts +90 -0
- package/src/modules/staff/lib/time-tracking/migrateProjectCodes.ts +161 -0
- package/src/modules/staff/lib/time-tracking/moneyVisibility.ts +37 -0
- package/src/modules/staff/lib/time-tracking/overlap.ts +159 -0
- package/src/modules/staff/lib/time-tracking/portalRecipients.ts +76 -0
- package/src/modules/staff/lib/time-tracking/portalReports.ts +31 -0
- package/src/modules/staff/lib/time-tracking/projectCode.ts +221 -0
- package/src/modules/staff/lib/time-tracking/reapplyRounding.ts +313 -0
- package/src/modules/staff/lib/time-tracking/recalculationRunner.ts +118 -0
- package/src/modules/staff/lib/time-tracking/recalculations.ts +135 -0
- package/src/modules/staff/lib/time-tracking/registries/invoke.ts +122 -0
- package/src/modules/staff/lib/time-tracking/registries/registry.ts +124 -0
- package/src/modules/staff/lib/time-tracking/registries/scope.ts +56 -0
- package/src/modules/staff/lib/time-tracking/rollup.ts +59 -0
- package/src/modules/staff/lib/time-tracking/rounding.ts +126 -0
- package/src/modules/staff/lib/time-tracking/roundingImpact.ts +75 -0
- package/src/modules/staff/lib/time-tracking/settingKeys.ts +274 -0
- package/src/modules/staff/lib/time-tracking/settings.ts +168 -0
- package/src/modules/staff/lib/time-tracking/sqlInClause.ts +22 -0
- package/src/modules/staff/lib/time-tracking/timeEntrySources.ts +85 -0
- package/src/modules/staff/lib/time-tracking-ui/BoardFilterChips.tsx +360 -0
- package/src/modules/staff/lib/time-tracking-ui/CustomerPicker.tsx +427 -0
- package/src/modules/staff/lib/time-tracking-ui/DurationInput.tsx +192 -0
- package/src/modules/staff/lib/time-tracking-ui/EntryDetailsFields.tsx +224 -0
- package/src/modules/staff/lib/time-tracking-ui/EntryFilterBar.tsx +144 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanBoard.tsx +1065 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanCard.tsx +435 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanColumn.tsx +316 -0
- package/src/modules/staff/lib/time-tracking-ui/NewTaskDialog.tsx +291 -0
- package/src/modules/staff/lib/time-tracking-ui/NoProjectAccess.tsx +162 -0
- package/src/modules/staff/lib/time-tracking-ui/PeriodSelector.tsx +149 -0
- package/src/modules/staff/lib/time-tracking-ui/PhasePlaceholder.tsx +31 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectCodeField.tsx +230 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.tsx +432 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectFormSections.tsx +323 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.tsx +930 -0
- package/src/modules/staff/lib/time-tracking-ui/ReportSheet.tsx +357 -0
- package/src/modules/staff/lib/time-tracking-ui/TagPicker.tsx +195 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskBoardScreen.tsx +243 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskCommentThread.tsx +137 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskDrawer.tsx +1405 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskListView.tsx +260 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskPicker.tsx +435 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskQuickLog.tsx +296 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.tsx +97 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntryDialog.tsx +1929 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.tsx +126 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetCalendar.tsx +265 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.tsx +78 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.tsx +70 -0
- package/src/modules/staff/lib/time-tracking-ui/boardDirectory.ts +231 -0
- package/src/modules/staff/lib/time-tracking-ui/boardFilters.ts +128 -0
- package/src/modules/staff/lib/time-tracking-ui/boardSummary.ts +20 -0
- package/src/modules/staff/lib/time-tracking-ui/kanbanBoardData.ts +228 -0
- package/src/modules/staff/lib/time-tracking-ui/projectTeamAssignment.ts +143 -0
- package/src/modules/staff/lib/time-tracking-ui/taskDrawerData.ts +194 -0
- package/src/modules/staff/lib/time-tracking-ui/timeEntryDialogState.ts +400 -0
- package/src/modules/staff/lib/time-tracking-ui/timeEntryListData.ts +271 -0
- package/src/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.ts +168 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetData.ts +225 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetPeriod.ts +278 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetTargets.ts +93 -0
- package/src/modules/staff/lib/time-tracking-ui/useBoardFilters.ts +107 -0
- package/src/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.ts +245 -0
- package/src/modules/staff/lib/timeTrackingSeeds.ts +1037 -0
- package/src/modules/staff/lib/timesheets/timeEntryCacheInvalidation.ts +11 -10
- package/src/modules/staff/lib/timesheets/timeEntryDecoration.ts +256 -0
- package/src/modules/staff/lib/timesheets-projects/budgetBurn.ts +60 -0
- package/src/modules/staff/lib/timesheets-projects/budgetThreshold.ts +135 -0
- package/src/modules/staff/lib/timesheets-projects/budgetThresholdState.ts +137 -0
- package/src/modules/staff/lib/timesheets-projects/computeProjectFinancials.ts +142 -0
- package/src/modules/staff/lib/timesheets-projects/reportSelection.ts +82 -0
- package/src/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.tsx +237 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.tsx +33 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectCard.tsx +56 -1
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.tsx +90 -0
- package/src/modules/staff/lib/timesheets-reports/buildReportSheet.ts +125 -0
- package/src/modules/staff/lib/timesheets-reports/loadReportData.ts +251 -0
- package/src/modules/staff/lib/timesheets-reports/pdf.ts +263 -0
- package/src/modules/staff/lib/timesheets-reports/reportApprovalPolicies.ts +137 -0
- package/src/modules/staff/lib/timesheets-reports/reportConfigData.ts +247 -0
- package/src/modules/staff/lib/timesheets-reports/reportConfigState.ts +89 -0
- package/src/modules/staff/lib/timesheets-reports/reportExport.ts +373 -0
- package/src/modules/staff/lib/timesheets-reports/reportExportFormats.ts +71 -0
- package/src/modules/staff/lib/timesheets-reports/reportGroupings.ts +153 -0
- package/src/modules/staff/lib/timesheets-reports/reportLabels.ts +23 -0
- package/src/modules/staff/lib/timesheets-reports/reportReference.ts +146 -0
- package/src/modules/staff/lib/timesheets-reports/reportRows.ts +89 -0
- package/src/modules/staff/lib/timesheets-reports/reportSheetData.ts +196 -0
- package/src/modules/staff/lib/timesheets-reports/reportTotals.ts +544 -0
- package/src/modules/staff/lib/timesheets-reports/xlsx.ts +207 -0
- package/src/modules/staff/lib/timesheets-tasks/computeTaskRollups.ts +238 -0
- package/src/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.ts +90 -0
- package/src/modules/staff/lib/timesheets-tasks/seedProjectStatuses.ts +43 -0
- package/src/modules/staff/lib/timesheets-tasks/statusPositions.ts +132 -0
- package/src/modules/staff/lib/timesheets-tasks/statusSlug.ts +43 -0
- package/src/modules/staff/lib/timesheets-tasks/taskHierarchy.ts +99 -0
- package/src/modules/staff/lib/timesheets-tasks/taskHoursTotals.ts +42 -0
- package/src/modules/staff/lib/timesheets-tasks/taskReference.ts +108 -0
- package/src/modules/staff/lib/timesheets-ui/CreateProjectDialog.tsx +18 -4
- package/src/modules/staff/lib/timesheets-ui/ListView.tsx +504 -149
- package/src/modules/staff/lib/timesheets-ui/TimerBar.tsx +50 -2
- package/src/modules/staff/migrations/.snapshot-open-mercato.json +3244 -228
- package/src/modules/staff/migrations/Migration20260813073131_staff.ts +94 -0
- package/src/modules/staff/migrations/Migration20260824143357_staff.ts +17 -0
- package/src/modules/staff/notifications.client.ts +16 -0
- package/src/modules/staff/notifications.handlers.ts +88 -0
- package/src/modules/staff/notifications.ts +163 -0
- package/src/modules/staff/search.ts +191 -1
- package/src/modules/staff/setup.ts +22 -0
- package/src/modules/staff/subscribers/time-project-access-requested-notification.ts +95 -0
- package/src/modules/staff/subscribers/time-project-budget-threshold-notification.ts +226 -0
- package/src/modules/staff/subscribers/time-report-approved-notification.ts +116 -0
- package/src/modules/staff/subscribers/time-report-portal-broadcast.ts +120 -0
- package/src/modules/staff/translations.ts +17 -0
- package/src/modules/staff/widgets/components.ts +34 -0
- package/src/modules/staff/widgets/injection/timer-sidebar-indicator/widget.tsx +6 -5
- package/src/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.tsx +138 -0
- package/src/modules/staff/widgets/notifications/index.ts +1 -0
- package/src/modules/staff/workers/timesheets-reapply-rounding.ts +59 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/projectFormConfig.js +0 -123
- package/dist/modules/staff/backend/staff/timesheets/projects/projectFormConfig.js.map +0 -7
- package/src/modules/staff/backend/staff/timesheets/projects/projectFormConfig.ts +0 -138
|
@@ -1,797 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { Page, PageBody } from "@open-mercato/ui/backend/Page";
|
|
5
|
-
import { Button } from "@open-mercato/ui/primitives/button";
|
|
6
|
-
import { InlineInput } from "@open-mercato/ui/primitives/inline-input";
|
|
7
|
-
import { apiCall, apiCallOrThrow, readApiResultOrThrow } from "@open-mercato/ui/backend/utils/apiCall";
|
|
8
|
-
import { useGuardedMutation } from "@open-mercato/ui/backend/injection/useGuardedMutation";
|
|
9
|
-
import { flash } from "@open-mercato/ui/backend/FlashMessages";
|
|
10
|
-
import { LoadingMessage } from "@open-mercato/ui/backend/detail";
|
|
11
|
-
import { useConfirmDialog } from "@open-mercato/ui/backend/confirm-dialog";
|
|
12
|
-
import { useOrganizationScopeVersion } from "@open-mercato/shared/lib/frontend/useOrganizationScope";
|
|
13
|
-
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
14
|
-
import { ChevronLeft, ChevronRight, X } from "lucide-react";
|
|
15
|
-
import Link from "next/link";
|
|
16
|
-
import { ViewSwitcher } from "../../../lib/timesheets-ui/ViewSwitcher.js";
|
|
17
|
-
import { CalendarPicker } from "../../../lib/timesheets-ui/CalendarPicker.js";
|
|
18
|
-
import { ListView } from "../../../lib/timesheets-ui/ListView.js";
|
|
19
|
-
import { TimerBar } from "../../../lib/timesheets-ui/TimerBar.js";
|
|
20
|
-
import { AddRowDropdown } from "../../../lib/timesheets-ui/AddRowDropdown.js";
|
|
21
|
-
import { CreateProjectDialog } from "../../../lib/timesheets-ui/CreateProjectDialog.js";
|
|
22
|
-
import { ProjectColorDot } from "../../../lib/timesheets-ui/ProjectColorDot.js";
|
|
23
|
-
import {
|
|
24
|
-
formatMinutesAsDecimal,
|
|
25
|
-
parseDurationInput
|
|
26
|
-
} from "../../../lib/timesheetsDuration.js";
|
|
27
|
-
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
28
|
-
const logger = createLogger("staff");
|
|
29
|
-
function getMonday(date) {
|
|
30
|
-
const d = new Date(date);
|
|
31
|
-
const day = d.getDay();
|
|
32
|
-
const diff = day === 0 ? -6 : 1 - day;
|
|
33
|
-
d.setDate(d.getDate() + diff);
|
|
34
|
-
d.setHours(0, 0, 0, 0);
|
|
35
|
-
return d;
|
|
36
|
-
}
|
|
37
|
-
function getSunday(monday) {
|
|
38
|
-
const d = new Date(monday);
|
|
39
|
-
d.setDate(d.getDate() + 6);
|
|
40
|
-
return d;
|
|
41
|
-
}
|
|
42
|
-
function getWeekNumber(date) {
|
|
43
|
-
const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
|
|
44
|
-
d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
|
|
45
|
-
const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
|
|
46
|
-
return Math.ceil(((d.getTime() - yearStart.getTime()) / 864e5 + 1) / 7);
|
|
47
|
-
}
|
|
48
|
-
function formatDateKey(date) {
|
|
49
|
-
const y = date.getFullYear();
|
|
50
|
-
const m = String(date.getMonth() + 1).padStart(2, "0");
|
|
51
|
-
const d = String(date.getDate()).padStart(2, "0");
|
|
52
|
-
return `${y}-${m}-${d}`;
|
|
53
|
-
}
|
|
54
|
-
function formatDateKeyFromParts(year, month, day) {
|
|
55
|
-
const m = String(month + 1).padStart(2, "0");
|
|
56
|
-
const d = String(day).padStart(2, "0");
|
|
57
|
-
return `${year}-${m}-${d}`;
|
|
58
|
-
}
|
|
59
|
-
function getDaysInMonth(year, month) {
|
|
60
|
-
return new Date(year, month + 1, 0).getDate();
|
|
61
|
-
}
|
|
62
|
-
function isWeekendDay(date) {
|
|
63
|
-
const d = date.getDay();
|
|
64
|
-
return d === 0 || d === 6;
|
|
65
|
-
}
|
|
66
|
-
function getLocalizedDayName(date) {
|
|
67
|
-
return date.toLocaleDateString(void 0, { weekday: "short" });
|
|
68
|
-
}
|
|
69
|
-
function getLocalizedCellDate(date) {
|
|
70
|
-
return date.toLocaleDateString(void 0, { weekday: "long", month: "long", day: "numeric" });
|
|
71
|
-
}
|
|
72
|
-
function getWeekDays(weekStart) {
|
|
73
|
-
return Array.from({ length: 7 }, (_, i) => {
|
|
74
|
-
const d = new Date(weekStart);
|
|
75
|
-
d.setDate(d.getDate() + i);
|
|
76
|
-
return d;
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function getMonthDays(year, month) {
|
|
80
|
-
const count = getDaysInMonth(year, month);
|
|
81
|
-
return Array.from({ length: count }, (_, i) => new Date(year, month, i + 1));
|
|
82
|
-
}
|
|
83
|
-
function formatWeekLabel(weekStart) {
|
|
84
|
-
const weekEnd = getSunday(weekStart);
|
|
85
|
-
const weekNum = getWeekNumber(weekStart);
|
|
86
|
-
const startDay = weekStart.getDate();
|
|
87
|
-
const endDay = weekEnd.getDate();
|
|
88
|
-
const startMonth = weekStart.toLocaleString(void 0, { month: "short" });
|
|
89
|
-
const endMonth = weekEnd.toLocaleString(void 0, { month: "short" });
|
|
90
|
-
const year = weekStart.getFullYear();
|
|
91
|
-
const dateRange = weekStart.getMonth() === weekEnd.getMonth() ? `${startDay} - ${endDay} ${startMonth} ${year}` : `${startDay} ${startMonth} - ${endDay} ${endMonth} ${year}`;
|
|
92
|
-
return `${dateRange} \xB7 W${weekNum}`;
|
|
93
|
-
}
|
|
94
|
-
function formatMonthLabel(year, month) {
|
|
95
|
-
const date = new Date(year, month, 1);
|
|
96
|
-
return date.toLocaleString(void 0, { month: "long", year: "numeric" });
|
|
97
|
-
}
|
|
98
|
-
function MyTimesheetsPage() {
|
|
99
|
-
const t = useT();
|
|
100
|
-
const scopeVersion = useOrganizationScopeVersion();
|
|
101
|
-
const { confirm, ConfirmDialogElement } = useConfirmDialog();
|
|
102
|
-
const now = /* @__PURE__ */ new Date();
|
|
103
|
-
const [viewMode, setViewMode] = React.useState("weekly");
|
|
104
|
-
const [viewType, setViewType] = React.useState("timesheet");
|
|
105
|
-
const [weekStart, setWeekStart] = React.useState(() => getMonday(now));
|
|
106
|
-
const [monthYear, setMonthYear] = React.useState(now.getFullYear());
|
|
107
|
-
const [monthIndex, setMonthIndex] = React.useState(now.getMonth());
|
|
108
|
-
const [projects, setProjects] = React.useState([]);
|
|
109
|
-
const [entries, setEntries] = React.useState({});
|
|
110
|
-
const [rawEntries, setRawEntries] = React.useState([]);
|
|
111
|
-
const [dirty, setDirty] = React.useState({});
|
|
112
|
-
const [rawText, setRawText] = React.useState({});
|
|
113
|
-
const [cellErrors, setCellErrors] = React.useState({});
|
|
114
|
-
const [staffMemberId, setStaffMemberId] = React.useState(null);
|
|
115
|
-
const [staffMemberMissing, setStaffMemberMissing] = React.useState(false);
|
|
116
|
-
const [isInitialLoad, setIsInitialLoad] = React.useState(true);
|
|
117
|
-
const [isRefreshing, setIsRefreshing] = React.useState(false);
|
|
118
|
-
const [isSaving, setIsSaving] = React.useState(false);
|
|
119
|
-
const [canManageProjects, setCanManageProjects] = React.useState(false);
|
|
120
|
-
const [createDialogOpen, setCreateDialogOpen] = React.useState(false);
|
|
121
|
-
const [allAssignedProjects, setAllAssignedProjects] = React.useState([]);
|
|
122
|
-
const mutationContextId = React.useMemo(
|
|
123
|
-
() => staffMemberId ? `staff-timesheets:${staffMemberId}` : "staff-timesheets:pending",
|
|
124
|
-
[staffMemberId]
|
|
125
|
-
);
|
|
126
|
-
const { runMutation, retryLastMutation } = useGuardedMutation({
|
|
127
|
-
contextId: mutationContextId,
|
|
128
|
-
blockedMessage: t("ui.forms.flash.saveBlocked", "Save blocked by validation")
|
|
129
|
-
});
|
|
130
|
-
const gridInstanceId = React.useId();
|
|
131
|
-
const durationHintId = `${gridInstanceId}-duration-hint`;
|
|
132
|
-
const buildDurationErrorId = React.useCallback(
|
|
133
|
-
(projectId, dateKey) => `${gridInstanceId}-duration-error-${projectId}-${dateKey}`,
|
|
134
|
-
[gridInstanceId]
|
|
135
|
-
);
|
|
136
|
-
const durationFormatHint = t(
|
|
137
|
-
"staff.timesheets.my.duration.hint",
|
|
138
|
-
"Enter hours (8 or 1.5), h:mm (1:30) or minutes (90m). Max 24h per day."
|
|
139
|
-
);
|
|
140
|
-
const describeDurationCell = React.useCallback((projectName, date) => t("staff.timesheets.my.duration.cellLabel", "Duration for {project} on {date}").replace("{project}", projectName).replace("{date}", getLocalizedCellDate(date)), [t]);
|
|
141
|
-
const describeDurationError = React.useCallback((reason) => reason === "out_of_range" ? t("staff.timesheets.my.duration.errors.out_of_range", "Maximum 24h per day. Use 1:30 or 90m for shorter entries.") : t("staff.timesheets.my.duration.errors.invalid", "Unrecognised duration. Use 8, 1.5, 1:30, 90m or 1h 30m."), [t]);
|
|
142
|
-
React.useEffect(() => {
|
|
143
|
-
let cancelled = false;
|
|
144
|
-
void (async () => {
|
|
145
|
-
try {
|
|
146
|
-
const res = await apiCall("/api/auth/feature-check", {
|
|
147
|
-
method: "POST",
|
|
148
|
-
headers: { "content-type": "application/json" },
|
|
149
|
-
body: JSON.stringify({ features: ["staff.timesheets.projects.manage"] })
|
|
150
|
-
});
|
|
151
|
-
if (!cancelled) {
|
|
152
|
-
setCanManageProjects(new Set(res.result?.granted ?? []).has("staff.timesheets.projects.manage"));
|
|
153
|
-
}
|
|
154
|
-
} catch {
|
|
155
|
-
}
|
|
156
|
-
})();
|
|
157
|
-
return () => {
|
|
158
|
-
cancelled = true;
|
|
159
|
-
};
|
|
160
|
-
}, []);
|
|
161
|
-
const visibleDays = React.useMemo(() => {
|
|
162
|
-
if (viewMode === "weekly") return getWeekDays(weekStart);
|
|
163
|
-
return getMonthDays(monthYear, monthIndex);
|
|
164
|
-
}, [viewMode, weekStart, monthYear, monthIndex]);
|
|
165
|
-
const dateRange = React.useMemo(() => {
|
|
166
|
-
if (viewMode === "weekly") {
|
|
167
|
-
return { from: formatDateKey(weekStart), to: formatDateKey(getSunday(weekStart)) };
|
|
168
|
-
}
|
|
169
|
-
const daysInMonth = getDaysInMonth(monthYear, monthIndex);
|
|
170
|
-
return {
|
|
171
|
-
from: formatDateKeyFromParts(monthYear, monthIndex, 1),
|
|
172
|
-
to: formatDateKeyFromParts(monthYear, monthIndex, daysInMonth)
|
|
173
|
-
};
|
|
174
|
-
}, [viewMode, weekStart, monthYear, monthIndex]);
|
|
175
|
-
const goToPrev = React.useCallback(() => {
|
|
176
|
-
if (viewMode === "weekly") {
|
|
177
|
-
setWeekStart((prev) => {
|
|
178
|
-
const d = new Date(prev);
|
|
179
|
-
d.setDate(d.getDate() - 7);
|
|
180
|
-
return d;
|
|
181
|
-
});
|
|
182
|
-
} else {
|
|
183
|
-
setMonthIndex((prev) => {
|
|
184
|
-
if (prev === 0) {
|
|
185
|
-
setMonthYear((y) => y - 1);
|
|
186
|
-
return 11;
|
|
187
|
-
}
|
|
188
|
-
return prev - 1;
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}, [viewMode]);
|
|
192
|
-
const goToNext = React.useCallback(() => {
|
|
193
|
-
if (viewMode === "weekly") {
|
|
194
|
-
setWeekStart((prev) => {
|
|
195
|
-
const d = new Date(prev);
|
|
196
|
-
d.setDate(d.getDate() + 7);
|
|
197
|
-
return d;
|
|
198
|
-
});
|
|
199
|
-
} else {
|
|
200
|
-
setMonthIndex((prev) => {
|
|
201
|
-
if (prev === 11) {
|
|
202
|
-
setMonthYear((y) => y + 1);
|
|
203
|
-
return 0;
|
|
204
|
-
}
|
|
205
|
-
return prev + 1;
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
}, [viewMode]);
|
|
209
|
-
const navigationLabel = React.useMemo(() => {
|
|
210
|
-
if (viewMode === "weekly") return formatWeekLabel(weekStart);
|
|
211
|
-
return formatMonthLabel(monthYear, monthIndex);
|
|
212
|
-
}, [viewMode, weekStart, monthYear, monthIndex]);
|
|
213
|
-
const isInitialLoadRef = React.useRef(true);
|
|
214
|
-
const loadData = React.useCallback(async () => {
|
|
215
|
-
if (!isInitialLoadRef.current) setIsRefreshing(true);
|
|
216
|
-
try {
|
|
217
|
-
const selfRes = await readApiResultOrThrow(
|
|
218
|
-
"/api/staff/team-members/self",
|
|
219
|
-
void 0,
|
|
220
|
-
{ errorMessage: t("staff.timesheets.my.errors.load", "Failed to load timesheets."), fallback: { member: null } }
|
|
221
|
-
);
|
|
222
|
-
const memberId = selfRes.member?.id ?? null;
|
|
223
|
-
setStaffMemberId(memberId);
|
|
224
|
-
if (!memberId) {
|
|
225
|
-
setStaffMemberMissing(true);
|
|
226
|
-
setProjects([]);
|
|
227
|
-
setEntries({});
|
|
228
|
-
setRawEntries([]);
|
|
229
|
-
setIsInitialLoad(false);
|
|
230
|
-
setIsRefreshing(false);
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
setStaffMemberMissing(false);
|
|
234
|
-
const assignmentsRes = await readApiResultOrThrow(
|
|
235
|
-
"/api/staff/timesheets/my-projects?pageSize=100",
|
|
236
|
-
void 0,
|
|
237
|
-
{ errorMessage: t("staff.timesheets.my.errors.load", "Failed to load timesheets."), fallback: { items: [] } }
|
|
238
|
-
);
|
|
239
|
-
const assignmentItems = Array.isArray(assignmentsRes.items) ? assignmentsRes.items : [];
|
|
240
|
-
const assignedProjectIds = assignmentItems.map((item) => String(item.time_project_id ?? item.timeProjectId ?? "")).filter((id) => id.length > 0);
|
|
241
|
-
const visibleProjectIdSet = new Set(
|
|
242
|
-
assignmentItems.filter((item) => item.show_in_grid === true || item.showInGrid === true).map((item) => String(item.time_project_id ?? item.timeProjectId ?? "")).filter((id) => id.length > 0)
|
|
243
|
-
);
|
|
244
|
-
const entriesParams = new URLSearchParams({ pageSize: "100", staffMemberId: memberId });
|
|
245
|
-
if (dateRange.from) entriesParams.set("from", dateRange.from);
|
|
246
|
-
if (dateRange.to) entriesParams.set("to", dateRange.to);
|
|
247
|
-
const [projectsRes, entriesRes] = await Promise.all([
|
|
248
|
-
assignedProjectIds.length > 0 ? readApiResultOrThrow(
|
|
249
|
-
`/api/staff/timesheets/time-projects?ids=${assignedProjectIds.join(",")}&pageSize=100`,
|
|
250
|
-
void 0,
|
|
251
|
-
{ errorMessage: t("staff.timesheets.my.errors.load", "Failed to load timesheets."), fallback: { items: [] } }
|
|
252
|
-
) : Promise.resolve({ items: [] }),
|
|
253
|
-
readApiResultOrThrow(
|
|
254
|
-
`/api/staff/timesheets/time-entries?${entriesParams.toString()}`,
|
|
255
|
-
void 0,
|
|
256
|
-
{ errorMessage: t("staff.timesheets.my.errors.load", "Failed to load timesheets."), fallback: { items: [] } }
|
|
257
|
-
)
|
|
258
|
-
]);
|
|
259
|
-
const projectItems = Array.isArray(projectsRes.items) ? projectsRes.items : [];
|
|
260
|
-
const mappedProjects = projectItems.map((item) => ({
|
|
261
|
-
id: String(item.id ?? ""),
|
|
262
|
-
name: String(item.name ?? ""),
|
|
263
|
-
code: typeof item.code === "string" ? item.code : null,
|
|
264
|
-
color: typeof item.color === "string" ? item.color : null
|
|
265
|
-
}));
|
|
266
|
-
setAllAssignedProjects(mappedProjects);
|
|
267
|
-
const visibleProjects = mappedProjects.filter((p) => visibleProjectIdSet.has(p.id));
|
|
268
|
-
setProjects(visibleProjects);
|
|
269
|
-
const entryItems = Array.isArray(entriesRes.items) ? entriesRes.items : [];
|
|
270
|
-
setRawEntries(entryItems);
|
|
271
|
-
const map = {};
|
|
272
|
-
for (const item of entryItems) {
|
|
273
|
-
const projectId = String(item.time_project_id ?? item.timeProjectId ?? "");
|
|
274
|
-
const rawDate = String(item.date ?? "");
|
|
275
|
-
const dateKey = rawDate.slice(0, 10);
|
|
276
|
-
const minutes = typeof item.duration_minutes === "number" ? item.duration_minutes : typeof item.durationMinutes === "number" ? item.durationMinutes : 0;
|
|
277
|
-
const entryId = String(item.id ?? "");
|
|
278
|
-
if (!map[projectId]) map[projectId] = {};
|
|
279
|
-
if (!map[projectId][dateKey]) map[projectId][dateKey] = [];
|
|
280
|
-
map[projectId][dateKey].push({ id: entryId || void 0, minutes });
|
|
281
|
-
}
|
|
282
|
-
setEntries(map);
|
|
283
|
-
setDirty({});
|
|
284
|
-
setRawText({});
|
|
285
|
-
setCellErrors({});
|
|
286
|
-
} catch (error) {
|
|
287
|
-
logger.error("staff.timesheets.my.load", { err: error });
|
|
288
|
-
flash(t("staff.timesheets.my.errors.load", "Failed to load timesheets."), "error");
|
|
289
|
-
} finally {
|
|
290
|
-
isInitialLoadRef.current = false;
|
|
291
|
-
setIsInitialLoad(false);
|
|
292
|
-
setIsRefreshing(false);
|
|
293
|
-
}
|
|
294
|
-
}, [dateRange.from, dateRange.to, t]);
|
|
295
|
-
React.useEffect(() => {
|
|
296
|
-
void loadData();
|
|
297
|
-
}, [loadData, scopeVersion]);
|
|
298
|
-
const clearCellError = React.useCallback((projectId, dateKey) => {
|
|
299
|
-
setCellErrors((prev) => {
|
|
300
|
-
const projectErrors = prev[projectId];
|
|
301
|
-
if (!projectErrors || projectErrors[dateKey] === void 0) return prev;
|
|
302
|
-
const nextProjectErrors = { ...projectErrors };
|
|
303
|
-
delete nextProjectErrors[dateKey];
|
|
304
|
-
const next = { ...prev };
|
|
305
|
-
if (Object.keys(nextProjectErrors).length > 0) next[projectId] = nextProjectErrors;
|
|
306
|
-
else delete next[projectId];
|
|
307
|
-
return next;
|
|
308
|
-
});
|
|
309
|
-
}, []);
|
|
310
|
-
const handleCellChange = React.useCallback((projectId, dateKey, value) => {
|
|
311
|
-
clearCellError(projectId, dateKey);
|
|
312
|
-
setRawText((prev) => {
|
|
313
|
-
const projectTexts = { ...prev[projectId] ?? {} };
|
|
314
|
-
projectTexts[dateKey] = value;
|
|
315
|
-
return { ...prev, [projectId]: projectTexts };
|
|
316
|
-
});
|
|
317
|
-
}, [clearCellError]);
|
|
318
|
-
const dropDirtyCell = React.useCallback((projectId, dateKey) => {
|
|
319
|
-
setDirty((prev) => {
|
|
320
|
-
const projectEntries = prev[projectId];
|
|
321
|
-
if (!projectEntries || projectEntries[dateKey] === void 0) return prev;
|
|
322
|
-
const nextProjectEntries = { ...projectEntries };
|
|
323
|
-
delete nextProjectEntries[dateKey];
|
|
324
|
-
const next = { ...prev };
|
|
325
|
-
if (Object.keys(nextProjectEntries).length > 0) next[projectId] = nextProjectEntries;
|
|
326
|
-
else delete next[projectId];
|
|
327
|
-
return next;
|
|
328
|
-
});
|
|
329
|
-
}, []);
|
|
330
|
-
const handleCellBlur = React.useCallback((projectId, dateKey, currentValue) => {
|
|
331
|
-
const editedText = rawText[projectId]?.[dateKey];
|
|
332
|
-
const text = editedText ?? currentValue;
|
|
333
|
-
if (text === void 0) return;
|
|
334
|
-
const parsed = parseDurationInput(text);
|
|
335
|
-
if (!parsed.ok) {
|
|
336
|
-
dropDirtyCell(projectId, dateKey);
|
|
337
|
-
setCellErrors((prev) => {
|
|
338
|
-
const projectErrors = { ...prev[projectId] ?? {} };
|
|
339
|
-
projectErrors[dateKey] = parsed.reason;
|
|
340
|
-
return { ...prev, [projectId]: projectErrors };
|
|
341
|
-
});
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
clearCellError(projectId, dateKey);
|
|
345
|
-
const minutes = parsed.minutes;
|
|
346
|
-
const cellEntries = entries[projectId]?.[dateKey] ?? [];
|
|
347
|
-
const existingMinutes = cellEntries.reduce((sum, e) => sum + e.minutes, 0);
|
|
348
|
-
if (minutes !== existingMinutes || editedText !== void 0 && cellEntries.length > 0) {
|
|
349
|
-
setDirty((prev) => {
|
|
350
|
-
const projectEntries = { ...prev[projectId] ?? {} };
|
|
351
|
-
const firstId = cellEntries[0]?.id;
|
|
352
|
-
projectEntries[dateKey] = { id: firstId, minutes };
|
|
353
|
-
return { ...prev, [projectId]: projectEntries };
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
setRawText((prev) => {
|
|
357
|
-
const projectTexts = { ...prev[projectId] ?? {} };
|
|
358
|
-
delete projectTexts[dateKey];
|
|
359
|
-
const hasKeys = Object.keys(projectTexts).length > 0;
|
|
360
|
-
if (!hasKeys) {
|
|
361
|
-
const next = { ...prev };
|
|
362
|
-
delete next[projectId];
|
|
363
|
-
return next;
|
|
364
|
-
}
|
|
365
|
-
return { ...prev, [projectId]: projectTexts };
|
|
366
|
-
});
|
|
367
|
-
}, [rawText, entries, clearCellError, dropDirtyCell]);
|
|
368
|
-
const getCellValue = React.useCallback((projectId, dateKey) => {
|
|
369
|
-
const dirtyCell = dirty[projectId]?.[dateKey];
|
|
370
|
-
if (dirtyCell !== void 0) return dirtyCell.minutes;
|
|
371
|
-
const cellEntries = entries[projectId]?.[dateKey] ?? [];
|
|
372
|
-
return cellEntries.reduce((sum, e) => sum + e.minutes, 0);
|
|
373
|
-
}, [dirty, entries]);
|
|
374
|
-
const hasChanges = Object.keys(dirty).length > 0 || Object.keys(rawText).length > 0;
|
|
375
|
-
const invalidCellCount = React.useMemo(
|
|
376
|
-
() => Object.values(cellErrors).reduce((sum, projectErrors) => sum + Object.keys(projectErrors).length, 0),
|
|
377
|
-
[cellErrors]
|
|
378
|
-
);
|
|
379
|
-
const pendingSummary = React.useMemo(() => {
|
|
380
|
-
let cells = 0;
|
|
381
|
-
let minutes = 0;
|
|
382
|
-
for (const dateMap of Object.values(dirty)) {
|
|
383
|
-
for (const cell of Object.values(dateMap)) {
|
|
384
|
-
cells += 1;
|
|
385
|
-
minutes += cell.minutes;
|
|
386
|
-
}
|
|
387
|
-
}
|
|
388
|
-
return { cells, minutes };
|
|
389
|
-
}, [dirty]);
|
|
390
|
-
const handleSave = React.useCallback(async () => {
|
|
391
|
-
if (!hasChanges || invalidCellCount > 0) return;
|
|
392
|
-
const summary = t("staff.timesheets.my.confirm_save.summary", "{count} cell(s), {total}h in total.").replace("{count}", String(pendingSummary.cells)).replace("{total}", formatMinutesAsDecimal(pendingSummary.minutes) || "0");
|
|
393
|
-
const confirmed = await confirm({
|
|
394
|
-
title: t("staff.timesheets.my.confirm_save.title", "Save changes?"),
|
|
395
|
-
text: `${t("staff.timesheets.my.confirm_save.body", "Your timesheet entries will be saved.")} ${summary}`
|
|
396
|
-
});
|
|
397
|
-
if (!confirmed) return;
|
|
398
|
-
setIsSaving(true);
|
|
399
|
-
try {
|
|
400
|
-
const bulkEntries = [];
|
|
401
|
-
for (const [projectId, dateMap] of Object.entries(dirty)) {
|
|
402
|
-
for (const [dateKey, cellValue] of Object.entries(dateMap)) {
|
|
403
|
-
const cell = cellValue;
|
|
404
|
-
const cellEntries = entries[projectId]?.[dateKey] ?? [];
|
|
405
|
-
const firstId = cell.id ?? cellEntries[0]?.id;
|
|
406
|
-
bulkEntries.push({ id: firstId, date: dateKey, timeProjectId: projectId, durationMinutes: cell.minutes });
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
if (bulkEntries.length === 0) return;
|
|
410
|
-
const payload = { entries: bulkEntries };
|
|
411
|
-
await runMutation({
|
|
412
|
-
operation: () => apiCallOrThrow("/api/staff/timesheets/time-entries/bulk", {
|
|
413
|
-
method: "POST",
|
|
414
|
-
headers: { "Content-Type": "application/json" },
|
|
415
|
-
body: JSON.stringify(payload)
|
|
416
|
-
}),
|
|
417
|
-
context: {
|
|
418
|
-
formId: mutationContextId,
|
|
419
|
-
resourceKind: "staff.timesheets.time_entry",
|
|
420
|
-
resourceId: staffMemberId ?? void 0,
|
|
421
|
-
staffMemberId,
|
|
422
|
-
retryLastMutation
|
|
423
|
-
},
|
|
424
|
-
mutationPayload: payload
|
|
425
|
-
});
|
|
426
|
-
flash(t("staff.timesheets.my.saved", "Timesheet saved."), "success");
|
|
427
|
-
await loadData();
|
|
428
|
-
} catch (error) {
|
|
429
|
-
logger.error("staff.timesheets.my.save", { err: error });
|
|
430
|
-
flash(t("staff.timesheets.my.errors.save", "Failed to save timesheets."), "error");
|
|
431
|
-
} finally {
|
|
432
|
-
setIsSaving(false);
|
|
433
|
-
}
|
|
434
|
-
}, [dirty, entries, hasChanges, invalidCellCount, pendingSummary, confirm, t, loadData, runMutation, mutationContextId, staffMemberId, retryLastMutation]);
|
|
435
|
-
const getRowTotal = React.useCallback((projectId) => {
|
|
436
|
-
let total = 0;
|
|
437
|
-
for (const day of visibleDays) {
|
|
438
|
-
total += getCellValue(projectId, formatDateKey(day));
|
|
439
|
-
}
|
|
440
|
-
return total;
|
|
441
|
-
}, [visibleDays, getCellValue]);
|
|
442
|
-
const getDayTotal = React.useCallback((date) => {
|
|
443
|
-
const dateKey = formatDateKey(date);
|
|
444
|
-
let total = 0;
|
|
445
|
-
for (const project of projects) {
|
|
446
|
-
total += getCellValue(project.id, dateKey);
|
|
447
|
-
}
|
|
448
|
-
return total;
|
|
449
|
-
}, [projects, getCellValue]);
|
|
450
|
-
const grandTotal = React.useMemo(() => {
|
|
451
|
-
let total = 0;
|
|
452
|
-
for (const project of projects) {
|
|
453
|
-
total += getRowTotal(project.id);
|
|
454
|
-
}
|
|
455
|
-
return total;
|
|
456
|
-
}, [projects, getRowTotal]);
|
|
457
|
-
const workingDays = React.useMemo(() => {
|
|
458
|
-
let count = 0;
|
|
459
|
-
for (const day of visibleDays) {
|
|
460
|
-
if (!isWeekendDay(day)) {
|
|
461
|
-
const dateKey = formatDateKey(day);
|
|
462
|
-
for (const project of projects) {
|
|
463
|
-
if (getCellValue(project.id, dateKey) > 0) {
|
|
464
|
-
count++;
|
|
465
|
-
break;
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
return count;
|
|
471
|
-
}, [visibleDays, projects, getCellValue]);
|
|
472
|
-
const dailyAverage = React.useMemo(() => {
|
|
473
|
-
if (workingDays === 0) return 0;
|
|
474
|
-
return grandTotal / workingDays;
|
|
475
|
-
}, [grandTotal, workingDays]);
|
|
476
|
-
const listViewEntries = React.useMemo(() => {
|
|
477
|
-
return rawEntries.map((item) => ({
|
|
478
|
-
id: String(item.id ?? ""),
|
|
479
|
-
date: String(item.date ?? "").slice(0, 10),
|
|
480
|
-
durationMinutes: typeof item.duration_minutes === "number" ? item.duration_minutes : typeof item.durationMinutes === "number" ? item.durationMinutes : 0,
|
|
481
|
-
projectId: String(item.time_project_id ?? item.timeProjectId ?? ""),
|
|
482
|
-
projectName: projects.find((p) => p.id === String(item.time_project_id ?? item.timeProjectId ?? ""))?.name ?? "",
|
|
483
|
-
projectCode: projects.find((p) => p.id === String(item.time_project_id ?? item.timeProjectId ?? ""))?.code ?? null,
|
|
484
|
-
projectColor: projects.find((p) => p.id === String(item.time_project_id ?? item.timeProjectId ?? ""))?.color ?? null,
|
|
485
|
-
notes: typeof item.notes === "string" ? item.notes : null,
|
|
486
|
-
source: typeof item.source === "string" ? item.source : "manual",
|
|
487
|
-
startedAt: typeof item.started_at === "string" ? item.started_at : typeof item.startedAt === "string" ? item.startedAt : null,
|
|
488
|
-
endedAt: typeof item.ended_at === "string" ? item.ended_at : typeof item.endedAt === "string" ? item.endedAt : null
|
|
489
|
-
}));
|
|
490
|
-
}, [rawEntries, projects]);
|
|
491
|
-
const handleViewModeChange = React.useCallback((mode) => {
|
|
492
|
-
setViewMode(mode);
|
|
493
|
-
if (mode === "monthly") {
|
|
494
|
-
const thursday = new Date(weekStart);
|
|
495
|
-
thursday.setDate(thursday.getDate() + 3);
|
|
496
|
-
setMonthYear(thursday.getFullYear());
|
|
497
|
-
setMonthIndex(thursday.getMonth());
|
|
498
|
-
} else {
|
|
499
|
-
const midMonth = new Date(monthYear, monthIndex, 15);
|
|
500
|
-
setWeekStart(getMonday(midMonth));
|
|
501
|
-
}
|
|
502
|
-
}, [weekStart, monthYear, monthIndex]);
|
|
503
|
-
const visibleProjectIds = React.useMemo(() => new Set(projects.map((p) => p.id)), [projects]);
|
|
504
|
-
const handleAddProject = React.useCallback(async (project) => {
|
|
505
|
-
try {
|
|
506
|
-
const payload = { showInGrid: true };
|
|
507
|
-
await runMutation({
|
|
508
|
-
operation: () => apiCallOrThrow(`/api/staff/timesheets/my-projects/${project.id}`, {
|
|
509
|
-
method: "PATCH",
|
|
510
|
-
headers: { "Content-Type": "application/json" },
|
|
511
|
-
body: JSON.stringify(payload)
|
|
512
|
-
}),
|
|
513
|
-
context: {
|
|
514
|
-
formId: mutationContextId,
|
|
515
|
-
resourceKind: "staff.timesheets.time_project_member",
|
|
516
|
-
resourceId: project.id,
|
|
517
|
-
staffMemberId,
|
|
518
|
-
retryLastMutation
|
|
519
|
-
},
|
|
520
|
-
mutationPayload: payload
|
|
521
|
-
});
|
|
522
|
-
setProjects((prev) => {
|
|
523
|
-
if (prev.some((p) => p.id === project.id)) return prev;
|
|
524
|
-
return [...prev, project];
|
|
525
|
-
});
|
|
526
|
-
} catch (error) {
|
|
527
|
-
logger.error("staff.timesheets.my.addRow", { err: error });
|
|
528
|
-
flash(t("staff.timesheets.my.addRow.error", "Could not add the project. Please try again."), "error");
|
|
529
|
-
}
|
|
530
|
-
}, [t, runMutation, mutationContextId, staffMemberId, retryLastMutation]);
|
|
531
|
-
const handleRemoveProject = React.useCallback(async (project) => {
|
|
532
|
-
const confirmed = await confirm({
|
|
533
|
-
title: t("staff.timesheets.my.removeRow", "Remove from grid"),
|
|
534
|
-
text: t(
|
|
535
|
-
"staff.timesheets.my.removeRow.confirm",
|
|
536
|
-
'Remove {projectName} from your timesheet grid? You can re-add it anytime via "+ Add row".'
|
|
537
|
-
).replace("{projectName}", project.name)
|
|
538
|
-
});
|
|
539
|
-
if (!confirmed) return;
|
|
540
|
-
try {
|
|
541
|
-
const payload = { showInGrid: false };
|
|
542
|
-
await runMutation({
|
|
543
|
-
operation: () => apiCallOrThrow(`/api/staff/timesheets/my-projects/${project.id}`, {
|
|
544
|
-
method: "PATCH",
|
|
545
|
-
headers: { "Content-Type": "application/json" },
|
|
546
|
-
body: JSON.stringify(payload)
|
|
547
|
-
}),
|
|
548
|
-
context: {
|
|
549
|
-
formId: mutationContextId,
|
|
550
|
-
resourceKind: "staff.timesheets.time_project_member",
|
|
551
|
-
resourceId: project.id,
|
|
552
|
-
staffMemberId,
|
|
553
|
-
retryLastMutation
|
|
554
|
-
},
|
|
555
|
-
mutationPayload: payload
|
|
556
|
-
});
|
|
557
|
-
setProjects((prev) => prev.filter((p) => p.id !== project.id));
|
|
558
|
-
setDirty((prev) => {
|
|
559
|
-
if (!prev[project.id]) return prev;
|
|
560
|
-
const next = { ...prev };
|
|
561
|
-
delete next[project.id];
|
|
562
|
-
return next;
|
|
563
|
-
});
|
|
564
|
-
setRawText((prev) => {
|
|
565
|
-
if (!prev[project.id]) return prev;
|
|
566
|
-
const next = { ...prev };
|
|
567
|
-
delete next[project.id];
|
|
568
|
-
return next;
|
|
569
|
-
});
|
|
570
|
-
setCellErrors((prev) => {
|
|
571
|
-
if (!prev[project.id]) return prev;
|
|
572
|
-
const next = { ...prev };
|
|
573
|
-
delete next[project.id];
|
|
574
|
-
return next;
|
|
575
|
-
});
|
|
576
|
-
} catch (error) {
|
|
577
|
-
logger.error("staff.timesheets.my.removeRow", { err: error });
|
|
578
|
-
flash(t("staff.timesheets.my.removeRow.error", "Could not remove the project. Please try again."), "error");
|
|
579
|
-
}
|
|
580
|
-
}, [confirm, t, runMutation, mutationContextId, staffMemberId, retryLastMutation]);
|
|
581
|
-
const handleProjectCreated = React.useCallback(async (project) => {
|
|
582
|
-
setAllAssignedProjects((prev) => [...prev, project]);
|
|
583
|
-
try {
|
|
584
|
-
const payload = { showInGrid: true };
|
|
585
|
-
await runMutation({
|
|
586
|
-
operation: () => apiCallOrThrow(`/api/staff/timesheets/my-projects/${project.id}`, {
|
|
587
|
-
method: "PATCH",
|
|
588
|
-
headers: { "Content-Type": "application/json" },
|
|
589
|
-
body: JSON.stringify(payload)
|
|
590
|
-
}),
|
|
591
|
-
context: {
|
|
592
|
-
formId: mutationContextId,
|
|
593
|
-
resourceKind: "staff.timesheets.time_project_member",
|
|
594
|
-
resourceId: project.id,
|
|
595
|
-
staffMemberId,
|
|
596
|
-
retryLastMutation
|
|
597
|
-
},
|
|
598
|
-
mutationPayload: payload
|
|
599
|
-
});
|
|
600
|
-
} catch (error) {
|
|
601
|
-
logger.error("staff.timesheets.my.createProject.visibility", { err: error });
|
|
602
|
-
}
|
|
603
|
-
setProjects((prev) => [...prev, project]);
|
|
604
|
-
setCreateDialogOpen(false);
|
|
605
|
-
}, [runMutation, mutationContextId, staffMemberId, retryLastMutation]);
|
|
606
|
-
if (isInitialLoad) {
|
|
607
|
-
return /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsx(PageBody, { children: /* @__PURE__ */ jsx(LoadingMessage, { label: t("staff.timesheets.my.loading", "Loading timesheets...") }) }) });
|
|
608
|
-
}
|
|
609
|
-
if (staffMemberMissing) {
|
|
610
|
-
return /* @__PURE__ */ jsx(Page, { children: /* @__PURE__ */ jsx(PageBody, { children: /* @__PURE__ */ jsxs("div", { className: "py-12 text-center", children: [
|
|
611
|
-
/* @__PURE__ */ jsx("p", { className: "text-lg font-semibold mb-2", children: t("staff.timesheets.my.noProfile.title", "Set up your profile to start tracking time") }),
|
|
612
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-6", children: t("staff.timesheets.my.noProfile", "You need a Team Member profile to track time.") }),
|
|
613
|
-
/* @__PURE__ */ jsx(Button, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: "/backend/staff/profile/create", children: t("staff.timesheets.my.createProfile", "Create My Profile") }) })
|
|
614
|
-
] }) }) });
|
|
615
|
-
}
|
|
616
|
-
return /* @__PURE__ */ jsxs(Page, { children: [
|
|
617
|
-
/* @__PURE__ */ jsxs(PageBody, { children: [
|
|
618
|
-
/* @__PURE__ */ jsx(
|
|
619
|
-
TimerBar,
|
|
620
|
-
{
|
|
621
|
-
projects: allAssignedProjects,
|
|
622
|
-
staffMemberId,
|
|
623
|
-
onTimerStopped: loadData
|
|
624
|
-
}
|
|
625
|
-
),
|
|
626
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-4 grid grid-cols-1 gap-4 sm:grid-cols-4", children: [
|
|
627
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
628
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: viewMode === "weekly" ? t("staff.timesheets.my.weekTotal", "Week Total") : t("staff.timesheets.my.total_hours", "Total Hours") }),
|
|
629
|
-
/* @__PURE__ */ jsx("p", { className: "text-2xl font-semibold", children: formatMinutesAsDecimal(grandTotal) || "0" })
|
|
630
|
-
] }),
|
|
631
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
632
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("staff.timesheets.my.working_days", "Working Days") }),
|
|
633
|
-
/* @__PURE__ */ jsx("p", { className: "text-2xl font-semibold", children: workingDays })
|
|
634
|
-
] }),
|
|
635
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
636
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("staff.timesheets.my.daily_average", "Daily Average") }),
|
|
637
|
-
/* @__PURE__ */ jsx("p", { className: "text-2xl font-semibold", children: formatMinutesAsDecimal(Math.round(dailyAverage)) || "0" })
|
|
638
|
-
] }),
|
|
639
|
-
/* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-4", children: [
|
|
640
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: t("staff.timesheets.my.status", "Status") }),
|
|
641
|
-
/* @__PURE__ */ jsx("p", { className: "text-2xl font-semibold", children: /* @__PURE__ */ jsx("span", { className: "inline-flex items-center rounded-full bg-green-100 px-2.5 py-0.5 text-xs font-medium text-green-800", children: t("staff.timesheets.my.status_open", "Open") }) })
|
|
642
|
-
] })
|
|
643
|
-
] }),
|
|
644
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-4 flex flex-wrap items-center justify-between gap-3", children: [
|
|
645
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
646
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", type: "button", onClick: goToPrev, children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" }) }),
|
|
647
|
-
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold min-w-[220px] text-center", children: navigationLabel }),
|
|
648
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", size: "icon", type: "button", onClick: goToNext, children: /* @__PURE__ */ jsx(ChevronRight, { className: "size-4" }) }),
|
|
649
|
-
viewMode === "weekly" && /* @__PURE__ */ jsx(CalendarPicker, { selectedWeekStart: weekStart, onWeekSelect: setWeekStart })
|
|
650
|
-
] }),
|
|
651
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
652
|
-
/* @__PURE__ */ jsx(
|
|
653
|
-
ViewSwitcher,
|
|
654
|
-
{
|
|
655
|
-
viewMode,
|
|
656
|
-
onViewModeChange: handleViewModeChange,
|
|
657
|
-
viewType,
|
|
658
|
-
onViewTypeChange: setViewType
|
|
659
|
-
}
|
|
660
|
-
),
|
|
661
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
662
|
-
invalidCellCount > 0 ? /* @__PURE__ */ jsx("span", { className: "text-xs text-status-error-text font-medium", children: t("staff.timesheets.my.duration.blocked", "Fix the highlighted durations to save") }) : hasChanges && /* @__PURE__ */ jsx("span", { className: "text-xs text-status-warning-text font-medium", children: t("staff.timesheets.my.unsaved", "Unsaved changes") }),
|
|
663
|
-
/* @__PURE__ */ jsx(Button, { size: "sm", type: "button", onClick: handleSave, disabled: !hasChanges || isSaving || invalidCellCount > 0, children: isSaving ? t("staff.timesheets.my.saving", "Saving...") : t("staff.timesheets.my.save_changes", "Save Changes") })
|
|
664
|
-
] })
|
|
665
|
-
] })
|
|
666
|
-
] }),
|
|
667
|
-
/* @__PURE__ */ jsx("div", { className: isRefreshing ? "opacity-50 pointer-events-none transition-opacity" : "transition-opacity", children: allAssignedProjects.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "py-12 text-center", children: [
|
|
668
|
-
/* @__PURE__ */ jsx("p", { className: "text-lg font-semibold mb-2", children: t("staff.timesheets.my.noProjects.title", "No projects assigned yet") }),
|
|
669
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground mb-6", children: canManageProjects ? t("staff.timesheets.my.noProjects.admin", "Create a project and assign yourself to start tracking time.") : t("staff.timesheets.my.noProjects.employee", "Ask your manager to assign you to a project.") }),
|
|
670
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-3", children: [
|
|
671
|
-
canManageProjects && /* @__PURE__ */ jsx(Button, { asChild: true, children: /* @__PURE__ */ jsx(Link, { href: "/backend/staff/timesheets/projects/create", children: t("staff.timesheets.my.noProjects.createProject", "Create Project") }) }),
|
|
672
|
-
/* @__PURE__ */ jsx(Button, { variant: "outline", asChild: true, children: /* @__PURE__ */ jsx(Link, { href: "/backend/staff/timesheets/projects", children: t("staff.timesheets.my.noProjects.viewProjects", "View Projects") }) })
|
|
673
|
-
] })
|
|
674
|
-
] }) : viewType === "list" ? /* @__PURE__ */ jsx(ListView, { entries: listViewEntries, onEntryUpdated: loadData }) : /* @__PURE__ */ jsxs("div", { className: "overflow-x-auto rounded-lg border", children: [
|
|
675
|
-
/* @__PURE__ */ jsxs("table", { className: "w-full text-sm table-fixed", children: [
|
|
676
|
-
/* @__PURE__ */ jsxs("colgroup", { children: [
|
|
677
|
-
/* @__PURE__ */ jsx("col", { className: viewMode === "weekly" ? "w-[35%]" : "w-[140px] min-w-[140px]" }),
|
|
678
|
-
visibleDays.map((date) => /* @__PURE__ */ jsx("col", { className: viewMode === "weekly" ? "" : "w-[36px] min-w-[36px]" }, formatDateKey(date))),
|
|
679
|
-
/* @__PURE__ */ jsx("col", { className: viewMode === "weekly" ? "w-[72px]" : "w-[56px] min-w-[56px]" })
|
|
680
|
-
] }),
|
|
681
|
-
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b bg-muted/50", children: [
|
|
682
|
-
/* @__PURE__ */ jsx("th", { className: "sticky left-0 z-10 bg-muted px-3 py-2 text-left font-medium", children: t("staff.timesheets.my.project", "Project") }),
|
|
683
|
-
visibleDays.map((date) => {
|
|
684
|
-
const dayName = getLocalizedDayName(date);
|
|
685
|
-
const weekend = isWeekendDay(date);
|
|
686
|
-
return /* @__PURE__ */ jsxs(
|
|
687
|
-
"th",
|
|
688
|
-
{
|
|
689
|
-
className: `py-2 text-center font-medium px-1 ${weekend ? "bg-muted/80 text-muted-foreground" : ""}`,
|
|
690
|
-
children: [
|
|
691
|
-
/* @__PURE__ */ jsx("div", { className: "text-[10px] uppercase text-muted-foreground", children: dayName }),
|
|
692
|
-
/* @__PURE__ */ jsx("div", { className: "text-xs", children: date.getDate() })
|
|
693
|
-
]
|
|
694
|
-
},
|
|
695
|
-
formatDateKey(date)
|
|
696
|
-
);
|
|
697
|
-
}),
|
|
698
|
-
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-right font-medium", children: t("staff.timesheets.my.total", "Total") })
|
|
699
|
-
] }) }),
|
|
700
|
-
/* @__PURE__ */ jsxs("tbody", { children: [
|
|
701
|
-
projects.map((project) => /* @__PURE__ */ jsxs("tr", { className: "group border-b hover:bg-muted/30", children: [
|
|
702
|
-
/* @__PURE__ */ jsx("td", { className: "sticky left-0 z-10 bg-background px-3 py-1.5 font-medium text-foreground", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
703
|
-
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
704
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 truncate", title: project.name, children: [
|
|
705
|
-
/* @__PURE__ */ jsx(ProjectColorDot, { colorKey: project.color, projectName: project.name, size: "sm" }),
|
|
706
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: project.name })
|
|
707
|
-
] }),
|
|
708
|
-
project.code && /* @__PURE__ */ jsx("div", { className: "text-[10px] text-muted-foreground", children: project.code })
|
|
709
|
-
] }),
|
|
710
|
-
/* @__PURE__ */ jsx(
|
|
711
|
-
"button",
|
|
712
|
-
{
|
|
713
|
-
type: "button",
|
|
714
|
-
onClick: () => {
|
|
715
|
-
void handleRemoveProject(project);
|
|
716
|
-
},
|
|
717
|
-
"aria-label": t("staff.timesheets.my.removeRow", "Remove from grid"),
|
|
718
|
-
title: t("staff.timesheets.my.removeRow", "Remove from grid"),
|
|
719
|
-
className: "opacity-0 group-hover:opacity-100 focus:opacity-100 inline-flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground transition-opacity",
|
|
720
|
-
children: /* @__PURE__ */ jsx(X, { className: "h-3.5 w-3.5" })
|
|
721
|
-
}
|
|
722
|
-
)
|
|
723
|
-
] }) }),
|
|
724
|
-
visibleDays.map((date) => {
|
|
725
|
-
const dateKey = formatDateKey(date);
|
|
726
|
-
const weekend = isWeekendDay(date);
|
|
727
|
-
const cellMinutes = getCellValue(project.id, dateKey);
|
|
728
|
-
const isDirty = dirty[project.id]?.[dateKey] !== void 0;
|
|
729
|
-
const cellError = cellErrors[project.id]?.[dateKey];
|
|
730
|
-
const cellErrorMessage = cellError ? describeDurationError(cellError) : void 0;
|
|
731
|
-
const cellErrorId = cellErrorMessage ? buildDurationErrorId(project.id, dateKey) : void 0;
|
|
732
|
-
return /* @__PURE__ */ jsxs("td", { className: `px-0.5 py-0.5 ${weekend ? "bg-muted/40" : ""}`, children: [
|
|
733
|
-
weekend ? /* @__PURE__ */ jsx("div", { className: "rounded px-1 py-1 text-center text-xs text-muted-foreground/50", children: "-" }) : /* @__PURE__ */ jsx(
|
|
734
|
-
InlineInput,
|
|
735
|
-
{
|
|
736
|
-
type: "text",
|
|
737
|
-
inputMode: "text",
|
|
738
|
-
showBorderOnHover: false,
|
|
739
|
-
className: `mx-auto flex h-6 border transition-colors
|
|
740
|
-
${viewMode === "weekly" ? "w-12 px-1" : "w-8 px-0"}
|
|
741
|
-
${cellError ? "bg-status-error-bg" : isDirty ? "border-status-warning-border bg-status-warning-bg" : "border-muted-foreground/20 bg-transparent hover:border-muted-foreground/40"}`,
|
|
742
|
-
inputClassName: `text-center text-xs tabular-nums
|
|
743
|
-
${cellError ? "text-status-error-text" : cellMinutes > 0 ? "font-semibold" : "text-muted-foreground"}`,
|
|
744
|
-
value: rawText[project.id]?.[dateKey] ?? formatMinutesAsDecimal(cellMinutes),
|
|
745
|
-
onChange: (e) => handleCellChange(project.id, dateKey, e.target.value),
|
|
746
|
-
onBlur: (event) => handleCellBlur(project.id, dateKey, event.currentTarget.value),
|
|
747
|
-
placeholder: t("staff.timesheets.my.durationPlaceholder", "0"),
|
|
748
|
-
"aria-invalid": cellError !== void 0,
|
|
749
|
-
"aria-label": describeDurationCell(project.name, date),
|
|
750
|
-
"aria-describedby": [durationHintId, cellErrorId].filter(Boolean).join(" "),
|
|
751
|
-
title: cellErrorMessage ?? durationFormatHint
|
|
752
|
-
}
|
|
753
|
-
),
|
|
754
|
-
cellErrorMessage ? /* @__PURE__ */ jsx("span", { id: cellErrorId, role: "alert", className: "sr-only", children: cellErrorMessage }) : null
|
|
755
|
-
] }, dateKey);
|
|
756
|
-
}),
|
|
757
|
-
/* @__PURE__ */ jsx("td", { className: "px-3 py-1.5 text-right font-semibold text-xs tabular-nums", children: formatMinutesAsDecimal(getRowTotal(project.id)) || "0" })
|
|
758
|
-
] }, project.id)),
|
|
759
|
-
/* @__PURE__ */ jsx("tr", { className: "border-b", children: /* @__PURE__ */ jsx("td", { colSpan: visibleDays.length + 2, className: "sticky left-0 bg-background px-1 py-0.5", children: /* @__PURE__ */ jsx(
|
|
760
|
-
AddRowDropdown,
|
|
761
|
-
{
|
|
762
|
-
assignedProjects: allAssignedProjects,
|
|
763
|
-
visibleProjectIds,
|
|
764
|
-
canCreateProject: canManageProjects,
|
|
765
|
-
onAddProject: handleAddProject,
|
|
766
|
-
onCreateProject: () => setCreateDialogOpen(true)
|
|
767
|
-
}
|
|
768
|
-
) }) })
|
|
769
|
-
] }),
|
|
770
|
-
/* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsxs("tr", { className: "border-t bg-muted/50 font-semibold", children: [
|
|
771
|
-
/* @__PURE__ */ jsx("td", { className: "sticky left-0 z-10 bg-muted px-3 py-2", children: t("staff.timesheets.my.daily_total", "Daily Total") }),
|
|
772
|
-
visibleDays.map((date) => {
|
|
773
|
-
const weekend = isWeekendDay(date);
|
|
774
|
-
const dayMinutes = getDayTotal(date);
|
|
775
|
-
return /* @__PURE__ */ jsx("td", { className: `py-2 text-center text-xs tabular-nums ${weekend ? "text-muted-foreground/50" : ""}`, children: weekend ? "-" : formatMinutesAsDecimal(dayMinutes) || "-" }, formatDateKey(date));
|
|
776
|
-
}),
|
|
777
|
-
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-right tabular-nums font-semibold", children: formatMinutesAsDecimal(grandTotal) || "0" })
|
|
778
|
-
] }) })
|
|
779
|
-
] }),
|
|
780
|
-
/* @__PURE__ */ jsx("p", { id: durationHintId, className: "px-3 py-2 text-xs text-muted-foreground", children: durationFormatHint })
|
|
781
|
-
] }) })
|
|
782
|
-
] }),
|
|
783
|
-
ConfirmDialogElement,
|
|
784
|
-
/* @__PURE__ */ jsx(
|
|
785
|
-
CreateProjectDialog,
|
|
786
|
-
{
|
|
787
|
-
open: createDialogOpen,
|
|
788
|
-
onOpenChange: setCreateDialogOpen,
|
|
789
|
-
onProjectCreated: handleProjectCreated
|
|
790
|
-
}
|
|
791
|
-
)
|
|
792
|
-
] });
|
|
1
|
+
import { permanentRedirect } from "next/navigation";
|
|
2
|
+
function TimesheetsLegacyRedirectPage() {
|
|
3
|
+
permanentRedirect("/backend/staff/time-tracking/timesheet");
|
|
793
4
|
}
|
|
794
5
|
export {
|
|
795
|
-
|
|
6
|
+
TimesheetsLegacyRedirectPage as default
|
|
796
7
|
};
|
|
797
8
|
//# sourceMappingURL=page.js.map
|