@open-mercato/core 0.7.1-develop.7178.1.ab93fbaf4e → 0.7.1-develop.7180.1.9717fbbb43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/dist/generated/entities/staff_time_entry/index.js +14 -0
- package/dist/generated/entities/staff_time_entry/index.js.map +2 -2
- package/dist/generated/entities/staff_time_entry_tag/index.js +15 -0
- package/dist/generated/entities/staff_time_entry_tag/index.js.map +7 -0
- package/dist/generated/entities/staff_time_project/index.js +16 -0
- package/dist/generated/entities/staff_time_project/index.js.map +2 -2
- package/dist/generated/entities/staff_time_report/index.js +57 -0
- package/dist/generated/entities/staff_time_report/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_entry/index.js +27 -0
- package/dist/generated/entities/staff_time_report_entry/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_event/index.js +21 -0
- package/dist/generated/entities/staff_time_report_event/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_project/index.js +15 -0
- package/dist/generated/entities/staff_time_report_project/index.js.map +7 -0
- package/dist/generated/entities/staff_time_tag/index.js +21 -0
- package/dist/generated/entities/staff_time_tag/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task/index.js +37 -0
- package/dist/generated/entities/staff_time_task/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_comment/index.js +21 -0
- package/dist/generated/entities/staff_time_task_comment/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_status/index.js +29 -0
- package/dist/generated/entities/staff_time_task_status/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_tag/index.js +15 -0
- package/dist/generated/entities/staff_time_task_tag/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +11 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +149 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/timesheetFixtures.js +7 -0
- package/dist/helpers/integration/timesheetFixtures.js.map +2 -2
- package/dist/modules/auth/cli.js +16 -0
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/lib/backendChrome.js +1 -0
- package/dist/modules/auth/lib/backendChrome.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerRoleAcls.js +44 -0
- package/dist/modules/customer_accounts/lib/customerRoleAcls.js.map +7 -0
- package/dist/modules/customer_accounts/setup.js +1 -28
- package/dist/modules/customer_accounts/setup.js.map +2 -2
- package/dist/modules/data_sync/api/options.js +2 -0
- package/dist/modules/data_sync/api/options.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +39 -17
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/lib/start-controls.js +42 -0
- package/dist/modules/data_sync/lib/start-controls.js.map +7 -0
- package/dist/modules/staff/acl.js +9 -1
- package/dist/modules/staff/acl.js.map +2 -2
- package/dist/modules/staff/ai-agents.js +142 -0
- package/dist/modules/staff/ai-agents.js.map +7 -0
- package/dist/modules/staff/ai-tools/time-tracking-pack.js +348 -0
- package/dist/modules/staff/ai-tools/time-tracking-pack.js.map +7 -0
- package/dist/modules/staff/ai-tools/types.js +54 -0
- package/dist/modules/staff/ai-tools/types.js.map +7 -0
- package/dist/modules/staff/ai-tools.js +8 -0
- package/dist/modules/staff/ai-tools.js.map +7 -0
- package/dist/modules/staff/analytics.js +84 -1
- package/dist/modules/staff/analytics.js.map +2 -2
- package/dist/modules/staff/api/guards.js +37 -3
- package/dist/modules/staff/api/guards.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/accept/route.js +1 -3
- package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/reject/route.js +1 -3
- package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
- package/dist/modules/staff/api/portal/time-reports/[id]/route.js +131 -0
- package/dist/modules/staff/api/portal/time-reports/[id]/route.js.map +7 -0
- package/dist/modules/staff/api/portal/time-reports/route.js +179 -0
- package/dist/modules/staff/api/portal/time-reports/route.js.map +7 -0
- package/dist/modules/staff/api/team-members/self/route.js +1 -3
- package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/assign/route.js +1 -3
- package/dist/modules/staff/api/team-members/tags/assign/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/unassign/route.js +1 -3
- package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js +174 -0
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js.map +7 -0
- package/dist/modules/staff/api/timesheets/access-requests/route.js +226 -0
- package/dist/modules/staff/api/timesheets/access-requests/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js +15 -8
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/route.js +13 -1
- package/dist/modules/staff/api/timesheets/my-projects/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-work/myWorkAggregate.js +42 -0
- package/dist/modules/staff/api/timesheets/my-work/myWorkAggregate.js.map +7 -0
- package/dist/modules/staff/api/timesheets/my-work/route.js +383 -0
- package/dist/modules/staff/api/timesheets/my-work/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js +14 -2
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js +168 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js +246 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js +183 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js +164 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/preview/route.js +360 -0
- package/dist/modules/staff/api/timesheets/reports/preview/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/route.js +316 -0
- package/dist/modules/staff/api/timesheets/reports/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/shared.js +63 -0
- package/dist/modules/staff/api/timesheets/reports/shared.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js +164 -0
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/rounding-impact/route.js +168 -0
- package/dist/modules/staff/api/timesheets/settings/rounding-impact/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/route.js +199 -0
- package/dist/modules/staff/api/timesheets/settings/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/access.js +76 -0
- package/dist/modules/staff/api/timesheets/tags/access.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js +235 -0
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/route.js +160 -0
- package/dist/modules/staff/api/timesheets/tags/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js +233 -0
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/task-statuses/route.js +188 -0
- package/dist/modules/staff/api/timesheets/task-statuses/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js +399 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js +210 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/route.js +333 -0
- package/dist/modules/staff/api/timesheets/tasks/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js +228 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js +29 -10
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js +31 -18
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js +21 -7
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js +27 -7
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js +215 -32
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js +378 -0
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js +340 -0
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/route.js +238 -26
- package/dist/modules/staff/api/timesheets/time-entries/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js +23 -8
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js +209 -0
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-projects/[id]/employees/route.js +59 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/employees/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/route.js +264 -22
- package/dist/modules/staff/api/timesheets/time-projects/route.js.map +2 -2
- package/dist/modules/staff/backend/staff/time-tracking/board/page.js +110 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.js +981 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.js +583 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.meta.js +15 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.js +65 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.js +229 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.js +1014 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.js +97 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.js +1040 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.meta.js +19 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.js +353 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.js +457 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.js +697 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.js +174 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.js +546 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/GridView.js +710 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/GridView.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.js +646 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/page.js +4 -793
- package/dist/modules/staff/backend/staff/timesheets/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/page.meta.js +2 -7
- package/dist/modules/staff/backend/staff/timesheets/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.js +5 -136
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js +5 -445
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js.map +3 -3
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.js +4 -76
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js +4 -613
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.meta.js +2 -17
- package/dist/modules/staff/backend/staff/timesheets/projects/page.meta.js.map +2 -2
- package/dist/modules/staff/ce.js +40 -0
- package/dist/modules/staff/ce.js.map +2 -2
- package/dist/modules/staff/cli.js +166 -1
- package/dist/modules/staff/cli.js.map +2 -2
- package/dist/modules/staff/commands/index.js +5 -0
- package/dist/modules/staff/commands/index.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-entries.js +569 -21
- package/dist/modules/staff/commands/timesheets-entries.js.map +3 -3
- package/dist/modules/staff/commands/timesheets-projects.js +450 -7
- package/dist/modules/staff/commands/timesheets-projects.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-reports.js +1036 -0
- package/dist/modules/staff/commands/timesheets-reports.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-tags.js +1015 -0
- package/dist/modules/staff/commands/timesheets-tags.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-task-comments.js +438 -0
- package/dist/modules/staff/commands/timesheets-task-comments.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-task-statuses.js +723 -0
- package/dist/modules/staff/commands/timesheets-task-statuses.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-tasks.js +834 -0
- package/dist/modules/staff/commands/timesheets-tasks.js.map +7 -0
- package/dist/modules/staff/data/enrichers.js +426 -12
- package/dist/modules/staff/data/enrichers.js.map +2 -2
- package/dist/modules/staff/data/entities.js +552 -3
- package/dist/modules/staff/data/entities.js.map +2 -2
- package/dist/modules/staff/data/extensions.js +41 -0
- package/dist/modules/staff/data/extensions.js.map +7 -0
- package/dist/modules/staff/data/validators.js +254 -9
- package/dist/modules/staff/data/validators.js.map +2 -2
- package/dist/modules/staff/di.js +42 -1
- package/dist/modules/staff/di.js.map +2 -2
- package/dist/modules/staff/events.js +84 -6
- package/dist/modules/staff/events.js.map +2 -2
- package/dist/modules/staff/events.payloads.js +158 -0
- package/dist/modules/staff/events.payloads.js.map +7 -0
- package/dist/modules/staff/extension-points.js +261 -0
- package/dist/modules/staff/extension-points.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.js +138 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.js +12 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.js +133 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.js +19 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.js.map +7 -0
- package/dist/modules/staff/lib/crud.js +11 -1
- package/dist/modules/staff/lib/crud.js.map +2 -2
- package/dist/modules/staff/lib/time-tracking/access.js +92 -0
- package/dist/modules/staff/lib/time-tracking/access.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/billability.js +39 -0
- package/dist/modules/staff/lib/time-tracking/billability.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/capacity.js +68 -0
- package/dist/modules/staff/lib/time-tracking/capacity.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/componentContracts.js +15 -0
- package/dist/modules/staff/lib/time-tracking/componentContracts.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/cost.js +82 -0
- package/dist/modules/staff/lib/time-tracking/cost.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/duration.js +55 -0
- package/dist/modules/staff/lib/time-tracking/duration.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/featureAccess.js +41 -0
- package/dist/modules/staff/lib/time-tracking/featureAccess.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/interval.js +72 -0
- package/dist/modules/staff/lib/time-tracking/interval.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/migrateProjectCodes.js +88 -0
- package/dist/modules/staff/lib/time-tracking/migrateProjectCodes.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/moneyVisibility.js +10 -0
- package/dist/modules/staff/lib/time-tracking/moneyVisibility.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/overlap.js +87 -0
- package/dist/modules/staff/lib/time-tracking/overlap.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/portalRecipients.js +27 -0
- package/dist/modules/staff/lib/time-tracking/portalRecipients.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/portalReports.js +16 -0
- package/dist/modules/staff/lib/time-tracking/portalReports.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/projectCode.js +135 -0
- package/dist/modules/staff/lib/time-tracking/projectCode.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/reapplyRounding.js +187 -0
- package/dist/modules/staff/lib/time-tracking/reapplyRounding.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/recalculationRunner.js +80 -0
- package/dist/modules/staff/lib/time-tracking/recalculationRunner.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/recalculations.js +56 -0
- package/dist/modules/staff/lib/time-tracking/recalculations.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/invoke.js +63 -0
- package/dist/modules/staff/lib/time-tracking/registries/invoke.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/registry.js +62 -0
- package/dist/modules/staff/lib/time-tracking/registries/registry.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/scope.js +21 -0
- package/dist/modules/staff/lib/time-tracking/registries/scope.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/rollup.js +34 -0
- package/dist/modules/staff/lib/time-tracking/rollup.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/rounding.js +66 -0
- package/dist/modules/staff/lib/time-tracking/rounding.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/roundingImpact.js +39 -0
- package/dist/modules/staff/lib/time-tracking/roundingImpact.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/settingKeys.js +214 -0
- package/dist/modules/staff/lib/time-tracking/settingKeys.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/settings.js +87 -0
- package/dist/modules/staff/lib/time-tracking/settings.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/sqlInClause.js +9 -0
- package/dist/modules/staff/lib/time-tracking/sqlInClause.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/timeEntrySources.js +48 -0
- package/dist/modules/staff/lib/time-tracking/timeEntrySources.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/BoardFilterChips.js +283 -0
- package/dist/modules/staff/lib/time-tracking-ui/BoardFilterChips.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/CustomerPicker.js +324 -0
- package/dist/modules/staff/lib/time-tracking-ui/CustomerPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/DurationInput.js +121 -0
- package/dist/modules/staff/lib/time-tracking-ui/DurationInput.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryDetailsFields.js +188 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryDetailsFields.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryFilterBar.js +89 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryFilterBar.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanBoard.js +855 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanBoard.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanCard.js +360 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanCard.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanColumn.js +259 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanColumn.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/NewTaskDialog.js +238 -0
- package/dist/modules/staff/lib/time-tracking-ui/NewTaskDialog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/NoProjectAccess.js +130 -0
- package/dist/modules/staff/lib/time-tracking-ui/NoProjectAccess.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/PeriodSelector.js +98 -0
- package/dist/modules/staff/lib/time-tracking-ui/PeriodSelector.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/PhasePlaceholder.js +27 -0
- package/dist/modules/staff/lib/time-tracking-ui/PhasePlaceholder.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCodeField.js +166 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCodeField.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.js +295 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectFormSections.js +212 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectFormSections.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.js +729 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ReportSheet.js +217 -0
- package/dist/modules/staff/lib/time-tracking-ui/ReportSheet.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TagPicker.js +158 -0
- package/dist/modules/staff/lib/time-tracking-ui/TagPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskBoardScreen.js +224 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskBoardScreen.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskCommentThread.js +93 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskCommentThread.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskDrawer.js +1196 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskDrawer.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskListView.js +176 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskListView.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskPicker.js +307 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskQuickLog.js +284 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskQuickLog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.js +73 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDialog.js +1499 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDialog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.js +95 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetCalendar.js +188 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetCalendar.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.js +61 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.js +45 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardDirectory.js +176 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardDirectory.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardFilters.js +82 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardFilters.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardSummary.js +5 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardSummary.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/kanbanBoardData.js +152 -0
- package/dist/modules/staff/lib/time-tracking-ui/kanbanBoardData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/projectTeamAssignment.js +92 -0
- package/dist/modules/staff/lib/time-tracking-ui/projectTeamAssignment.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/taskDrawerData.js +111 -0
- package/dist/modules/staff/lib/time-tracking-ui/taskDrawerData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryDialogState.js +243 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryDialogState.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryListData.js +151 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryListData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.js +105 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetData.js +132 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetPeriod.js +205 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetPeriod.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetTargets.js +53 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetTargets.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/useBoardFilters.js +77 -0
- package/dist/modules/staff/lib/time-tracking-ui/useBoardFilters.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.js +151 -0
- package/dist/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.js.map +7 -0
- package/dist/modules/staff/lib/timeTrackingSeeds.js +809 -0
- package/dist/modules/staff/lib/timeTrackingSeeds.js.map +7 -0
- package/dist/modules/staff/lib/timesheets/timeEntryCacheInvalidation.js +2 -3
- package/dist/modules/staff/lib/timesheets/timeEntryCacheInvalidation.js.map +2 -2
- package/dist/modules/staff/lib/timesheets/timeEntryDecoration.js +152 -0
- package/dist/modules/staff/lib/timesheets/timeEntryDecoration.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetBurn.js +36 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetBurn.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThreshold.js +66 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThreshold.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThresholdState.js +78 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThresholdState.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectFinancials.js +81 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectFinancials.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/reportSelection.js +44 -0
- package/dist/modules/staff/lib/timesheets-projects/reportSelection.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.js +169 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.js +22 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectCard.js +51 -1
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectCard.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.js +70 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js +63 -0
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js +170 -0
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/pdf.js +205 -0
- package/dist/modules/staff/lib/timesheets-reports/pdf.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportApprovalPolicies.js +68 -0
- package/dist/modules/staff/lib/timesheets-reports/reportApprovalPolicies.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigData.js +135 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigState.js +48 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigState.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExport.js +262 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExport.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExportFormats.js +34 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExportFormats.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportGroupings.js +79 -0
- package/dist/modules/staff/lib/timesheets-reports/reportGroupings.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportLabels.js +11 -0
- package/dist/modules/staff/lib/timesheets-reports/reportLabels.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportReference.js +83 -0
- package/dist/modules/staff/lib/timesheets-reports/reportReference.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportRows.js +42 -0
- package/dist/modules/staff/lib/timesheets-reports/reportRows.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportSheetData.js +107 -0
- package/dist/modules/staff/lib/timesheets-reports/reportSheetData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportTotals.js +289 -0
- package/dist/modules/staff/lib/timesheets-reports/reportTotals.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/xlsx.js +145 -0
- package/dist/modules/staff/lib/timesheets-reports/xlsx.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/computeTaskRollups.js +116 -0
- package/dist/modules/staff/lib/timesheets-tasks/computeTaskRollups.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.js +50 -0
- package/dist/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/seedProjectStatuses.js +27 -0
- package/dist/modules/staff/lib/timesheets-tasks/seedProjectStatuses.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusPositions.js +65 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusPositions.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusSlug.js +31 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusSlug.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHierarchy.js +31 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHierarchy.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHoursTotals.js +17 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHoursTotals.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskReference.js +51 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskReference.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/CreateProjectDialog.js +11 -4
- package/dist/modules/staff/lib/timesheets-ui/CreateProjectDialog.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-ui/ListView.js +369 -111
- package/dist/modules/staff/lib/timesheets-ui/ListView.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-ui/TimerBar.js +47 -2
- package/dist/modules/staff/lib/timesheets-ui/TimerBar.js.map +2 -2
- package/dist/modules/staff/migrations/Migration20260813073131_staff.js +79 -0
- package/dist/modules/staff/migrations/Migration20260813073131_staff.js.map +7 -0
- package/dist/modules/staff/migrations/Migration20260824143357_staff.js +15 -0
- package/dist/modules/staff/migrations/Migration20260824143357_staff.js.map +7 -0
- package/dist/modules/staff/notifications.client.js +16 -0
- package/dist/modules/staff/notifications.client.js.map +7 -0
- package/dist/modules/staff/notifications.handlers.js +80 -0
- package/dist/modules/staff/notifications.handlers.js.map +7 -0
- package/dist/modules/staff/notifications.js +168 -0
- package/dist/modules/staff/notifications.js.map +2 -2
- package/dist/modules/staff/search.js +159 -1
- package/dist/modules/staff/search.js.map +2 -2
- package/dist/modules/staff/setup.js +20 -1
- package/dist/modules/staff/setup.js.map +2 -2
- package/dist/modules/staff/subscribers/time-project-access-requested-notification.js +68 -0
- package/dist/modules/staff/subscribers/time-project-access-requested-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-project-budget-threshold-notification.js +149 -0
- package/dist/modules/staff/subscribers/time-project-budget-threshold-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-report-approved-notification.js +78 -0
- package/dist/modules/staff/subscribers/time-report-approved-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-report-portal-broadcast.js +78 -0
- package/dist/modules/staff/subscribers/time-report-portal-broadcast.js.map +7 -0
- package/dist/modules/staff/translations.js +4 -1
- package/dist/modules/staff/translations.js.map +2 -2
- package/dist/modules/staff/widgets/components.js +7 -0
- package/dist/modules/staff/widgets/components.js.map +7 -0
- package/dist/modules/staff/widgets/injection/timer-sidebar-indicator/widget.js +5 -4
- package/dist/modules/staff/widgets/injection/timer-sidebar-indicator/widget.js.map +2 -2
- package/dist/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.js +135 -0
- package/dist/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.js.map +7 -0
- package/dist/modules/staff/widgets/notifications/index.js +5 -0
- package/dist/modules/staff/widgets/notifications/index.js.map +7 -0
- package/dist/modules/staff/workers/timesheets-reapply-rounding.js +43 -0
- package/dist/modules/staff/workers/timesheets-reapply-rounding.js.map +7 -0
- package/generated/entities/staff_time_entry/index.ts +7 -0
- package/generated/entities/staff_time_entry_tag/index.ts +6 -0
- package/generated/entities/staff_time_project/index.ts +8 -0
- package/generated/entities/staff_time_report/index.ts +27 -0
- package/generated/entities/staff_time_report_entry/index.ts +12 -0
- package/generated/entities/staff_time_report_event/index.ts +9 -0
- package/generated/entities/staff_time_report_project/index.ts +6 -0
- package/generated/entities/staff_time_tag/index.ts +9 -0
- package/generated/entities/staff_time_task/index.ts +17 -0
- package/generated/entities/staff_time_task_comment/index.ts +9 -0
- package/generated/entities/staff_time_task_status/index.ts +13 -0
- package/generated/entities/staff_time_task_tag/index.ts +6 -0
- package/generated/entities.ids.generated.ts +11 -1
- package/generated/entity-fields-registry.ts +149 -0
- package/package.json +7 -7
- package/src/helpers/integration/timesheetFixtures.ts +31 -1
- package/src/modules/auth/README.md +1 -1
- package/src/modules/auth/cli.ts +35 -1
- package/src/modules/auth/i18n/de.json +7 -0
- package/src/modules/auth/i18n/en.json +7 -0
- package/src/modules/auth/i18n/es.json +7 -0
- package/src/modules/auth/i18n/ko.json +7 -0
- package/src/modules/auth/i18n/pl.json +7 -0
- package/src/modules/auth/lib/backendChrome.tsx +1 -0
- package/src/modules/customer_accounts/lib/customerRoleAcls.ts +79 -0
- package/src/modules/customer_accounts/setup.ts +1 -45
- package/src/modules/data_sync/AGENTS.md +34 -0
- package/src/modules/data_sync/api/options.ts +2 -0
- package/src/modules/data_sync/backend/data-sync/page.tsx +82 -33
- package/src/modules/data_sync/i18n/de.json +1 -0
- package/src/modules/data_sync/i18n/en.json +1 -0
- package/src/modules/data_sync/i18n/es.json +1 -0
- package/src/modules/data_sync/i18n/ko.json +1 -0
- package/src/modules/data_sync/i18n/pl.json +1 -0
- package/src/modules/data_sync/lib/adapter.ts +45 -0
- package/src/modules/data_sync/lib/start-controls.ts +89 -0
- package/src/modules/staff/AGENTS.md +769 -1
- package/src/modules/staff/acl.ts +9 -0
- package/src/modules/staff/ai-agents.ts +189 -0
- package/src/modules/staff/ai-tools/time-tracking-pack.ts +494 -0
- package/src/modules/staff/ai-tools/types.ts +82 -0
- package/src/modules/staff/ai-tools.ts +13 -0
- package/src/modules/staff/analytics.ts +113 -0
- package/src/modules/staff/api/guards.ts +85 -3
- package/src/modules/staff/api/leave-requests/accept/route.ts +0 -2
- package/src/modules/staff/api/leave-requests/reject/route.ts +0 -2
- package/src/modules/staff/api/portal/time-reports/[id]/route.ts +182 -0
- package/src/modules/staff/api/portal/time-reports/route.ts +270 -0
- package/src/modules/staff/api/team-members/self/route.ts +0 -2
- package/src/modules/staff/api/team-members/tags/assign/route.ts +0 -2
- package/src/modules/staff/api/team-members/tags/unassign/route.ts +0 -2
- package/src/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.ts +292 -0
- package/src/modules/staff/api/timesheets/access-requests/route.ts +299 -0
- package/src/modules/staff/api/timesheets/my-projects/[projectId]/route.ts +15 -7
- package/src/modules/staff/api/timesheets/my-projects/route.ts +14 -1
- package/src/modules/staff/api/timesheets/my-work/myWorkAggregate.ts +90 -0
- package/src/modules/staff/api/timesheets/my-work/route.ts +475 -0
- package/src/modules/staff/api/timesheets/projects/kpis/route.ts +15 -2
- package/src/modules/staff/api/timesheets/reports/[id]/close/route.ts +203 -0
- package/src/modules/staff/api/timesheets/reports/[id]/export/route.ts +315 -0
- package/src/modules/staff/api/timesheets/reports/[id]/sheet/route.ts +220 -0
- package/src/modules/staff/api/timesheets/reports/[id]/unlock/route.ts +208 -0
- package/src/modules/staff/api/timesheets/reports/preview/route.ts +449 -0
- package/src/modules/staff/api/timesheets/reports/route.ts +386 -0
- package/src/modules/staff/api/timesheets/reports/shared.ts +121 -0
- package/src/modules/staff/api/timesheets/settings/reapply-rounding/route.ts +205 -0
- package/src/modules/staff/api/timesheets/settings/rounding-impact/route.ts +226 -0
- package/src/modules/staff/api/timesheets/settings/route.ts +242 -0
- package/src/modules/staff/api/timesheets/tags/access.ts +134 -0
- package/src/modules/staff/api/timesheets/tags/entry-assignments/route.ts +290 -0
- package/src/modules/staff/api/timesheets/tags/route.ts +177 -0
- package/src/modules/staff/api/timesheets/tags/task-assignments/route.ts +294 -0
- package/src/modules/staff/api/timesheets/task-statuses/route.ts +232 -0
- package/src/modules/staff/api/timesheets/tasks/[id]/comments/route.ts +532 -0
- package/src/modules/staff/api/timesheets/tasks/[id]/status/route.ts +271 -0
- package/src/modules/staff/api/timesheets/tasks/route.ts +443 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.ts +306 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.ts +32 -10
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/route.ts +32 -17
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.ts +27 -6
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.ts +36 -6
- package/src/modules/staff/api/timesheets/time-entries/bulk/route.ts +331 -34
- package/src/modules/staff/api/timesheets/time-entries/copy-day/route.ts +533 -0
- package/src/modules/staff/api/timesheets/time-entries/overlaps/route.ts +457 -0
- package/src/modules/staff/api/timesheets/time-entries/route.ts +378 -24
- package/src/modules/staff/api/timesheets/time-entries/start-timer/route.ts +31 -9
- package/src/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.ts +246 -0
- package/src/modules/staff/api/timesheets/time-projects/[id]/employees/route.ts +62 -2
- package/src/modules/staff/api/timesheets/time-projects/route.ts +397 -22
- package/src/modules/staff/backend/staff/time-tracking/board/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/board/page.tsx +151 -0
- package/src/modules/staff/backend/staff/time-tracking/entries/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/entries/page.tsx +1229 -0
- package/src/modules/staff/backend/staff/time-tracking/page.meta.ts +11 -0
- package/src/modules/staff/backend/staff/time-tracking/page.tsx +823 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.tsx +81 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.tsx +275 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/page.tsx +1420 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/create/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/create/page.tsx +109 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/page.meta.ts +15 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/page.tsx +1254 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.ts +466 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/[id]/page.tsx +632 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/create/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/create/page.tsx +867 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/page.tsx +246 -0
- package/src/modules/staff/backend/staff/time-tracking/settings/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/settings/page.tsx +701 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/GridView.tsx +953 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/page.tsx +800 -0
- package/src/modules/staff/backend/staff/timesheets/page.meta.ts +6 -6
- package/src/modules/staff/backend/staff/timesheets/page.tsx +12 -1010
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.tsx +4 -158
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.tsx +4 -609
- package/src/modules/staff/backend/staff/timesheets/projects/create/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/create/page.tsx +3 -89
- package/src/modules/staff/backend/staff/timesheets/projects/page.meta.ts +2 -19
- package/src/modules/staff/backend/staff/timesheets/projects/page.tsx +3 -778
- package/src/modules/staff/ce.ts +63 -0
- package/src/modules/staff/cli.ts +207 -1
- package/src/modules/staff/commands/index.ts +5 -0
- package/src/modules/staff/commands/timesheets-entries.ts +1006 -28
- package/src/modules/staff/commands/timesheets-projects.ts +593 -7
- package/src/modules/staff/commands/timesheets-reports.ts +1329 -0
- package/src/modules/staff/commands/timesheets-tags.ts +1315 -0
- package/src/modules/staff/commands/timesheets-task-comments.ts +583 -0
- package/src/modules/staff/commands/timesheets-task-statuses.ts +889 -0
- package/src/modules/staff/commands/timesheets-tasks.ts +1121 -0
- package/src/modules/staff/data/enrichers.ts +675 -10
- package/src/modules/staff/data/entities.ts +494 -2
- package/src/modules/staff/data/extensions.ts +68 -0
- package/src/modules/staff/data/validators.ts +348 -3
- package/src/modules/staff/di.ts +96 -0
- package/src/modules/staff/events.payloads.ts +268 -0
- package/src/modules/staff/events.ts +87 -5
- package/src/modules/staff/extension-points.ts +308 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.ts +10 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.tsx +225 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.ts +17 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/page.tsx +182 -0
- package/src/modules/staff/i18n/de.json +899 -0
- package/src/modules/staff/i18n/en.json +899 -0
- package/src/modules/staff/i18n/es.json +899 -0
- package/src/modules/staff/i18n/ko.json +899 -0
- package/src/modules/staff/i18n/pl.json +899 -0
- package/src/modules/staff/lib/crud.ts +14 -3
- package/src/modules/staff/lib/time-tracking/access.ts +155 -0
- package/src/modules/staff/lib/time-tracking/billability.ts +68 -0
- package/src/modules/staff/lib/time-tracking/capacity.ts +124 -0
- package/src/modules/staff/lib/time-tracking/componentContracts.ts +26 -0
- package/src/modules/staff/lib/time-tracking/cost.ts +144 -0
- package/src/modules/staff/lib/time-tracking/duration.ts +68 -0
- package/src/modules/staff/lib/time-tracking/featureAccess.ts +115 -0
- package/src/modules/staff/lib/time-tracking/interval.ts +90 -0
- package/src/modules/staff/lib/time-tracking/migrateProjectCodes.ts +161 -0
- package/src/modules/staff/lib/time-tracking/moneyVisibility.ts +37 -0
- package/src/modules/staff/lib/time-tracking/overlap.ts +159 -0
- package/src/modules/staff/lib/time-tracking/portalRecipients.ts +76 -0
- package/src/modules/staff/lib/time-tracking/portalReports.ts +31 -0
- package/src/modules/staff/lib/time-tracking/projectCode.ts +221 -0
- package/src/modules/staff/lib/time-tracking/reapplyRounding.ts +313 -0
- package/src/modules/staff/lib/time-tracking/recalculationRunner.ts +118 -0
- package/src/modules/staff/lib/time-tracking/recalculations.ts +135 -0
- package/src/modules/staff/lib/time-tracking/registries/invoke.ts +122 -0
- package/src/modules/staff/lib/time-tracking/registries/registry.ts +124 -0
- package/src/modules/staff/lib/time-tracking/registries/scope.ts +56 -0
- package/src/modules/staff/lib/time-tracking/rollup.ts +59 -0
- package/src/modules/staff/lib/time-tracking/rounding.ts +126 -0
- package/src/modules/staff/lib/time-tracking/roundingImpact.ts +75 -0
- package/src/modules/staff/lib/time-tracking/settingKeys.ts +274 -0
- package/src/modules/staff/lib/time-tracking/settings.ts +168 -0
- package/src/modules/staff/lib/time-tracking/sqlInClause.ts +22 -0
- package/src/modules/staff/lib/time-tracking/timeEntrySources.ts +85 -0
- package/src/modules/staff/lib/time-tracking-ui/BoardFilterChips.tsx +360 -0
- package/src/modules/staff/lib/time-tracking-ui/CustomerPicker.tsx +427 -0
- package/src/modules/staff/lib/time-tracking-ui/DurationInput.tsx +192 -0
- package/src/modules/staff/lib/time-tracking-ui/EntryDetailsFields.tsx +224 -0
- package/src/modules/staff/lib/time-tracking-ui/EntryFilterBar.tsx +144 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanBoard.tsx +1065 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanCard.tsx +435 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanColumn.tsx +316 -0
- package/src/modules/staff/lib/time-tracking-ui/NewTaskDialog.tsx +291 -0
- package/src/modules/staff/lib/time-tracking-ui/NoProjectAccess.tsx +162 -0
- package/src/modules/staff/lib/time-tracking-ui/PeriodSelector.tsx +149 -0
- package/src/modules/staff/lib/time-tracking-ui/PhasePlaceholder.tsx +31 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectCodeField.tsx +230 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.tsx +432 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectFormSections.tsx +323 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.tsx +930 -0
- package/src/modules/staff/lib/time-tracking-ui/ReportSheet.tsx +357 -0
- package/src/modules/staff/lib/time-tracking-ui/TagPicker.tsx +195 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskBoardScreen.tsx +243 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskCommentThread.tsx +137 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskDrawer.tsx +1405 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskListView.tsx +260 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskPicker.tsx +435 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskQuickLog.tsx +296 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.tsx +97 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntryDialog.tsx +1929 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.tsx +126 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetCalendar.tsx +265 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.tsx +78 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.tsx +70 -0
- package/src/modules/staff/lib/time-tracking-ui/boardDirectory.ts +231 -0
- package/src/modules/staff/lib/time-tracking-ui/boardFilters.ts +128 -0
- package/src/modules/staff/lib/time-tracking-ui/boardSummary.ts +20 -0
- package/src/modules/staff/lib/time-tracking-ui/kanbanBoardData.ts +228 -0
- package/src/modules/staff/lib/time-tracking-ui/projectTeamAssignment.ts +143 -0
- package/src/modules/staff/lib/time-tracking-ui/taskDrawerData.ts +194 -0
- package/src/modules/staff/lib/time-tracking-ui/timeEntryDialogState.ts +400 -0
- package/src/modules/staff/lib/time-tracking-ui/timeEntryListData.ts +271 -0
- package/src/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.ts +168 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetData.ts +225 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetPeriod.ts +278 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetTargets.ts +93 -0
- package/src/modules/staff/lib/time-tracking-ui/useBoardFilters.ts +107 -0
- package/src/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.ts +245 -0
- package/src/modules/staff/lib/timeTrackingSeeds.ts +1037 -0
- package/src/modules/staff/lib/timesheets/timeEntryCacheInvalidation.ts +11 -10
- package/src/modules/staff/lib/timesheets/timeEntryDecoration.ts +256 -0
- package/src/modules/staff/lib/timesheets-projects/budgetBurn.ts +60 -0
- package/src/modules/staff/lib/timesheets-projects/budgetThreshold.ts +135 -0
- package/src/modules/staff/lib/timesheets-projects/budgetThresholdState.ts +137 -0
- package/src/modules/staff/lib/timesheets-projects/computeProjectFinancials.ts +142 -0
- package/src/modules/staff/lib/timesheets-projects/reportSelection.ts +82 -0
- package/src/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.tsx +237 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.tsx +33 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectCard.tsx +56 -1
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.tsx +90 -0
- package/src/modules/staff/lib/timesheets-reports/buildReportSheet.ts +125 -0
- package/src/modules/staff/lib/timesheets-reports/loadReportData.ts +251 -0
- package/src/modules/staff/lib/timesheets-reports/pdf.ts +263 -0
- package/src/modules/staff/lib/timesheets-reports/reportApprovalPolicies.ts +137 -0
- package/src/modules/staff/lib/timesheets-reports/reportConfigData.ts +247 -0
- package/src/modules/staff/lib/timesheets-reports/reportConfigState.ts +89 -0
- package/src/modules/staff/lib/timesheets-reports/reportExport.ts +373 -0
- package/src/modules/staff/lib/timesheets-reports/reportExportFormats.ts +71 -0
- package/src/modules/staff/lib/timesheets-reports/reportGroupings.ts +153 -0
- package/src/modules/staff/lib/timesheets-reports/reportLabels.ts +23 -0
- package/src/modules/staff/lib/timesheets-reports/reportReference.ts +146 -0
- package/src/modules/staff/lib/timesheets-reports/reportRows.ts +89 -0
- package/src/modules/staff/lib/timesheets-reports/reportSheetData.ts +196 -0
- package/src/modules/staff/lib/timesheets-reports/reportTotals.ts +544 -0
- package/src/modules/staff/lib/timesheets-reports/xlsx.ts +207 -0
- package/src/modules/staff/lib/timesheets-tasks/computeTaskRollups.ts +238 -0
- package/src/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.ts +90 -0
- package/src/modules/staff/lib/timesheets-tasks/seedProjectStatuses.ts +43 -0
- package/src/modules/staff/lib/timesheets-tasks/statusPositions.ts +132 -0
- package/src/modules/staff/lib/timesheets-tasks/statusSlug.ts +43 -0
- package/src/modules/staff/lib/timesheets-tasks/taskHierarchy.ts +99 -0
- package/src/modules/staff/lib/timesheets-tasks/taskHoursTotals.ts +42 -0
- package/src/modules/staff/lib/timesheets-tasks/taskReference.ts +108 -0
- package/src/modules/staff/lib/timesheets-ui/CreateProjectDialog.tsx +18 -4
- package/src/modules/staff/lib/timesheets-ui/ListView.tsx +504 -149
- package/src/modules/staff/lib/timesheets-ui/TimerBar.tsx +50 -2
- package/src/modules/staff/migrations/.snapshot-open-mercato.json +3244 -228
- package/src/modules/staff/migrations/Migration20260813073131_staff.ts +94 -0
- package/src/modules/staff/migrations/Migration20260824143357_staff.ts +17 -0
- package/src/modules/staff/notifications.client.ts +16 -0
- package/src/modules/staff/notifications.handlers.ts +88 -0
- package/src/modules/staff/notifications.ts +163 -0
- package/src/modules/staff/search.ts +191 -1
- package/src/modules/staff/setup.ts +22 -0
- package/src/modules/staff/subscribers/time-project-access-requested-notification.ts +95 -0
- package/src/modules/staff/subscribers/time-project-budget-threshold-notification.ts +226 -0
- package/src/modules/staff/subscribers/time-report-approved-notification.ts +116 -0
- package/src/modules/staff/subscribers/time-report-portal-broadcast.ts +120 -0
- package/src/modules/staff/translations.ts +17 -0
- package/src/modules/staff/widgets/components.ts +34 -0
- package/src/modules/staff/widgets/injection/timer-sidebar-indicator/widget.tsx +6 -5
- package/src/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.tsx +138 -0
- package/src/modules/staff/widgets/notifications/index.ts +1 -0
- package/src/modules/staff/workers/timesheets-reapply-rounding.ts +59 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/projectFormConfig.js +0 -123
- package/dist/modules/staff/backend/staff/timesheets/projects/projectFormConfig.js.map +0 -7
- package/src/modules/staff/backend/staff/timesheets/projects/projectFormConfig.ts +0 -138
|
@@ -1,780 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { permanentRedirect } from 'next/navigation'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { useRouter, useSearchParams } from 'next/navigation'
|
|
6
|
-
import type { LegacyColumnDef as ColumnDef } from '@tanstack/react-table/legacy'
|
|
7
|
-
import type { SortingState } from '@tanstack/react-table'
|
|
8
|
-
import { Page, PageBody } from '@open-mercato/ui/backend/Page'
|
|
9
|
-
import { DataTable, withDataTableNamespaces } from '@open-mercato/ui/backend/DataTable'
|
|
10
|
-
import type { FilterDef, FilterValues } from '@open-mercato/ui/backend/FilterOverlay'
|
|
11
|
-
import { RowActions } from '@open-mercato/ui/backend/RowActions'
|
|
12
|
-
import { Button } from '@open-mercato/ui/primitives/button'
|
|
13
|
-
import { readApiResultOrThrow, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'
|
|
14
|
-
import { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimisticLock'
|
|
15
|
-
import { surfaceRecordConflict } from '@open-mercato/ui/backend/conflicts'
|
|
16
|
-
import { deleteCrud } from '@open-mercato/ui/backend/utils/crud'
|
|
17
|
-
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
18
|
-
import { useConfirmDialog } from '@open-mercato/ui/backend/confirm-dialog'
|
|
19
|
-
import { useOrganizationScopeVersion } from '@open-mercato/shared/lib/frontend/useOrganizationScope'
|
|
20
|
-
import { useT, type TranslateFn } from '@open-mercato/shared/lib/i18n/context'
|
|
21
|
-
import { formatDateTime } from '@open-mercato/shared/lib/time'
|
|
22
|
-
import { ProjectColorDot } from '../../../../lib/timesheets-ui/ProjectColorDot'
|
|
23
|
-
import { resolveProjectColorHex } from '../../../../lib/timesheets-ui/colors'
|
|
24
|
-
import {
|
|
25
|
-
ProjectsKpiStrip,
|
|
26
|
-
type PmKpis,
|
|
27
|
-
type CollabKpis,
|
|
28
|
-
} from '../../../../lib/timesheets-projects-ui/ProjectsKpiStrip'
|
|
29
|
-
import { SavedViewTabs } from '../../../../lib/timesheets-projects-ui/SavedViewTabs'
|
|
30
|
-
import { HoursSparkline } from '../../../../lib/timesheets-projects-ui/HoursSparkline'
|
|
31
|
-
import {
|
|
32
|
-
ProjectMembersAvatarStack,
|
|
33
|
-
type AvatarMember,
|
|
34
|
-
} from '../../../../lib/timesheets-projects-ui/ProjectMembersAvatarStack'
|
|
35
|
-
import { ViewModeToggle } from '../../../../lib/timesheets-projects-ui/ViewModeToggle'
|
|
36
|
-
import {
|
|
37
|
-
useProjectsViewMode,
|
|
38
|
-
type ProjectsViewMode,
|
|
39
|
-
} from '../../../../lib/timesheets-projects-ui/useProjectsViewMode'
|
|
40
|
-
import {
|
|
41
|
-
ProjectCard,
|
|
42
|
-
type ProjectCardData,
|
|
43
|
-
type ProjectCardLabels,
|
|
44
|
-
} from '../../../../lib/timesheets-projects-ui/ProjectCard'
|
|
45
|
-
import { createLogger } from '@open-mercato/shared/lib/logger'
|
|
46
|
-
|
|
47
|
-
const logger = createLogger('staff')
|
|
48
|
-
|
|
49
|
-
const PAGE_SIZE = 50
|
|
50
|
-
const INCLUDE_FIELDS = 'hoursWeek,hoursTrend,members,myRole'
|
|
51
|
-
|
|
52
|
-
type StaffEnrichment = {
|
|
53
|
-
hoursWeek?: number
|
|
54
|
-
hoursTrend?: number[]
|
|
55
|
-
myRole?: string | null
|
|
56
|
-
members?: AvatarMember[]
|
|
57
|
-
memberCount?: number
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
type ProjectRow = {
|
|
61
|
-
id: string
|
|
62
|
-
name: string
|
|
63
|
-
code: string | null
|
|
64
|
-
customerId: string | null
|
|
65
|
-
customerName: string | null
|
|
66
|
-
status: string
|
|
67
|
-
projectType: string | null
|
|
68
|
-
color: string | null
|
|
69
|
-
startDate: string | null
|
|
70
|
-
updatedAt: string | null
|
|
71
|
-
hoursWeek: number
|
|
72
|
-
hoursTrend: number[]
|
|
73
|
-
myRole: string | null
|
|
74
|
-
members: AvatarMember[]
|
|
75
|
-
memberCount: number
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
type ProjectsResponse = {
|
|
79
|
-
items?: Array<Record<string, unknown>>
|
|
80
|
-
total?: number
|
|
81
|
-
totalPages?: number
|
|
82
|
-
totalIsCapped?: boolean
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
type KpisResponse = PmKpis | CollabKpis
|
|
86
|
-
|
|
87
|
-
function formatRelativeTime(iso: string | null, fallback: string, t: TranslateFn): string {
|
|
88
|
-
if (!iso) return fallback
|
|
89
|
-
const parsed = new Date(iso)
|
|
90
|
-
if (Number.isNaN(parsed.getTime())) return fallback
|
|
91
|
-
const diffMs = Date.now() - parsed.getTime()
|
|
92
|
-
const minutes = Math.round(diffMs / 60000)
|
|
93
|
-
if (minutes < 1) return t('staff.timesheets.projects.portfolio.relativeTime.justNow', 'just now')
|
|
94
|
-
if (minutes < 60) return t('staff.timesheets.projects.portfolio.relativeTime.minutesAgo', '{minutes}m ago', { minutes })
|
|
95
|
-
const hours = Math.round(minutes / 60)
|
|
96
|
-
if (hours < 24) return t('staff.timesheets.projects.portfolio.relativeTime.hoursAgo', '{hours}h ago', { hours })
|
|
97
|
-
const days = Math.round(hours / 24)
|
|
98
|
-
if (days < 14) return t('staff.timesheets.projects.portfolio.relativeTime.daysAgo', '{days}d ago', { days })
|
|
99
|
-
return formatDateTime(iso) ?? fallback
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function mapApiProject(item: Record<string, unknown>): ProjectRow {
|
|
103
|
-
const id = typeof item.id === 'string' ? item.id : ''
|
|
104
|
-
const name = typeof item.name === 'string' ? item.name : id
|
|
105
|
-
const code = typeof item.code === 'string' && item.code.trim().length ? item.code.trim() : null
|
|
106
|
-
const customerId =
|
|
107
|
-
typeof item.customerId === 'string'
|
|
108
|
-
? item.customerId
|
|
109
|
-
: typeof item.customer_id === 'string'
|
|
110
|
-
? item.customer_id
|
|
111
|
-
: null
|
|
112
|
-
const customerName =
|
|
113
|
-
typeof item.customerName === 'string'
|
|
114
|
-
? item.customerName
|
|
115
|
-
: typeof item.customer_name === 'string'
|
|
116
|
-
? item.customer_name
|
|
117
|
-
: null
|
|
118
|
-
const status = typeof item.status === 'string' ? item.status : 'active'
|
|
119
|
-
const projectType =
|
|
120
|
-
typeof item.projectType === 'string'
|
|
121
|
-
? item.projectType
|
|
122
|
-
: typeof item.project_type === 'string'
|
|
123
|
-
? item.project_type
|
|
124
|
-
: null
|
|
125
|
-
const color = typeof item.color === 'string' ? item.color : null
|
|
126
|
-
const startDate =
|
|
127
|
-
typeof item.startDate === 'string'
|
|
128
|
-
? item.startDate
|
|
129
|
-
: typeof item.start_date === 'string'
|
|
130
|
-
? item.start_date
|
|
131
|
-
: null
|
|
132
|
-
const updatedAt =
|
|
133
|
-
typeof item.updatedAt === 'string'
|
|
134
|
-
? item.updatedAt
|
|
135
|
-
: typeof item.updated_at === 'string'
|
|
136
|
-
? item.updated_at
|
|
137
|
-
: null
|
|
138
|
-
const enrichment =
|
|
139
|
-
(item as { _staff?: StaffEnrichment })._staff ?? ({} as StaffEnrichment)
|
|
140
|
-
const hoursWeek = typeof enrichment.hoursWeek === 'number' ? enrichment.hoursWeek : 0
|
|
141
|
-
const hoursTrend = Array.isArray(enrichment.hoursTrend)
|
|
142
|
-
? enrichment.hoursTrend.filter((v): v is number => typeof v === 'number')
|
|
143
|
-
: []
|
|
144
|
-
const members = Array.isArray(enrichment.members)
|
|
145
|
-
? enrichment.members
|
|
146
|
-
.filter((m): m is AvatarMember => !!m && typeof m === 'object' && typeof (m as AvatarMember).id === 'string')
|
|
147
|
-
.map((m) => ({
|
|
148
|
-
id: m.id,
|
|
149
|
-
name: m.name ?? '',
|
|
150
|
-
initials: m.initials ?? '',
|
|
151
|
-
avatarUrl: m.avatarUrl ?? null,
|
|
152
|
-
}))
|
|
153
|
-
: []
|
|
154
|
-
const memberCount = typeof enrichment.memberCount === 'number' ? enrichment.memberCount : members.length
|
|
155
|
-
const myRole = typeof enrichment.myRole === 'string' ? enrichment.myRole : null
|
|
156
|
-
|
|
157
|
-
return withDataTableNamespaces(
|
|
158
|
-
{
|
|
159
|
-
id,
|
|
160
|
-
name,
|
|
161
|
-
code,
|
|
162
|
-
customerId,
|
|
163
|
-
customerName,
|
|
164
|
-
status,
|
|
165
|
-
projectType,
|
|
166
|
-
color,
|
|
167
|
-
startDate,
|
|
168
|
-
updatedAt,
|
|
169
|
-
hoursWeek,
|
|
170
|
-
hoursTrend,
|
|
171
|
-
myRole,
|
|
172
|
-
members,
|
|
173
|
-
memberCount,
|
|
174
|
-
},
|
|
175
|
-
item,
|
|
176
|
-
)
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export default function TimesheetProjectsPage() {
|
|
180
|
-
const t = useT()
|
|
181
|
-
const router = useRouter()
|
|
182
|
-
const searchParams = useSearchParams()
|
|
183
|
-
const scopeVersion = useOrganizationScopeVersion()
|
|
184
|
-
const { confirm, ConfirmDialogElement } = useConfirmDialog()
|
|
185
|
-
|
|
186
|
-
const [rows, setRows] = React.useState<ProjectRow[]>([])
|
|
187
|
-
const [page, setPage] = React.useState(1)
|
|
188
|
-
const [total, setTotal] = React.useState(0)
|
|
189
|
-
const [totalPages, setTotalPages] = React.useState(1)
|
|
190
|
-
const [totalIsCapped, setTotalIsCapped] = React.useState(false)
|
|
191
|
-
const [sorting, setSorting] = React.useState<SortingState>([{ id: 'updatedAt', desc: true }])
|
|
192
|
-
const [search, setSearch] = React.useState('')
|
|
193
|
-
const [filterValues, setFilterValues] = React.useState<FilterValues>({})
|
|
194
|
-
const [isLoading, setIsLoading] = React.useState(true)
|
|
195
|
-
const [isRefreshing, setIsRefreshing] = React.useState(false)
|
|
196
|
-
const hasLoadedOnceRef = React.useRef(false)
|
|
197
|
-
const [reloadToken, setReloadToken] = React.useState(0)
|
|
198
|
-
const [kpis, setKpis] = React.useState<KpisResponse | null>(null)
|
|
199
|
-
const [isLoadingKpis, setIsLoadingKpis] = React.useState(true)
|
|
200
|
-
|
|
201
|
-
const activeTab = searchParams.get('tab') ?? 'all'
|
|
202
|
-
const urlViewMode = searchParams.get('view')
|
|
203
|
-
const [viewMode, setViewMode] = useProjectsViewMode({
|
|
204
|
-
userKey: null,
|
|
205
|
-
urlOverride: urlViewMode,
|
|
206
|
-
})
|
|
207
|
-
|
|
208
|
-
const labels = React.useMemo(
|
|
209
|
-
() => ({
|
|
210
|
-
title: t('staff.timesheets.projects.page.title', 'Projects'),
|
|
211
|
-
table: {
|
|
212
|
-
name: t('staff.timesheets.projects.table.name', 'Project'),
|
|
213
|
-
status: t('staff.timesheets.projects.table.status', 'Status'),
|
|
214
|
-
type: t('staff.timesheets.projects.table.type', 'Type'),
|
|
215
|
-
updatedAt: t('staff.timesheets.projects.table.updatedAt', 'Updated'),
|
|
216
|
-
empty: t('staff.timesheets.projects.table.empty', 'No projects yet.'),
|
|
217
|
-
search: t('staff.timesheets.projects.table.search', 'Search projects...'),
|
|
218
|
-
team: t('staff.timesheets.projects.portfolio.team', 'Team'),
|
|
219
|
-
myRole: t('staff.timesheets.projects.portfolio.myRole', 'My role'),
|
|
220
|
-
hoursWeek: t('staff.timesheets.projects.portfolio.hoursWeek', 'Hours / week'),
|
|
221
|
-
myHoursWeek: t('staff.timesheets.projects.portfolio.myHoursWeek', 'My hours / week'),
|
|
222
|
-
},
|
|
223
|
-
actions: {
|
|
224
|
-
add: t('staff.timesheets.projects.actions.add', 'Add Project'),
|
|
225
|
-
addFirst: t('staff.timesheets.projects.actions.addFirst', '+ Add first project'),
|
|
226
|
-
viewDetails: t('staff.timesheets.projects.actions.viewDetails', 'View Details'),
|
|
227
|
-
delete: t('staff.timesheets.projects.actions.delete', 'Delete'),
|
|
228
|
-
deleteConfirm: t('staff.timesheets.projects.actions.deleteConfirm', 'Delete project "{{name}}"?'),
|
|
229
|
-
refresh: t('staff.timesheets.projects.actions.refresh', 'Refresh'),
|
|
230
|
-
},
|
|
231
|
-
messages: {
|
|
232
|
-
deleted: t('staff.timesheets.projects.messages.deleted', 'Project deleted.'),
|
|
233
|
-
},
|
|
234
|
-
errors: {
|
|
235
|
-
load: t('staff.timesheets.projects.errors.load', 'Failed to load projects.'),
|
|
236
|
-
delete: t('staff.timesheets.projects.errors.delete', 'Failed to delete project.'),
|
|
237
|
-
},
|
|
238
|
-
statuses: {
|
|
239
|
-
all: t('staff.timesheets.projects.statuses.all', 'All'),
|
|
240
|
-
active: t('staff.timesheets.projects.statuses.active', 'Active'),
|
|
241
|
-
on_hold: t('staff.timesheets.projects.statuses.onHold', 'On Hold'),
|
|
242
|
-
completed: t('staff.timesheets.projects.statuses.completed', 'Completed'),
|
|
243
|
-
},
|
|
244
|
-
tabs: {
|
|
245
|
-
all: t('staff.timesheets.projects.portfolio.tabs.all', 'All'),
|
|
246
|
-
active: t('staff.timesheets.projects.portfolio.tabs.active', 'Active'),
|
|
247
|
-
onHold: t('staff.timesheets.projects.portfolio.tabs.onHold', 'On Hold'),
|
|
248
|
-
completed: t('staff.timesheets.projects.portfolio.tabs.completed', 'Completed'),
|
|
249
|
-
mine: t('staff.timesheets.projects.portfolio.tabs.mine', 'Mine'),
|
|
250
|
-
},
|
|
251
|
-
viewMode: {
|
|
252
|
-
table: t('staff.timesheets.projects.portfolio.viewMode.table', 'Table'),
|
|
253
|
-
cards: t('staff.timesheets.projects.portfolio.viewMode.cards', 'Cards'),
|
|
254
|
-
},
|
|
255
|
-
kpi: {
|
|
256
|
-
totalProjects: t('staff.timesheets.projects.portfolio.kpi.totalProjects', 'Total Projects'),
|
|
257
|
-
hoursWeek: t('staff.timesheets.projects.portfolio.kpi.hoursWeek', 'Hours this week'),
|
|
258
|
-
hoursWeekSub: t('staff.timesheets.projects.portfolio.kpi.hoursWeekSub', 'vs previous week'),
|
|
259
|
-
assignedToMe: t('staff.timesheets.projects.portfolio.kpi.assignedToMe', 'Assigned to me'),
|
|
260
|
-
hoursMonth: t('staff.timesheets.projects.portfolio.kpi.hoursMonth', 'Hours this month'),
|
|
261
|
-
hoursMonthSub: t('staff.timesheets.projects.portfolio.kpi.hoursMonthSub', 'vs previous month'),
|
|
262
|
-
teamActive: t('staff.timesheets.projects.portfolio.kpi.teamActive', 'Active team'),
|
|
263
|
-
teamActiveSub: t('staff.timesheets.projects.portfolio.kpi.teamActiveSub', 'Members with entries this month'),
|
|
264
|
-
myProjects: t('staff.timesheets.projects.portfolio.kpi.myProjects', 'My projects'),
|
|
265
|
-
myHoursWeek: t('staff.timesheets.projects.portfolio.kpi.myHoursWeek', 'My hours this week'),
|
|
266
|
-
myHoursMonth: t('staff.timesheets.projects.portfolio.kpi.myHoursMonth', 'My hours this month'),
|
|
267
|
-
deltaFlat: t('staff.timesheets.projects.portfolio.kpi.deltaFlat', 'no change'),
|
|
268
|
-
noPrevious: t('staff.timesheets.projects.portfolio.kpi.noPrevious', 'no previous data'),
|
|
269
|
-
},
|
|
270
|
-
card: {
|
|
271
|
-
hoursPanelPm: t('staff.timesheets.projects.portfolio.card.hoursPanelPm', 'Team hours · last 7w'),
|
|
272
|
-
hoursPanelCollab: t('staff.timesheets.projects.portfolio.card.hoursPanelCollab', 'My hours · last 7w'),
|
|
273
|
-
sparklineAria: t('staff.timesheets.projects.portfolio.sparkline.ariaLabel', 'Hours per week, last 7 weeks'),
|
|
274
|
-
role: t('staff.timesheets.projects.portfolio.card.role', 'Role'),
|
|
275
|
-
},
|
|
276
|
-
emptyState: {
|
|
277
|
-
noProjects: t('staff.timesheets.projects.portfolio.emptyState.noProjects', 'No projects yet.'),
|
|
278
|
-
noAssignments: t(
|
|
279
|
-
'staff.timesheets.projects.portfolio.emptyState.noAssignments',
|
|
280
|
-
"You aren't assigned to any projects yet. Ask a PM to add you.",
|
|
281
|
-
),
|
|
282
|
-
noMatches: t('staff.timesheets.projects.portfolio.emptyState.noMatches', 'No projects match these filters.'),
|
|
283
|
-
},
|
|
284
|
-
}),
|
|
285
|
-
[t],
|
|
286
|
-
)
|
|
287
|
-
|
|
288
|
-
const kpiLabels = React.useMemo(
|
|
289
|
-
() => ({
|
|
290
|
-
totalProjects: labels.kpi.totalProjects,
|
|
291
|
-
totalProjectsSub: ({ active, onHold }: { active: number; onHold: number }) =>
|
|
292
|
-
`${active} ${labels.statuses.active.toLowerCase()} · ${onHold} ${labels.statuses.on_hold.toLowerCase()}`,
|
|
293
|
-
hoursWeek: labels.kpi.hoursWeek,
|
|
294
|
-
hoursWeekSub: labels.kpi.hoursWeekSub,
|
|
295
|
-
assignedToMe: labels.kpi.assignedToMe,
|
|
296
|
-
assignedToMeSub: (active: number) => `${active} ${labels.statuses.active.toLowerCase()}`,
|
|
297
|
-
hoursMonth: labels.kpi.hoursMonth,
|
|
298
|
-
hoursMonthSub: labels.kpi.hoursMonthSub,
|
|
299
|
-
teamActive: labels.kpi.teamActive,
|
|
300
|
-
teamActiveSub: labels.kpi.teamActiveSub,
|
|
301
|
-
myProjects: labels.kpi.myProjects,
|
|
302
|
-
myProjectsSub: (active: number) => `${active} ${labels.statuses.active.toLowerCase()}`,
|
|
303
|
-
myHoursWeek: labels.kpi.myHoursWeek,
|
|
304
|
-
myHoursMonth: labels.kpi.myHoursMonth,
|
|
305
|
-
deltaUp: (pct: number) => `up ${pct}%`,
|
|
306
|
-
deltaDown: (pct: number) => `down ${pct}%`,
|
|
307
|
-
deltaFlat: labels.kpi.deltaFlat,
|
|
308
|
-
noPrevious: labels.kpi.noPrevious,
|
|
309
|
-
}),
|
|
310
|
-
[labels],
|
|
311
|
-
)
|
|
312
|
-
|
|
313
|
-
const isPmRole = kpis?.role === 'pm'
|
|
314
|
-
|
|
315
|
-
const filters = React.useMemo<FilterDef[]>(
|
|
316
|
-
() => [
|
|
317
|
-
{
|
|
318
|
-
id: 'status',
|
|
319
|
-
label: labels.table.status,
|
|
320
|
-
type: 'select',
|
|
321
|
-
options: [
|
|
322
|
-
{ value: 'active', label: labels.statuses.active },
|
|
323
|
-
{ value: 'on_hold', label: labels.statuses.on_hold },
|
|
324
|
-
{ value: 'completed', label: labels.statuses.completed },
|
|
325
|
-
],
|
|
326
|
-
},
|
|
327
|
-
],
|
|
328
|
-
[labels.table.status, labels.statuses],
|
|
329
|
-
)
|
|
330
|
-
|
|
331
|
-
const tabs = React.useMemo(() => {
|
|
332
|
-
const base = [
|
|
333
|
-
{ id: 'all', label: labels.tabs.all },
|
|
334
|
-
{ id: 'active', label: labels.tabs.active },
|
|
335
|
-
]
|
|
336
|
-
if (isPmRole) {
|
|
337
|
-
base.push({ id: 'on_hold', label: labels.tabs.onHold })
|
|
338
|
-
}
|
|
339
|
-
base.push({ id: 'completed', label: labels.tabs.completed })
|
|
340
|
-
if (isPmRole) {
|
|
341
|
-
base.push({ id: 'mine', label: labels.tabs.mine })
|
|
342
|
-
}
|
|
343
|
-
return base
|
|
344
|
-
}, [labels.tabs, isPmRole])
|
|
345
|
-
|
|
346
|
-
const statusFromTab = (tabId: string): string | null => {
|
|
347
|
-
if (tabId === 'active' || tabId === 'on_hold' || tabId === 'completed') return tabId
|
|
348
|
-
return null
|
|
349
|
-
}
|
|
350
|
-
const mineFromTab = (tabId: string): boolean => tabId === 'mine' || !isPmRole
|
|
351
|
-
|
|
352
|
-
const loadKpis = React.useCallback(async () => {
|
|
353
|
-
setIsLoadingKpis(true)
|
|
354
|
-
try {
|
|
355
|
-
const payload = await readApiResultOrThrow<KpisResponse>(
|
|
356
|
-
'/api/staff/timesheets/projects/kpis',
|
|
357
|
-
undefined,
|
|
358
|
-
{
|
|
359
|
-
errorMessage: labels.errors.load,
|
|
360
|
-
fallback: null as unknown as KpisResponse,
|
|
361
|
-
},
|
|
362
|
-
)
|
|
363
|
-
setKpis(payload)
|
|
364
|
-
} catch {
|
|
365
|
-
setKpis(null)
|
|
366
|
-
} finally {
|
|
367
|
-
setIsLoadingKpis(false)
|
|
368
|
-
}
|
|
369
|
-
}, [labels.errors.load])
|
|
370
|
-
|
|
371
|
-
const loadProjects = React.useCallback(async () => {
|
|
372
|
-
if (hasLoadedOnceRef.current) {
|
|
373
|
-
setIsRefreshing(true)
|
|
374
|
-
} else {
|
|
375
|
-
setIsLoading(true)
|
|
376
|
-
}
|
|
377
|
-
try {
|
|
378
|
-
const params = new URLSearchParams({
|
|
379
|
-
page: String(page),
|
|
380
|
-
pageSize: String(PAGE_SIZE),
|
|
381
|
-
include: INCLUDE_FIELDS,
|
|
382
|
-
})
|
|
383
|
-
const sort = sorting[0]
|
|
384
|
-
if (sort?.id) {
|
|
385
|
-
params.set('sortField', sort.id)
|
|
386
|
-
params.set('sortDir', sort.desc ? 'desc' : 'asc')
|
|
387
|
-
}
|
|
388
|
-
if (search.trim()) params.set('q', search.trim())
|
|
389
|
-
const tabStatus = statusFromTab(activeTab)
|
|
390
|
-
if (tabStatus) params.set('status', tabStatus)
|
|
391
|
-
else if (typeof filterValues.status === 'string' && filterValues.status.length > 0) {
|
|
392
|
-
params.set('status', filterValues.status)
|
|
393
|
-
}
|
|
394
|
-
if (mineFromTab(activeTab)) params.set('mine', '1')
|
|
395
|
-
|
|
396
|
-
const payload = await readApiResultOrThrow<ProjectsResponse>(
|
|
397
|
-
`/api/staff/timesheets/time-projects?${params.toString()}`,
|
|
398
|
-
undefined,
|
|
399
|
-
{ errorMessage: labels.errors.load, fallback: { items: [], total: 0, totalPages: 1 } },
|
|
400
|
-
)
|
|
401
|
-
const items = Array.isArray(payload.items) ? payload.items : []
|
|
402
|
-
setRows(items.map(mapApiProject))
|
|
403
|
-
setTotal(typeof payload.total === 'number' ? payload.total : items.length)
|
|
404
|
-
setTotalPages(
|
|
405
|
-
typeof payload.totalPages === 'number'
|
|
406
|
-
? payload.totalPages
|
|
407
|
-
: Math.max(1, Math.ceil(items.length / PAGE_SIZE)),
|
|
408
|
-
)
|
|
409
|
-
setTotalIsCapped(payload.totalIsCapped === true)
|
|
410
|
-
} catch (error) {
|
|
411
|
-
logger.error('staff.timesheets.projects.list', { err: error })
|
|
412
|
-
flash(labels.errors.load, 'error')
|
|
413
|
-
} finally {
|
|
414
|
-
setIsLoading(false)
|
|
415
|
-
setIsRefreshing(false)
|
|
416
|
-
hasLoadedOnceRef.current = true
|
|
417
|
-
}
|
|
418
|
-
}, [labels.errors.load, page, search, sorting, filterValues.status, activeTab, isPmRole])
|
|
419
|
-
|
|
420
|
-
React.useEffect(() => {
|
|
421
|
-
void loadKpis()
|
|
422
|
-
}, [loadKpis, scopeVersion, reloadToken])
|
|
423
|
-
|
|
424
|
-
React.useEffect(() => {
|
|
425
|
-
void loadProjects()
|
|
426
|
-
}, [loadProjects, scopeVersion, reloadToken])
|
|
427
|
-
|
|
428
|
-
const handleTabSelect = React.useCallback(
|
|
429
|
-
(id: string) => {
|
|
430
|
-
const params = new URLSearchParams(searchParams.toString())
|
|
431
|
-
if (id === 'all') params.delete('tab')
|
|
432
|
-
else params.set('tab', id)
|
|
433
|
-
router.replace(`?${params.toString()}`)
|
|
434
|
-
setPage(1)
|
|
435
|
-
},
|
|
436
|
-
[router, searchParams],
|
|
437
|
-
)
|
|
438
|
-
|
|
439
|
-
const handleViewModeChange = React.useCallback(
|
|
440
|
-
(next: ProjectsViewMode) => {
|
|
441
|
-
setViewMode(next)
|
|
442
|
-
const params = new URLSearchParams(searchParams.toString())
|
|
443
|
-
if (next === 'table') params.delete('view')
|
|
444
|
-
else params.set('view', next)
|
|
445
|
-
router.replace(`?${params.toString()}`)
|
|
446
|
-
},
|
|
447
|
-
[router, searchParams, setViewMode],
|
|
448
|
-
)
|
|
449
|
-
|
|
450
|
-
const handleSearchChange = React.useCallback((value: string) => {
|
|
451
|
-
setSearch(value)
|
|
452
|
-
setPage(1)
|
|
453
|
-
}, [])
|
|
454
|
-
|
|
455
|
-
const handleFiltersApply = React.useCallback((values: FilterValues) => {
|
|
456
|
-
setFilterValues(values)
|
|
457
|
-
setPage(1)
|
|
458
|
-
}, [])
|
|
459
|
-
|
|
460
|
-
const handleFiltersClear = React.useCallback(() => {
|
|
461
|
-
setFilterValues({})
|
|
462
|
-
setPage(1)
|
|
463
|
-
}, [])
|
|
464
|
-
|
|
465
|
-
const handleRefresh = React.useCallback(() => {
|
|
466
|
-
setReloadToken((token) => token + 1)
|
|
467
|
-
}, [])
|
|
468
|
-
|
|
469
|
-
const handleDelete = React.useCallback(
|
|
470
|
-
async (entry: ProjectRow) => {
|
|
471
|
-
const message = labels.actions.deleteConfirm.replace('{{name}}', entry.name)
|
|
472
|
-
const confirmed = await confirm({
|
|
473
|
-
title: labels.actions.delete,
|
|
474
|
-
text: message,
|
|
475
|
-
variant: 'destructive',
|
|
476
|
-
})
|
|
477
|
-
if (!confirmed) return
|
|
478
|
-
try {
|
|
479
|
-
await withScopedApiRequestHeaders(
|
|
480
|
-
buildOptimisticLockHeader(entry.updatedAt),
|
|
481
|
-
() => deleteCrud('staff/timesheets/time-projects', entry.id, { errorMessage: labels.errors.delete }),
|
|
482
|
-
)
|
|
483
|
-
flash(labels.messages.deleted, 'success')
|
|
484
|
-
handleRefresh()
|
|
485
|
-
} catch (error) {
|
|
486
|
-
if (surfaceRecordConflict(error, t)) { handleRefresh(); return }
|
|
487
|
-
logger.error('staff.timesheets.projects.delete', { err: error })
|
|
488
|
-
flash(labels.errors.delete, 'error')
|
|
489
|
-
}
|
|
490
|
-
},
|
|
491
|
-
[confirm, handleRefresh, t, labels.actions.deleteConfirm, labels.actions.delete, labels.errors.delete, labels.messages.deleted],
|
|
492
|
-
)
|
|
493
|
-
|
|
494
|
-
const columns = React.useMemo<ColumnDef<ProjectRow>[]>(
|
|
495
|
-
() => [
|
|
496
|
-
{
|
|
497
|
-
accessorKey: 'name',
|
|
498
|
-
header: labels.table.name,
|
|
499
|
-
meta: { priority: 1, sticky: true },
|
|
500
|
-
cell: ({ row }) => (
|
|
501
|
-
<div className="flex items-center gap-2.5">
|
|
502
|
-
<ProjectColorDot colorKey={row.original.color} projectName={row.original.name} size="sm" />
|
|
503
|
-
<div className="flex min-w-0 flex-col">
|
|
504
|
-
<span className="truncate text-sm font-medium text-foreground">{row.original.name}</span>
|
|
505
|
-
<span className="truncate font-mono text-[11px] text-muted-foreground">
|
|
506
|
-
{row.original.code ?? '—'}
|
|
507
|
-
{row.original.customerName ? ` · ${row.original.customerName}` : ''}
|
|
508
|
-
</span>
|
|
509
|
-
</div>
|
|
510
|
-
</div>
|
|
511
|
-
),
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
accessorKey: 'status',
|
|
515
|
-
header: labels.table.status,
|
|
516
|
-
meta: { priority: 2 },
|
|
517
|
-
cell: ({ row }) => {
|
|
518
|
-
const badgeClass =
|
|
519
|
-
row.original.status === 'active'
|
|
520
|
-
? 'bg-lime-100 text-lime-800 dark:bg-lime-900/30 dark:text-lime-300'
|
|
521
|
-
: row.original.status === 'on_hold'
|
|
522
|
-
? 'bg-amber-100 text-amber-800 dark:bg-amber-900/30 dark:text-amber-300'
|
|
523
|
-
: 'bg-muted text-muted-foreground'
|
|
524
|
-
const statusLabel =
|
|
525
|
-
labels.statuses[row.original.status as keyof typeof labels.statuses] ?? row.original.status
|
|
526
|
-
return (
|
|
527
|
-
<span
|
|
528
|
-
className={`inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium ${badgeClass}`}
|
|
529
|
-
>
|
|
530
|
-
{statusLabel}
|
|
531
|
-
</span>
|
|
532
|
-
)
|
|
533
|
-
},
|
|
534
|
-
},
|
|
535
|
-
{
|
|
536
|
-
accessorKey: 'projectType',
|
|
537
|
-
header: labels.table.type,
|
|
538
|
-
meta: { priority: 3 },
|
|
539
|
-
cell: ({ row }) =>
|
|
540
|
-
row.original.projectType ? (
|
|
541
|
-
<span className="text-sm text-foreground">{row.original.projectType}</span>
|
|
542
|
-
) : (
|
|
543
|
-
<span className="text-xs text-muted-foreground/70">—</span>
|
|
544
|
-
),
|
|
545
|
-
},
|
|
546
|
-
isPmRole
|
|
547
|
-
? {
|
|
548
|
-
accessorKey: 'members',
|
|
549
|
-
id: 'members',
|
|
550
|
-
header: labels.table.team,
|
|
551
|
-
enableSorting: false,
|
|
552
|
-
meta: { priority: 4 },
|
|
553
|
-
cell: ({ row }) => (
|
|
554
|
-
<ProjectMembersAvatarStack
|
|
555
|
-
members={row.original.members}
|
|
556
|
-
total={row.original.memberCount}
|
|
557
|
-
peopleCountLabel={`${row.original.memberCount}`}
|
|
558
|
-
/>
|
|
559
|
-
),
|
|
560
|
-
}
|
|
561
|
-
: {
|
|
562
|
-
accessorKey: 'myRole',
|
|
563
|
-
header: labels.table.myRole,
|
|
564
|
-
enableSorting: false,
|
|
565
|
-
meta: { priority: 4 },
|
|
566
|
-
cell: ({ row }) =>
|
|
567
|
-
row.original.myRole ? (
|
|
568
|
-
<span className="text-sm text-foreground">{row.original.myRole}</span>
|
|
569
|
-
) : (
|
|
570
|
-
<span className="text-xs text-muted-foreground/70">—</span>
|
|
571
|
-
),
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
accessorKey: 'hoursWeek',
|
|
575
|
-
header: isPmRole ? labels.table.hoursWeek : labels.table.myHoursWeek,
|
|
576
|
-
enableSorting: false,
|
|
577
|
-
meta: { priority: 5 },
|
|
578
|
-
cell: ({ row }) => {
|
|
579
|
-
const stripe = resolveProjectColorHex(row.original.color, row.original.name)
|
|
580
|
-
return (
|
|
581
|
-
<div className="flex items-center justify-end gap-2">
|
|
582
|
-
<HoursSparkline
|
|
583
|
-
values={row.original.hoursTrend}
|
|
584
|
-
color={stripe}
|
|
585
|
-
ariaLabel={labels.card.sparklineAria}
|
|
586
|
-
/>
|
|
587
|
-
<span className="text-xs font-medium tabular-nums text-foreground">
|
|
588
|
-
{row.original.hoursWeek > 0 ? `${row.original.hoursWeek}h` : '—'}
|
|
589
|
-
</span>
|
|
590
|
-
</div>
|
|
591
|
-
)
|
|
592
|
-
},
|
|
593
|
-
},
|
|
594
|
-
{
|
|
595
|
-
accessorKey: 'updatedAt',
|
|
596
|
-
header: labels.table.updatedAt,
|
|
597
|
-
meta: { priority: 6 },
|
|
598
|
-
cell: ({ row }) => (
|
|
599
|
-
<span className="text-xs text-muted-foreground">
|
|
600
|
-
{formatRelativeTime(row.original.updatedAt, '—', t)}
|
|
601
|
-
</span>
|
|
602
|
-
),
|
|
603
|
-
},
|
|
604
|
-
],
|
|
605
|
-
[labels.table, labels.statuses, labels.card.sparklineAria, isPmRole],
|
|
606
|
-
)
|
|
607
|
-
|
|
608
|
-
const cardLabels = React.useMemo<ProjectCardLabels>(
|
|
609
|
-
() => ({
|
|
610
|
-
hoursPanelPm: labels.card.hoursPanelPm,
|
|
611
|
-
hoursPanelCollab: labels.card.hoursPanelCollab,
|
|
612
|
-
sparklineAria: labels.card.sparklineAria,
|
|
613
|
-
peopleCount: (count: number) => `${count}`,
|
|
614
|
-
role: labels.card.role,
|
|
615
|
-
noCustomer: '—',
|
|
616
|
-
statuses: labels.statuses,
|
|
617
|
-
}),
|
|
618
|
-
[labels.card, labels.statuses],
|
|
619
|
-
)
|
|
620
|
-
|
|
621
|
-
const canManage = isPmRole
|
|
622
|
-
|
|
623
|
-
const emptyStateCopy = React.useMemo(() => {
|
|
624
|
-
const hasFiltersApplied = activeTab !== 'all' || search.trim().length > 0 || Object.values(filterValues).some(Boolean)
|
|
625
|
-
if (hasFiltersApplied) return labels.emptyState.noMatches
|
|
626
|
-
if (!canManage) return labels.emptyState.noAssignments
|
|
627
|
-
return labels.emptyState.noProjects
|
|
628
|
-
}, [activeTab, search, filterValues, canManage, labels.emptyState])
|
|
629
|
-
|
|
630
|
-
const cardsData: ProjectCardData[] = rows.map((row) => ({
|
|
631
|
-
id: row.id,
|
|
632
|
-
name: row.name,
|
|
633
|
-
code: row.code,
|
|
634
|
-
customerName: row.customerName,
|
|
635
|
-
color: row.color,
|
|
636
|
-
status: row.status,
|
|
637
|
-
hoursWeek: row.hoursWeek,
|
|
638
|
-
hoursTrend: row.hoursTrend,
|
|
639
|
-
members: row.members,
|
|
640
|
-
memberCount: row.memberCount,
|
|
641
|
-
myRole: row.myRole,
|
|
642
|
-
updatedAt: row.updatedAt,
|
|
643
|
-
}))
|
|
644
|
-
|
|
645
|
-
return (
|
|
646
|
-
<Page>
|
|
647
|
-
<PageBody>
|
|
648
|
-
<div className="mb-4">
|
|
649
|
-
<ProjectsKpiStrip kpis={kpis} labels={kpiLabels} isLoading={isLoadingKpis} />
|
|
650
|
-
</div>
|
|
651
|
-
|
|
652
|
-
<div className="mb-3 flex flex-wrap items-center justify-between gap-3">
|
|
653
|
-
<SavedViewTabs
|
|
654
|
-
tabs={tabs}
|
|
655
|
-
activeId={activeTab}
|
|
656
|
-
onSelect={handleTabSelect}
|
|
657
|
-
ariaLabel={t('staff.timesheets.projects.portfolio.savedViews.ariaLabel', 'Saved views')}
|
|
658
|
-
/>
|
|
659
|
-
<ViewModeToggle
|
|
660
|
-
mode={viewMode}
|
|
661
|
-
onChange={handleViewModeChange}
|
|
662
|
-
tableLabel={labels.viewMode.table}
|
|
663
|
-
cardsLabel={labels.viewMode.cards}
|
|
664
|
-
ariaLabel={t('staff.timesheets.projects.portfolio.viewMode.ariaLabel', 'View mode')}
|
|
665
|
-
/>
|
|
666
|
-
</div>
|
|
667
|
-
|
|
668
|
-
{viewMode === 'cards' ? (
|
|
669
|
-
<div>
|
|
670
|
-
{isLoading ? (
|
|
671
|
-
<div className="grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3">
|
|
672
|
-
{Array.from({ length: 6 }).map((_, idx) => (
|
|
673
|
-
<div key={idx} className="h-48 animate-pulse rounded-lg border border-border bg-muted/40" />
|
|
674
|
-
))}
|
|
675
|
-
</div>
|
|
676
|
-
) : rows.length === 0 ? (
|
|
677
|
-
<div className="rounded-lg border border-dashed border-border bg-card p-10 text-center">
|
|
678
|
-
<p className="text-sm text-muted-foreground">{emptyStateCopy}</p>
|
|
679
|
-
{canManage ? (
|
|
680
|
-
<div className="mt-3">
|
|
681
|
-
<Button asChild size="sm">
|
|
682
|
-
<Link href="/backend/staff/timesheets/projects/create">
|
|
683
|
-
{labels.actions.addFirst}
|
|
684
|
-
</Link>
|
|
685
|
-
</Button>
|
|
686
|
-
</div>
|
|
687
|
-
) : null}
|
|
688
|
-
</div>
|
|
689
|
-
) : (
|
|
690
|
-
<div className="grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3">
|
|
691
|
-
{cardsData.map((card) => (
|
|
692
|
-
<ProjectCard
|
|
693
|
-
key={card.id}
|
|
694
|
-
data={card}
|
|
695
|
-
labels={cardLabels}
|
|
696
|
-
showTeam={isPmRole}
|
|
697
|
-
href={`/backend/staff/timesheets/projects/${card.id}`}
|
|
698
|
-
/>
|
|
699
|
-
))}
|
|
700
|
-
</div>
|
|
701
|
-
)}
|
|
702
|
-
</div>
|
|
703
|
-
) : (
|
|
704
|
-
<DataTable<ProjectRow>
|
|
705
|
-
title={labels.title}
|
|
706
|
-
titleHeadingLevel={1}
|
|
707
|
-
data={rows}
|
|
708
|
-
columns={columns}
|
|
709
|
-
isLoading={isLoading}
|
|
710
|
-
searchValue={search}
|
|
711
|
-
onSearchChange={handleSearchChange}
|
|
712
|
-
searchPlaceholder={labels.table.search}
|
|
713
|
-
filters={filters}
|
|
714
|
-
filterValues={filterValues}
|
|
715
|
-
onFiltersApply={handleFiltersApply}
|
|
716
|
-
onFiltersClear={handleFiltersClear}
|
|
717
|
-
emptyState={
|
|
718
|
-
<div className="py-12 text-center">
|
|
719
|
-
<p className="text-sm text-muted-foreground mb-4">{emptyStateCopy}</p>
|
|
720
|
-
{canManage ? (
|
|
721
|
-
<Button asChild size="sm">
|
|
722
|
-
<Link href="/backend/staff/timesheets/projects/create">{labels.actions.addFirst}</Link>
|
|
723
|
-
</Button>
|
|
724
|
-
) : null}
|
|
725
|
-
</div>
|
|
726
|
-
}
|
|
727
|
-
actions={
|
|
728
|
-
canManage ? (
|
|
729
|
-
<Button asChild size="sm">
|
|
730
|
-
<Link href="/backend/staff/timesheets/projects/create">{labels.actions.add}</Link>
|
|
731
|
-
</Button>
|
|
732
|
-
) : undefined
|
|
733
|
-
}
|
|
734
|
-
refreshButton={{
|
|
735
|
-
label: labels.actions.refresh,
|
|
736
|
-
onRefresh: handleRefresh,
|
|
737
|
-
isRefreshing: isLoading || isRefreshing,
|
|
738
|
-
}}
|
|
739
|
-
sortable
|
|
740
|
-
sorting={sorting}
|
|
741
|
-
onSortingChange={setSorting}
|
|
742
|
-
pagination={{
|
|
743
|
-
page,
|
|
744
|
-
pageSize: PAGE_SIZE,
|
|
745
|
-
total,
|
|
746
|
-
totalPages,
|
|
747
|
-
totalIsCapped,
|
|
748
|
-
onPageChange: setPage,
|
|
749
|
-
}}
|
|
750
|
-
rowActions={(row) => (
|
|
751
|
-
<RowActions
|
|
752
|
-
items={[
|
|
753
|
-
{
|
|
754
|
-
id: 'view',
|
|
755
|
-
label: labels.actions.viewDetails,
|
|
756
|
-
href: `/backend/staff/timesheets/projects/${row.id}`,
|
|
757
|
-
},
|
|
758
|
-
...(canManage
|
|
759
|
-
? [
|
|
760
|
-
{
|
|
761
|
-
id: 'delete',
|
|
762
|
-
label: labels.actions.delete,
|
|
763
|
-
destructive: true,
|
|
764
|
-
onSelect: () => {
|
|
765
|
-
void handleDelete(row)
|
|
766
|
-
},
|
|
767
|
-
},
|
|
768
|
-
]
|
|
769
|
-
: []),
|
|
770
|
-
]}
|
|
771
|
-
/>
|
|
772
|
-
)}
|
|
773
|
-
onRowClick={(row) => router.push(`/backend/staff/timesheets/projects/${row.id}`)}
|
|
774
|
-
/>
|
|
775
|
-
)}
|
|
776
|
-
</PageBody>
|
|
777
|
-
{ConfirmDialogElement}
|
|
778
|
-
</Page>
|
|
779
|
-
)
|
|
3
|
+
export default function TimesheetProjectsLegacyRedirectPage() {
|
|
4
|
+
permanentRedirect('/backend/staff/time-tracking/projects')
|
|
780
5
|
}
|