@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
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { registerComponent } from "@open-mercato/shared/modules/widgets/component-registry";
|
|
6
|
+
import { useRegisteredComponent } from "@open-mercato/ui/backend/injection/useRegisteredComponent";
|
|
7
|
+
import { extensionPoints } from "@open-mercato/core/modules/staff/extension-points";
|
|
8
|
+
import {
|
|
9
|
+
callbackProp,
|
|
10
|
+
opaqueProp
|
|
11
|
+
} from "../../../../lib/time-tracking/componentContracts.js";
|
|
12
|
+
import { Lock, X } from "lucide-react";
|
|
13
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
14
|
+
import { SegmentedControl, SegmentedControlItem } from "@open-mercato/ui/primitives/segmented-control";
|
|
15
|
+
import {
|
|
16
|
+
Select,
|
|
17
|
+
SelectContent,
|
|
18
|
+
SelectItem,
|
|
19
|
+
SelectTrigger,
|
|
20
|
+
SelectValue
|
|
21
|
+
} from "@open-mercato/ui/primitives/select";
|
|
22
|
+
import { apiCallOrThrow, withScopedApiRequestHeaders } from "@open-mercato/ui/backend/utils/apiCall";
|
|
23
|
+
import { createCrud, deleteCrud, updateCrud } from "@open-mercato/ui/backend/utils/crud";
|
|
24
|
+
import { useGuardedMutation } from "@open-mercato/ui/backend/injection/useGuardedMutation";
|
|
25
|
+
import { useConfirmDialog } from "@open-mercato/ui/backend/confirm-dialog";
|
|
26
|
+
import { flash } from "@open-mercato/ui/backend/FlashMessages";
|
|
27
|
+
import { surfaceRecordConflict } from "@open-mercato/ui/backend/conflicts";
|
|
28
|
+
import { buildOptimisticLockHeader } from "@open-mercato/ui/backend/utils/optimisticLock";
|
|
29
|
+
import { cn } from "@open-mercato/shared/lib/utils";
|
|
30
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
31
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
32
|
+
import { AddRowDropdown } from "../../../../lib/timesheets-ui/AddRowDropdown.js";
|
|
33
|
+
import { ProjectColorDot } from "../../../../lib/timesheets-ui/ProjectColorDot.js";
|
|
34
|
+
import { DurationInput, formatTrimmedDecimalDuration } from "../../../../lib/time-tracking-ui/DurationInput.js";
|
|
35
|
+
import { readErrorCode, isEntryLockedError } from "../../../../lib/time-tracking-ui/timeEntryListData.js";
|
|
36
|
+
import { isWeekendIso, parseIsoDay } from "../../../../lib/time-tracking-ui/timesheetPeriod.js";
|
|
37
|
+
import {
|
|
38
|
+
buildTargetKey,
|
|
39
|
+
targetLabel
|
|
40
|
+
} from "../../../../lib/time-tracking-ui/timesheetTargets.js";
|
|
41
|
+
const logger = createLogger("staff").child({ component: "time-tracking/timesheet/grid" });
|
|
42
|
+
const SKELETON_ROW_COUNT = 4;
|
|
43
|
+
const ENTRIES_API_PATH = "staff/timesheets/time-entries";
|
|
44
|
+
const BULK_ENDPOINT = "/api/staff/timesheets/time-entries/bulk";
|
|
45
|
+
const RESOURCE_KIND = "staff.timesheets.time_entry";
|
|
46
|
+
function cellKey(rowKey, date) {
|
|
47
|
+
return `${rowKey}|${date}`;
|
|
48
|
+
}
|
|
49
|
+
function dayHeaderParts(date, locale) {
|
|
50
|
+
const parsed = parseIsoDay(date);
|
|
51
|
+
if (!parsed) return { weekday: "", dayOfMonth: date };
|
|
52
|
+
let weekday = "";
|
|
53
|
+
try {
|
|
54
|
+
weekday = new Intl.DateTimeFormat(locale, { weekday: "short" }).format(parsed);
|
|
55
|
+
} catch {
|
|
56
|
+
weekday = "";
|
|
57
|
+
}
|
|
58
|
+
return { weekday, dayOfMonth: String(parsed.getDate()) };
|
|
59
|
+
}
|
|
60
|
+
function buildGridRows(projects, tasks, entries, rowMode, extraTaskKeys) {
|
|
61
|
+
if (rowMode === "projects") {
|
|
62
|
+
return projects.map((project) => ({
|
|
63
|
+
key: buildTargetKey(project.id, null),
|
|
64
|
+
timeProjectId: project.id,
|
|
65
|
+
taskId: null,
|
|
66
|
+
projectName: project.name,
|
|
67
|
+
projectCode: project.code,
|
|
68
|
+
projectColor: project.color,
|
|
69
|
+
taskTitle: null,
|
|
70
|
+
removable: true
|
|
71
|
+
}));
|
|
72
|
+
}
|
|
73
|
+
const tasksById = new Map(tasks.map((task) => [task.id, task]));
|
|
74
|
+
const usedTaskIds = /* @__PURE__ */ new Map();
|
|
75
|
+
for (const entry of entries) {
|
|
76
|
+
if (!entry.taskId || !entry.timeProjectId) continue;
|
|
77
|
+
const bucket = usedTaskIds.get(entry.timeProjectId) ?? /* @__PURE__ */ new Set();
|
|
78
|
+
bucket.add(entry.taskId);
|
|
79
|
+
usedTaskIds.set(entry.timeProjectId, bucket);
|
|
80
|
+
}
|
|
81
|
+
for (const key of extraTaskKeys) {
|
|
82
|
+
const separator = key.indexOf(":");
|
|
83
|
+
if (separator < 0) continue;
|
|
84
|
+
const projectId = key.slice(0, separator);
|
|
85
|
+
const taskId = key.slice(separator + 1);
|
|
86
|
+
const bucket = usedTaskIds.get(projectId) ?? /* @__PURE__ */ new Set();
|
|
87
|
+
bucket.add(taskId);
|
|
88
|
+
usedTaskIds.set(projectId, bucket);
|
|
89
|
+
}
|
|
90
|
+
const rows = [];
|
|
91
|
+
for (const project of projects) {
|
|
92
|
+
rows.push({
|
|
93
|
+
key: buildTargetKey(project.id, null),
|
|
94
|
+
timeProjectId: project.id,
|
|
95
|
+
taskId: null,
|
|
96
|
+
projectName: project.name,
|
|
97
|
+
projectCode: project.code,
|
|
98
|
+
projectColor: project.color,
|
|
99
|
+
taskTitle: null,
|
|
100
|
+
removable: true
|
|
101
|
+
});
|
|
102
|
+
const taskIds = Array.from(usedTaskIds.get(project.id) ?? []);
|
|
103
|
+
const named = taskIds.map((taskId) => ({ taskId, title: tasksById.get(taskId)?.title ?? null })).sort((left, right) => (left.title ?? "").localeCompare(right.title ?? ""));
|
|
104
|
+
for (const task of named) {
|
|
105
|
+
rows.push({
|
|
106
|
+
key: buildTargetKey(project.id, task.taskId),
|
|
107
|
+
timeProjectId: project.id,
|
|
108
|
+
taskId: task.taskId,
|
|
109
|
+
projectName: project.name,
|
|
110
|
+
projectCode: project.code,
|
|
111
|
+
projectColor: project.color,
|
|
112
|
+
taskTitle: task.title,
|
|
113
|
+
removable: false
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return rows;
|
|
118
|
+
}
|
|
119
|
+
function buildGridCells(entries, rowMode) {
|
|
120
|
+
const cells = /* @__PURE__ */ new Map();
|
|
121
|
+
for (const entry of entries) {
|
|
122
|
+
if (!entry.timeProjectId) continue;
|
|
123
|
+
const rowKey = rowMode === "projects" ? buildTargetKey(entry.timeProjectId, null) : buildTargetKey(entry.timeProjectId, entry.taskId);
|
|
124
|
+
const key = cellKey(rowKey, entry.date);
|
|
125
|
+
const current = cells.get(key) ?? { minutes: 0, entryIds: [], lockedEntryIds: [], entryVersions: {} };
|
|
126
|
+
current.minutes += Number.isFinite(entry.durationMinutes) ? entry.durationMinutes : 0;
|
|
127
|
+
current.entryIds.push(entry.id);
|
|
128
|
+
current.entryVersions[entry.id] = entry.updatedAt;
|
|
129
|
+
if (entry.isLocked) current.lockedEntryIds.push(entry.id);
|
|
130
|
+
cells.set(key, current);
|
|
131
|
+
}
|
|
132
|
+
return cells;
|
|
133
|
+
}
|
|
134
|
+
function DefaultGridView({
|
|
135
|
+
days,
|
|
136
|
+
projects,
|
|
137
|
+
allAssignedProjects,
|
|
138
|
+
tasks,
|
|
139
|
+
entries,
|
|
140
|
+
staffMemberId,
|
|
141
|
+
canManage,
|
|
142
|
+
canManageProjects,
|
|
143
|
+
readOnly,
|
|
144
|
+
isLoading = false,
|
|
145
|
+
rowMode,
|
|
146
|
+
onRowModeChange,
|
|
147
|
+
onAddProject,
|
|
148
|
+
onRemoveProject,
|
|
149
|
+
onCreateProject,
|
|
150
|
+
onSaved
|
|
151
|
+
}) {
|
|
152
|
+
const t = useT();
|
|
153
|
+
const { confirm, ConfirmDialogElement } = useConfirmDialog();
|
|
154
|
+
const [dirty, setDirty] = React.useState({});
|
|
155
|
+
const [invalidCells, setInvalidCells] = React.useState({});
|
|
156
|
+
const [extraLockedEntryIds, setExtraLockedEntryIds] = React.useState({});
|
|
157
|
+
const [extraTaskKeys, setExtraTaskKeys] = React.useState(() => /* @__PURE__ */ new Set());
|
|
158
|
+
const [isSaving, setIsSaving] = React.useState(false);
|
|
159
|
+
const mutationContextId = staffMemberId ? `staff-timesheets:${staffMemberId}` : "staff-timesheets:pending";
|
|
160
|
+
const { runMutation, retryLastMutation } = useGuardedMutation({
|
|
161
|
+
contextId: mutationContextId,
|
|
162
|
+
blockedMessage: t("ui.forms.flash.saveBlocked", "Save blocked by validation")
|
|
163
|
+
});
|
|
164
|
+
const mutationContext = React.useCallback(
|
|
165
|
+
(resourceId) => ({
|
|
166
|
+
formId: mutationContextId,
|
|
167
|
+
resourceKind: RESOURCE_KIND,
|
|
168
|
+
resourceId,
|
|
169
|
+
staffMemberId,
|
|
170
|
+
retryLastMutation
|
|
171
|
+
}),
|
|
172
|
+
[mutationContextId, retryLastMutation, staffMemberId]
|
|
173
|
+
);
|
|
174
|
+
const rows = React.useMemo(
|
|
175
|
+
() => buildGridRows(projects, tasks, entries, rowMode, extraTaskKeys),
|
|
176
|
+
[entries, extraTaskKeys, projects, rowMode, tasks]
|
|
177
|
+
);
|
|
178
|
+
const cells = React.useMemo(() => buildGridCells(entries, rowMode), [entries, rowMode]);
|
|
179
|
+
const rowsByKey = React.useMemo(() => new Map(rows.map((row) => [row.key, row])), [rows]);
|
|
180
|
+
const resetToken = `${rowMode}|${days[0] ?? ""}|${days[days.length - 1] ?? ""}|${staffMemberId ?? ""}`;
|
|
181
|
+
const resetTokenRef = React.useRef(resetToken);
|
|
182
|
+
React.useEffect(() => {
|
|
183
|
+
if (resetTokenRef.current === resetToken) return;
|
|
184
|
+
resetTokenRef.current = resetToken;
|
|
185
|
+
setDirty({});
|
|
186
|
+
setInvalidCells({});
|
|
187
|
+
}, [resetToken]);
|
|
188
|
+
const isCellLocked = React.useCallback(
|
|
189
|
+
(key) => {
|
|
190
|
+
const cell = cells.get(key);
|
|
191
|
+
if (!cell) return false;
|
|
192
|
+
if (cell.lockedEntryIds.length > 0) return true;
|
|
193
|
+
return cell.entryIds.some((id) => extraLockedEntryIds[id]);
|
|
194
|
+
},
|
|
195
|
+
[cells, extraLockedEntryIds]
|
|
196
|
+
);
|
|
197
|
+
const cellMinutes = React.useCallback(
|
|
198
|
+
(key) => {
|
|
199
|
+
const pending = dirty[key];
|
|
200
|
+
if (pending) return pending.minutes;
|
|
201
|
+
return cells.get(key)?.minutes ?? 0;
|
|
202
|
+
},
|
|
203
|
+
[cells, dirty]
|
|
204
|
+
);
|
|
205
|
+
const handleCellChange = React.useCallback(
|
|
206
|
+
(row, date, minutes, invalid) => {
|
|
207
|
+
const key = cellKey(row.key, date);
|
|
208
|
+
setInvalidCells((current) => {
|
|
209
|
+
if (invalid === Boolean(current[key])) return current;
|
|
210
|
+
const next = { ...current };
|
|
211
|
+
if (invalid) next[key] = true;
|
|
212
|
+
else delete next[key];
|
|
213
|
+
return next;
|
|
214
|
+
});
|
|
215
|
+
if (invalid) return;
|
|
216
|
+
const nextMinutes = minutes ?? 0;
|
|
217
|
+
const stored = cells.get(key);
|
|
218
|
+
const storedMinutes = stored?.minutes ?? 0;
|
|
219
|
+
const hadEntries = (stored?.entryIds.length ?? 0) > 0;
|
|
220
|
+
setDirty((current) => {
|
|
221
|
+
const next = { ...current };
|
|
222
|
+
if (nextMinutes === storedMinutes && !hadEntries) {
|
|
223
|
+
delete next[key];
|
|
224
|
+
return next;
|
|
225
|
+
}
|
|
226
|
+
next[key] = { rowKey: row.key, date, minutes: nextMinutes };
|
|
227
|
+
return next;
|
|
228
|
+
});
|
|
229
|
+
},
|
|
230
|
+
[cells]
|
|
231
|
+
);
|
|
232
|
+
const rowTotal = React.useCallback(
|
|
233
|
+
(rowKey) => days.reduce((sum, date) => sum + cellMinutes(cellKey(rowKey, date)), 0),
|
|
234
|
+
[cellMinutes, days]
|
|
235
|
+
);
|
|
236
|
+
const dayTotal = React.useCallback(
|
|
237
|
+
(date) => rows.reduce((sum, row) => sum + cellMinutes(cellKey(row.key, date)), 0),
|
|
238
|
+
[cellMinutes, rows]
|
|
239
|
+
);
|
|
240
|
+
const grandTotal = React.useMemo(
|
|
241
|
+
() => rows.reduce((sum, row) => sum + rowTotal(row.key), 0),
|
|
242
|
+
[rowTotal, rows]
|
|
243
|
+
);
|
|
244
|
+
const dirtyCount = Object.keys(dirty).length;
|
|
245
|
+
const invalidCount = Object.keys(invalidCells).length;
|
|
246
|
+
const hasChanges = dirtyCount > 0;
|
|
247
|
+
const dense = days.length > 10;
|
|
248
|
+
const markLockedFromError = React.useCallback((error) => {
|
|
249
|
+
const body = error?.body;
|
|
250
|
+
const direct = error?.lockedEntryIds;
|
|
251
|
+
const ids = Array.isArray(body?.lockedEntryIds) ? body?.lockedEntryIds : Array.isArray(direct) ? direct : [];
|
|
252
|
+
const marked = ids.filter((id) => typeof id === "string");
|
|
253
|
+
if (marked.length === 0) return false;
|
|
254
|
+
setExtraLockedEntryIds((current) => {
|
|
255
|
+
const next = { ...current };
|
|
256
|
+
for (const id of marked) next[id] = true;
|
|
257
|
+
return next;
|
|
258
|
+
});
|
|
259
|
+
return true;
|
|
260
|
+
}, []);
|
|
261
|
+
const reportSaveFailure = React.useCallback(
|
|
262
|
+
(error) => {
|
|
263
|
+
if (surfaceRecordConflict(error, t)) return;
|
|
264
|
+
if (isEntryLockedError(error)) {
|
|
265
|
+
markLockedFromError(error);
|
|
266
|
+
flash(
|
|
267
|
+
t(
|
|
268
|
+
"staff.time_tracking.timesheet.grid.errors.locked",
|
|
269
|
+
"Some of these cells belong to a closed report and cannot be changed. They are now marked as locked."
|
|
270
|
+
),
|
|
271
|
+
"error"
|
|
272
|
+
);
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
logger.error("staff.time_tracking.timesheet.grid save failed", { err: error, code: readErrorCode(error) });
|
|
276
|
+
flash(t("staff.timesheets.my.errors.save", "Failed to save timesheets."), "error");
|
|
277
|
+
},
|
|
278
|
+
[markLockedFromError, t]
|
|
279
|
+
);
|
|
280
|
+
const saveTaskCells = React.useCallback(
|
|
281
|
+
async (changes) => {
|
|
282
|
+
for (const { row, cell } of changes) {
|
|
283
|
+
const key = cellKey(row.key, cell.date);
|
|
284
|
+
const storedCell = cells.get(key);
|
|
285
|
+
const existingId = storedCell?.entryIds[0] ?? null;
|
|
286
|
+
const existingVersion = existingId ? storedCell?.entryVersions[existingId] ?? null : null;
|
|
287
|
+
const errorMessage = t("staff.timesheets.my.errors.save", "Failed to save timesheets.");
|
|
288
|
+
if (existingId && cell.minutes <= 0) {
|
|
289
|
+
await runMutation({
|
|
290
|
+
operation: () => withScopedApiRequestHeaders(
|
|
291
|
+
buildOptimisticLockHeader(existingVersion),
|
|
292
|
+
() => deleteCrud(ENTRIES_API_PATH, existingId, { errorMessage })
|
|
293
|
+
),
|
|
294
|
+
context: mutationContext(existingId),
|
|
295
|
+
mutationPayload: { id: existingId }
|
|
296
|
+
});
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
if (cell.minutes <= 0) continue;
|
|
300
|
+
if (existingId) {
|
|
301
|
+
const payload2 = { id: existingId, durationMinutes: cell.minutes };
|
|
302
|
+
await runMutation({
|
|
303
|
+
operation: () => withScopedApiRequestHeaders(
|
|
304
|
+
buildOptimisticLockHeader(existingVersion),
|
|
305
|
+
() => updateCrud(ENTRIES_API_PATH, payload2, { errorMessage })
|
|
306
|
+
),
|
|
307
|
+
context: mutationContext(existingId),
|
|
308
|
+
mutationPayload: payload2
|
|
309
|
+
});
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
const payload = {
|
|
313
|
+
staffMemberId,
|
|
314
|
+
date: cell.date,
|
|
315
|
+
timeProjectId: row.timeProjectId,
|
|
316
|
+
taskId: row.taskId,
|
|
317
|
+
durationMinutes: cell.minutes,
|
|
318
|
+
source: "manual"
|
|
319
|
+
};
|
|
320
|
+
await runMutation({
|
|
321
|
+
operation: () => createCrud(ENTRIES_API_PATH, payload, { errorMessage }),
|
|
322
|
+
context: mutationContext(),
|
|
323
|
+
mutationPayload: payload
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
[cells, mutationContext, runMutation, staffMemberId, t]
|
|
328
|
+
);
|
|
329
|
+
const handleSave = React.useCallback(async () => {
|
|
330
|
+
if (!hasChanges || invalidCount > 0) return;
|
|
331
|
+
const confirmed = await confirm({
|
|
332
|
+
title: t("staff.timesheets.my.confirm_save.title", "Save changes?"),
|
|
333
|
+
text: t("staff.timesheets.my.confirm_save.body", "Your timesheet entries will be saved.")
|
|
334
|
+
});
|
|
335
|
+
if (!confirmed) return;
|
|
336
|
+
const bulkEntries = [];
|
|
337
|
+
const taskChanges = [];
|
|
338
|
+
for (const cell of Object.values(dirty)) {
|
|
339
|
+
const row = rowsByKey.get(cell.rowKey);
|
|
340
|
+
if (!row) continue;
|
|
341
|
+
if (row.taskId) {
|
|
342
|
+
taskChanges.push({ row, cell });
|
|
343
|
+
continue;
|
|
344
|
+
}
|
|
345
|
+
const key = cellKey(row.key, cell.date);
|
|
346
|
+
bulkEntries.push({
|
|
347
|
+
id: cells.get(key)?.entryIds[0],
|
|
348
|
+
date: cell.date,
|
|
349
|
+
timeProjectId: row.timeProjectId,
|
|
350
|
+
durationMinutes: cell.minutes
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
if (bulkEntries.length === 0 && taskChanges.length === 0) return;
|
|
354
|
+
setIsSaving(true);
|
|
355
|
+
try {
|
|
356
|
+
if (bulkEntries.length > 0) {
|
|
357
|
+
const payload = { entries: bulkEntries };
|
|
358
|
+
await runMutation({
|
|
359
|
+
operation: () => apiCallOrThrow(BULK_ENDPOINT, {
|
|
360
|
+
method: "POST",
|
|
361
|
+
headers: { "Content-Type": "application/json" },
|
|
362
|
+
body: JSON.stringify(payload)
|
|
363
|
+
}),
|
|
364
|
+
context: mutationContext(staffMemberId ?? void 0),
|
|
365
|
+
mutationPayload: payload
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
if (taskChanges.length > 0) await saveTaskCells(taskChanges);
|
|
369
|
+
setDirty({});
|
|
370
|
+
flash(t("staff.timesheets.my.saved", "Timesheet saved."), "success");
|
|
371
|
+
await onSaved();
|
|
372
|
+
} catch (error) {
|
|
373
|
+
reportSaveFailure(error);
|
|
374
|
+
} finally {
|
|
375
|
+
setIsSaving(false);
|
|
376
|
+
}
|
|
377
|
+
}, [
|
|
378
|
+
cells,
|
|
379
|
+
confirm,
|
|
380
|
+
dirty,
|
|
381
|
+
hasChanges,
|
|
382
|
+
invalidCount,
|
|
383
|
+
mutationContext,
|
|
384
|
+
onSaved,
|
|
385
|
+
reportSaveFailure,
|
|
386
|
+
rowsByKey,
|
|
387
|
+
runMutation,
|
|
388
|
+
saveTaskCells,
|
|
389
|
+
staffMemberId,
|
|
390
|
+
t
|
|
391
|
+
]);
|
|
392
|
+
const taskRowOptions = React.useMemo(() => {
|
|
393
|
+
const visibleProjectIds = new Set(projects.map((project) => project.id));
|
|
394
|
+
const existing = new Set(rows.map((row) => row.key));
|
|
395
|
+
return tasks.filter((task) => visibleProjectIds.has(task.timeProjectId)).map((task) => {
|
|
396
|
+
const project = projects.find((candidate) => candidate.id === task.timeProjectId);
|
|
397
|
+
return {
|
|
398
|
+
key: buildTargetKey(task.timeProjectId, task.id),
|
|
399
|
+
label: targetLabel({
|
|
400
|
+
key: buildTargetKey(task.timeProjectId, task.id),
|
|
401
|
+
timeProjectId: task.timeProjectId,
|
|
402
|
+
taskId: task.id,
|
|
403
|
+
projectName: project.name,
|
|
404
|
+
projectCode: project.code,
|
|
405
|
+
projectColor: project.color,
|
|
406
|
+
taskTitle: task.title
|
|
407
|
+
})
|
|
408
|
+
};
|
|
409
|
+
}).filter((option) => !existing.has(option.key));
|
|
410
|
+
}, [projects, rows, tasks]);
|
|
411
|
+
const editable = canManage && !readOnly;
|
|
412
|
+
const loadingLabel = t("staff.time_tracking.timesheet.grid.loading", "Loading the timesheet grid\u2026");
|
|
413
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
|
|
414
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
|
|
415
|
+
/* @__PURE__ */ jsxs(
|
|
416
|
+
SegmentedControl,
|
|
417
|
+
{
|
|
418
|
+
value: rowMode,
|
|
419
|
+
onValueChange: (value) => {
|
|
420
|
+
if (value !== rowMode) onRowModeChange(value);
|
|
421
|
+
},
|
|
422
|
+
size: "sm",
|
|
423
|
+
"aria-label": t("staff.time_tracking.timesheet.grid.rowMode.label", "Grid rows"),
|
|
424
|
+
children: [
|
|
425
|
+
/* @__PURE__ */ jsx(SegmentedControlItem, { value: "projects", children: t("staff.time_tracking.timesheet.grid.rowMode.projects", "Projects") }),
|
|
426
|
+
/* @__PURE__ */ jsx(SegmentedControlItem, { value: "tasks", children: t("staff.time_tracking.timesheet.grid.rowMode.tasks", "Projects + tasks") })
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
),
|
|
430
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
431
|
+
invalidCount > 0 ? /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-status-error-text", children: t("staff.time_tracking.timesheet.grid.invalid", "Fix the highlighted cell before saving.") }) : hasChanges ? /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-status-warning-text", children: t("staff.timesheets.my.unsaved", "Unsaved changes") }) : null,
|
|
432
|
+
editable ? /* @__PURE__ */ jsx(
|
|
433
|
+
Button,
|
|
434
|
+
{
|
|
435
|
+
size: "sm",
|
|
436
|
+
type: "button",
|
|
437
|
+
onClick: () => void handleSave(),
|
|
438
|
+
disabled: !hasChanges || invalidCount > 0 || isSaving,
|
|
439
|
+
children: isSaving ? t("staff.timesheets.my.saving", "Saving...") : t("staff.timesheets.my.save_changes", "Save Changes")
|
|
440
|
+
}
|
|
441
|
+
) : null
|
|
442
|
+
] })
|
|
443
|
+
] }),
|
|
444
|
+
rowMode === "tasks" && editable && taskRowOptions.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs(
|
|
445
|
+
Select,
|
|
446
|
+
{
|
|
447
|
+
value: "",
|
|
448
|
+
onValueChange: (value) => setExtraTaskKeys((current) => new Set(current).add(value)),
|
|
449
|
+
children: [
|
|
450
|
+
/* @__PURE__ */ jsx(
|
|
451
|
+
SelectTrigger,
|
|
452
|
+
{
|
|
453
|
+
className: "w-72",
|
|
454
|
+
"aria-label": t("staff.time_tracking.timesheet.grid.addTaskRow", "Add a task row"),
|
|
455
|
+
children: /* @__PURE__ */ jsx(SelectValue, { placeholder: t("staff.time_tracking.timesheet.grid.addTaskRow", "Add a task row") })
|
|
456
|
+
}
|
|
457
|
+
),
|
|
458
|
+
/* @__PURE__ */ jsx(SelectContent, { children: taskRowOptions.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.key, children: option.label }, option.key)) })
|
|
459
|
+
]
|
|
460
|
+
}
|
|
461
|
+
) }) : null,
|
|
462
|
+
/* @__PURE__ */ jsx("div", { className: "overflow-x-auto rounded-lg border", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm table-fixed", "aria-busy": isLoading || void 0, children: [
|
|
463
|
+
/* @__PURE__ */ jsx("caption", { className: "sr-only", children: t(
|
|
464
|
+
"staff.time_tracking.timesheet.grid.caption",
|
|
465
|
+
"Timesheet grid: one row per project or task, one column per day of the period."
|
|
466
|
+
) }),
|
|
467
|
+
/* @__PURE__ */ jsxs("colgroup", { children: [
|
|
468
|
+
/* @__PURE__ */ jsx("col", { className: dense ? "w-[140px] min-w-[140px]" : "w-[35%]" }),
|
|
469
|
+
days.map((date) => /* @__PURE__ */ jsx("col", { className: dense ? "w-[36px] min-w-[36px]" : "" }, date)),
|
|
470
|
+
/* @__PURE__ */ jsx("col", { className: dense ? "w-[56px] min-w-[56px]" : "w-[72px]" })
|
|
471
|
+
] }),
|
|
472
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b bg-muted/50", children: [
|
|
473
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "sticky left-0 z-10 bg-muted px-3 py-2 text-left font-medium", children: t("staff.timesheets.my.project", "Project") }),
|
|
474
|
+
days.map((date) => {
|
|
475
|
+
const { weekday, dayOfMonth } = dayHeaderParts(date);
|
|
476
|
+
const weekend = isWeekendIso(date);
|
|
477
|
+
const weekendLabel = t("staff.time_tracking.timesheet.grid.weekend", "Weekend day");
|
|
478
|
+
return /* @__PURE__ */ jsxs(
|
|
479
|
+
"th",
|
|
480
|
+
{
|
|
481
|
+
scope: "col",
|
|
482
|
+
title: weekend ? `${date} \xB7 ${weekendLabel}` : date,
|
|
483
|
+
className: cn(
|
|
484
|
+
"py-2 text-center font-medium px-1",
|
|
485
|
+
weekend ? "bg-muted/80 text-muted-foreground" : null
|
|
486
|
+
),
|
|
487
|
+
children: [
|
|
488
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs uppercase text-muted-foreground", children: weekday }),
|
|
489
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs", children: dayOfMonth }),
|
|
490
|
+
weekend ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: weekendLabel }) : null
|
|
491
|
+
]
|
|
492
|
+
},
|
|
493
|
+
date
|
|
494
|
+
);
|
|
495
|
+
}),
|
|
496
|
+
/* @__PURE__ */ jsx("th", { scope: "col", className: "px-3 py-2 text-right font-medium", children: t("staff.timesheets.my.total", "Total") })
|
|
497
|
+
] }) }),
|
|
498
|
+
/* @__PURE__ */ jsxs("tbody", { children: [
|
|
499
|
+
isLoading ? Array.from({ length: SKELETON_ROW_COUNT }).map((_, index) => /* @__PURE__ */ jsxs("tr", { "data-testid": "grid-skeleton-row", className: "border-b", children: [
|
|
500
|
+
/* @__PURE__ */ jsxs("th", { scope: "row", className: "sticky left-0 z-10 bg-background px-3 py-1.5 text-left font-medium", children: [
|
|
501
|
+
index === 0 ? /* @__PURE__ */ jsx("span", { className: "sr-only", children: loadingLabel }) : null,
|
|
502
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "block h-4 w-32 animate-pulse rounded bg-muted" })
|
|
503
|
+
] }),
|
|
504
|
+
days.map((date) => /* @__PURE__ */ jsx("td", { className: "px-0.5 py-0.5", children: /* @__PURE__ */ jsx(
|
|
505
|
+
"span",
|
|
506
|
+
{
|
|
507
|
+
"aria-hidden": "true",
|
|
508
|
+
className: cn("mx-auto block h-6 animate-pulse rounded bg-muted", dense ? "w-10" : "w-16")
|
|
509
|
+
}
|
|
510
|
+
) }, date)),
|
|
511
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-1.5", children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "ml-auto block h-4 w-8 animate-pulse rounded bg-muted" }) })
|
|
512
|
+
] }, `grid-skeleton-${index}`)) : null,
|
|
513
|
+
!isLoading && rows.length === 0 ? /* @__PURE__ */ jsx("tr", { "data-testid": "grid-empty-row", className: "border-b", children: /* @__PURE__ */ jsxs("td", { colSpan: days.length + 2, className: "px-3 py-10 text-center", children: [
|
|
514
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: t("staff.time_tracking.timesheet.grid.empty.title", "This grid has no rows yet") }),
|
|
515
|
+
/* @__PURE__ */ jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: t(
|
|
516
|
+
"staff.time_tracking.timesheet.grid.noRows",
|
|
517
|
+
"Add a project row to start filling the grid."
|
|
518
|
+
) })
|
|
519
|
+
] }) }) : null,
|
|
520
|
+
isLoading ? null : rows.map((row) => /* @__PURE__ */ jsxs("tr", { className: "group border-b hover:bg-muted/30", children: [
|
|
521
|
+
/* @__PURE__ */ jsx(
|
|
522
|
+
"th",
|
|
523
|
+
{
|
|
524
|
+
scope: "row",
|
|
525
|
+
className: cn(
|
|
526
|
+
"sticky left-0 z-10 bg-background px-3 py-1.5 text-left font-medium text-foreground",
|
|
527
|
+
row.taskId ? "pl-6" : null
|
|
528
|
+
),
|
|
529
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
530
|
+
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
531
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 truncate", title: targetLabel(row), children: [
|
|
532
|
+
row.taskId ? null : /* @__PURE__ */ jsx(ProjectColorDot, { colorKey: row.projectColor, projectName: row.projectName, size: "sm" }),
|
|
533
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: row.taskId ? row.taskTitle ?? targetLabel(row) : row.projectName })
|
|
534
|
+
] }),
|
|
535
|
+
row.taskId ? /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground truncate", children: row.projectName }) : row.projectCode ? /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: row.projectCode }) : null
|
|
536
|
+
] }),
|
|
537
|
+
row.removable && editable ? /* @__PURE__ */ jsx(
|
|
538
|
+
"button",
|
|
539
|
+
{
|
|
540
|
+
type: "button",
|
|
541
|
+
onClick: () => {
|
|
542
|
+
const project = projects.find((candidate) => candidate.id === row.timeProjectId);
|
|
543
|
+
if (!project) return;
|
|
544
|
+
setInvalidCells((current) => {
|
|
545
|
+
const prefix = cellKey(row.key, "");
|
|
546
|
+
const next = Object.fromEntries(
|
|
547
|
+
Object.entries(current).filter(([key]) => !key.startsWith(prefix))
|
|
548
|
+
);
|
|
549
|
+
return Object.keys(next).length === Object.keys(current).length ? current : next;
|
|
550
|
+
});
|
|
551
|
+
setDirty((current) => {
|
|
552
|
+
const prefix = cellKey(row.key, "");
|
|
553
|
+
const next = Object.fromEntries(
|
|
554
|
+
Object.entries(current).filter(([key]) => !key.startsWith(prefix))
|
|
555
|
+
);
|
|
556
|
+
return Object.keys(next).length === Object.keys(current).length ? current : next;
|
|
557
|
+
});
|
|
558
|
+
void onRemoveProject(project);
|
|
559
|
+
},
|
|
560
|
+
"aria-label": t("staff.timesheets.my.removeRow", "Remove from grid"),
|
|
561
|
+
title: t("staff.timesheets.my.removeRow", "Remove from grid"),
|
|
562
|
+
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",
|
|
563
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-3.5" })
|
|
564
|
+
}
|
|
565
|
+
) : null
|
|
566
|
+
] })
|
|
567
|
+
}
|
|
568
|
+
),
|
|
569
|
+
days.map((date) => {
|
|
570
|
+
const key = cellKey(row.key, date);
|
|
571
|
+
const weekend = isWeekendIso(date);
|
|
572
|
+
const minutes = cellMinutes(key);
|
|
573
|
+
const locked = isCellLocked(key);
|
|
574
|
+
const isDirty = dirty[key] !== void 0;
|
|
575
|
+
const isInvalid = Boolean(invalidCells[key]);
|
|
576
|
+
return /* @__PURE__ */ jsx(
|
|
577
|
+
"td",
|
|
578
|
+
{
|
|
579
|
+
className: cn(
|
|
580
|
+
"px-0.5 py-0.5",
|
|
581
|
+
weekend ? "bg-muted/40" : null,
|
|
582
|
+
// The old grid tinted the input itself amber; the border and
|
|
583
|
+
// background of a `DurationInput` belong to the primitive, so
|
|
584
|
+
// the pending-edit cue moved to the cell — same signal, DS
|
|
585
|
+
// status tokens instead of raw `amber-*` (Boy Scout rule).
|
|
586
|
+
isInvalid ? "bg-status-error-bg" : isDirty ? "bg-status-warning-bg" : null
|
|
587
|
+
),
|
|
588
|
+
children: weekend && minutes === 0 ? /* @__PURE__ */ jsx("div", { className: "rounded px-1 py-1 text-center text-xs text-muted-foreground/50", children: "-" }) : locked || !editable ? /* @__PURE__ */ jsxs(
|
|
589
|
+
"div",
|
|
590
|
+
{
|
|
591
|
+
className: "flex items-center justify-center gap-1 rounded px-1 py-1 text-center text-xs tabular-nums text-muted-foreground",
|
|
592
|
+
title: locked ? t(
|
|
593
|
+
"staff.time_tracking.timesheet.grid.lockedCell",
|
|
594
|
+
"Locked by a closed report"
|
|
595
|
+
) : void 0,
|
|
596
|
+
children: [
|
|
597
|
+
locked ? /* @__PURE__ */ jsx(Lock, { className: "size-3 shrink-0", "aria-hidden": "true" }) : null,
|
|
598
|
+
/* @__PURE__ */ jsx("span", { children: formatTrimmedDecimalDuration(minutes) || "-" })
|
|
599
|
+
]
|
|
600
|
+
}
|
|
601
|
+
) : /* @__PURE__ */ jsx(
|
|
602
|
+
DurationInput,
|
|
603
|
+
{
|
|
604
|
+
variant: "compact",
|
|
605
|
+
inputSize: "sm",
|
|
606
|
+
value: minutes > 0 ? minutes : null,
|
|
607
|
+
formatValue: formatTrimmedDecimalDuration,
|
|
608
|
+
onChange: (nextMinutes, state) => handleCellChange(row, date, nextMinutes, state.status === "invalid"),
|
|
609
|
+
placeholder: t("staff.timesheets.my.durationPlaceholder", "0"),
|
|
610
|
+
ariaLabel: `${targetLabel(row)} \xB7 ${date}`,
|
|
611
|
+
className: cn("mx-auto", dense ? "w-10" : "w-16"),
|
|
612
|
+
inputClassName: cn(
|
|
613
|
+
"text-center px-1 tabular-nums",
|
|
614
|
+
dense ? "text-xs" : null,
|
|
615
|
+
minutes > 0 ? "font-semibold" : "text-muted-foreground"
|
|
616
|
+
)
|
|
617
|
+
}
|
|
618
|
+
)
|
|
619
|
+
},
|
|
620
|
+
date
|
|
621
|
+
);
|
|
622
|
+
}),
|
|
623
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-1.5 text-right font-semibold text-xs tabular-nums", children: formatTrimmedDecimalDuration(rowTotal(row.key)) || "0" })
|
|
624
|
+
] }, row.key)),
|
|
625
|
+
editable && !isLoading ? /* @__PURE__ */ jsx("tr", { className: "border-b", children: /* @__PURE__ */ jsx("td", { colSpan: days.length + 2, className: "sticky left-0 bg-background px-1 py-0.5", children: /* @__PURE__ */ jsx(
|
|
626
|
+
AddRowDropdown,
|
|
627
|
+
{
|
|
628
|
+
assignedProjects: allAssignedProjects.map((project) => ({
|
|
629
|
+
id: project.id,
|
|
630
|
+
name: project.name,
|
|
631
|
+
code: project.code,
|
|
632
|
+
color: project.color
|
|
633
|
+
})),
|
|
634
|
+
visibleProjectIds: new Set(projects.map((project) => project.id)),
|
|
635
|
+
canCreateProject: canManageProjects,
|
|
636
|
+
onAddProject: (project) => {
|
|
637
|
+
void onAddProject({
|
|
638
|
+
id: project.id,
|
|
639
|
+
name: project.name,
|
|
640
|
+
code: project.code ?? null,
|
|
641
|
+
color: project.color ?? null
|
|
642
|
+
});
|
|
643
|
+
},
|
|
644
|
+
onCreateProject
|
|
645
|
+
}
|
|
646
|
+
) }) }) : null
|
|
647
|
+
] }),
|
|
648
|
+
/* @__PURE__ */ jsx("tfoot", { children: /* @__PURE__ */ jsxs("tr", { className: "border-t bg-muted/50 font-semibold", children: [
|
|
649
|
+
/* @__PURE__ */ jsx("th", { scope: "row", className: "sticky left-0 z-10 bg-muted px-3 py-2 text-left", children: t("staff.timesheets.my.daily_total", "Daily Total") }),
|
|
650
|
+
days.map((date) => {
|
|
651
|
+
const weekend = isWeekendIso(date);
|
|
652
|
+
const minutes = dayTotal(date);
|
|
653
|
+
return /* @__PURE__ */ jsx(
|
|
654
|
+
"td",
|
|
655
|
+
{
|
|
656
|
+
className: cn(
|
|
657
|
+
"py-2 text-center text-xs tabular-nums",
|
|
658
|
+
weekend ? "text-muted-foreground/50" : null
|
|
659
|
+
),
|
|
660
|
+
children: weekend && minutes === 0 ? "-" : formatTrimmedDecimalDuration(minutes) || "-"
|
|
661
|
+
},
|
|
662
|
+
date
|
|
663
|
+
);
|
|
664
|
+
}),
|
|
665
|
+
/* @__PURE__ */ jsx("td", { className: "px-3 py-2 text-right tabular-nums font-semibold", children: formatTrimmedDecimalDuration(grandTotal) || "0" })
|
|
666
|
+
] }) })
|
|
667
|
+
] }) }),
|
|
668
|
+
ConfirmDialogElement
|
|
669
|
+
] });
|
|
670
|
+
}
|
|
671
|
+
const gridViewPropsSchema = z.object({
|
|
672
|
+
days: z.array(z.string()),
|
|
673
|
+
projects: z.array(opaqueProp()),
|
|
674
|
+
allAssignedProjects: z.array(opaqueProp()),
|
|
675
|
+
tasks: z.array(opaqueProp()),
|
|
676
|
+
entries: z.array(opaqueProp()),
|
|
677
|
+
staffMemberId: z.string().nullable(),
|
|
678
|
+
canManage: z.boolean(),
|
|
679
|
+
canManageProjects: z.boolean(),
|
|
680
|
+
readOnly: z.boolean(),
|
|
681
|
+
isLoading: z.boolean().optional(),
|
|
682
|
+
rowMode: z.union([z.literal("projects"), z.literal("tasks")]),
|
|
683
|
+
onRowModeChange: callbackProp(),
|
|
684
|
+
onAddProject: callbackProp(),
|
|
685
|
+
onRemoveProject: callbackProp(),
|
|
686
|
+
onCreateProject: callbackProp(),
|
|
687
|
+
onSaved: callbackProp()
|
|
688
|
+
});
|
|
689
|
+
registerComponent({
|
|
690
|
+
id: extensionPoints.hosts.timesheetGridComponent.componentId,
|
|
691
|
+
component: DefaultGridView,
|
|
692
|
+
metadata: {
|
|
693
|
+
module: "staff",
|
|
694
|
+
description: "Timesheet grid view \u2014 projects/tasks by day, editable cells.",
|
|
695
|
+
propsSchema: gridViewPropsSchema
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
function GridView(props) {
|
|
699
|
+
const Resolved = useRegisteredComponent(
|
|
700
|
+
extensionPoints.hosts.timesheetGridComponent.componentId,
|
|
701
|
+
DefaultGridView
|
|
702
|
+
);
|
|
703
|
+
return /* @__PURE__ */ jsx(Resolved, { ...props });
|
|
704
|
+
}
|
|
705
|
+
export {
|
|
706
|
+
GridView,
|
|
707
|
+
buildGridCells,
|
|
708
|
+
buildGridRows
|
|
709
|
+
};
|
|
710
|
+
//# sourceMappingURL=GridView.js.map
|