@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,140 +1,199 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import * as React from 'react'
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { z } from 'zod'
|
|
5
|
+
import { registerComponent } from '@open-mercato/shared/modules/widgets/component-registry'
|
|
6
|
+
import { useRegisteredComponent } from '@open-mercato/ui/backend/injection/useRegisteredComponent'
|
|
7
|
+
import { extensionPoints } from '@open-mercato/core/modules/staff/extension-points'
|
|
8
|
+
import {
|
|
9
|
+
callbackProp,
|
|
10
|
+
opaqueProp,
|
|
11
|
+
optionalCallbackProp,
|
|
12
|
+
} from '../time-tracking/componentContracts'
|
|
13
|
+
import { Copy, Lock, Pencil, Plus } from 'lucide-react'
|
|
14
|
+
import { Button } from '@open-mercato/ui/primitives/button'
|
|
15
|
+
import { Input } from '@open-mercato/ui/primitives/input'
|
|
16
|
+
import { Progress } from '@open-mercato/ui/primitives/progress'
|
|
17
|
+
import { StatusBadge } from '@open-mercato/ui/primitives/status-badge'
|
|
18
|
+
import {
|
|
19
|
+
Select,
|
|
20
|
+
SelectContent,
|
|
21
|
+
SelectItem,
|
|
22
|
+
SelectTrigger,
|
|
23
|
+
SelectValue,
|
|
24
|
+
} from '@open-mercato/ui/primitives/select'
|
|
25
|
+
import { apiCallOrThrow, withScopedApiRequestHeaders } from '@open-mercato/ui/backend/utils/apiCall'
|
|
26
|
+
import { buildOptimisticLockHeader } from '@open-mercato/ui/backend/utils/optimisticLock'
|
|
7
27
|
import { surfaceRecordConflict } from '@open-mercato/ui/backend/conflicts'
|
|
8
28
|
import { flash } from '@open-mercato/ui/backend/FlashMessages'
|
|
9
|
-
import {
|
|
29
|
+
import { useGuardedMutation } from '@open-mercato/ui/backend/injection/useGuardedMutation'
|
|
30
|
+
import { cn } from '@open-mercato/shared/lib/utils'
|
|
31
|
+
import { useT } from '@open-mercato/shared/lib/i18n/context'
|
|
32
|
+
import { DurationInput } from '../time-tracking-ui/DurationInput'
|
|
33
|
+
import { formatDuration } from '../time-tracking/duration'
|
|
34
|
+
import {
|
|
35
|
+
loadPercent,
|
|
36
|
+
suggestNextStartClock,
|
|
37
|
+
type TimesheetDay,
|
|
38
|
+
type TimesheetEntry,
|
|
39
|
+
} from '../time-tracking-ui/timesheetData'
|
|
40
|
+
import { formatDayLabel, formatLongDayLabel } from '../time-tracking-ui/timesheetPeriod'
|
|
41
|
+
import { targetLabel, type TimesheetLogTarget } from '../time-tracking-ui/timesheetTargets'
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Screen 12 — the period as a stack of days (T5.3).
|
|
45
|
+
*
|
|
46
|
+
* Four notes on the mockup, four rules here:
|
|
47
|
+
*
|
|
48
|
+
* 1. **The author is on the line only when the view is showing more than one
|
|
49
|
+
* person** (note 1). A Team Member filtered to themselves does not need to
|
|
50
|
+
* be told, on every row, that they logged it.
|
|
51
|
+
* 2. **Exactly one day starts expanded — the one that deviates from the
|
|
52
|
+
* target** (note 2), chosen by `pickDefaultExpandedDay`. Every bar is
|
|
53
|
+
* clickable, so any other day is one click away, and the expansion is a
|
|
54
|
+
* controlled prop so the page can re-derive it when the period changes.
|
|
55
|
+
* 3. **The quick-add row's third field is the start time, prefilled with the
|
|
56
|
+
* end of the previous entry of that day** (note 3). The suggestion is
|
|
57
|
+
* recomputed from the day's entries rather than remembered, so adding a
|
|
58
|
+
* second entry immediately offers the end of the first.
|
|
59
|
+
* 4. **A weekend is greyed and contributes no target** but still shows any time
|
|
60
|
+
* logged on it (note 4). It reads `—`, never `0:00`: nothing was logged, a
|
|
61
|
+
* zero-length day was not worked.
|
|
62
|
+
*/
|
|
10
63
|
|
|
11
|
-
type
|
|
12
|
-
id: string
|
|
64
|
+
export type ListViewQuickAdd = {
|
|
13
65
|
date: string
|
|
66
|
+
targetKey: string
|
|
14
67
|
durationMinutes: number
|
|
15
|
-
|
|
16
|
-
projectName: string
|
|
17
|
-
projectCode: string | null
|
|
18
|
-
projectColor: string | null
|
|
19
|
-
notes: string | null
|
|
20
|
-
source: string
|
|
21
|
-
startedAt: string | null
|
|
22
|
-
endedAt: string | null
|
|
68
|
+
startClock: string | null
|
|
23
69
|
}
|
|
24
70
|
|
|
25
|
-
type ListViewProps = {
|
|
26
|
-
|
|
71
|
+
export type ListViewProps = {
|
|
72
|
+
days: readonly TimesheetDay[]
|
|
73
|
+
scaleMinutes: number | null
|
|
74
|
+
/** Per-day target in minutes; `null` when the tenant cleared `targets.dailyHours`. */
|
|
75
|
+
dailyTargetMinutes: number | null
|
|
76
|
+
expandedDate: string | null
|
|
77
|
+
onExpandedDateChange: (date: string | null) => void
|
|
78
|
+
targets: readonly TimesheetLogTarget[]
|
|
79
|
+
showAuthor: boolean
|
|
80
|
+
authorNames: ReadonlyMap<string, string>
|
|
81
|
+
canManage: boolean
|
|
82
|
+
onQuickAdd: (input: ListViewQuickAdd) => Promise<void> | void
|
|
83
|
+
onEditEntry: (entry: TimesheetEntry) => void
|
|
84
|
+
onDuplicateEntry: (entry: TimesheetEntry) => void
|
|
85
|
+
/** Fired after a successful inline description save, so the page can refetch. */
|
|
27
86
|
onEntryUpdated?: () => void
|
|
87
|
+
locale?: string
|
|
28
88
|
}
|
|
29
89
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const month = String(date.getMonth() + 1).padStart(2, '0')
|
|
33
|
-
const day = String(date.getDate()).padStart(2, '0')
|
|
34
|
-
return `${year}-${month}-${day}`
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function formatDayLabel(dateStr: string, translate: TranslateFn): string {
|
|
38
|
-
const today = new Date()
|
|
39
|
-
const todayStr = getLocalDateStr(today)
|
|
40
|
-
|
|
41
|
-
const yesterday = new Date(today)
|
|
42
|
-
yesterday.setDate(yesterday.getDate() - 1)
|
|
43
|
-
const yesterdayStr = getLocalDateStr(yesterday)
|
|
44
|
-
|
|
45
|
-
if (dateStr === todayStr) return translate('staff.timesheets.my.list.today', 'Today')
|
|
46
|
-
if (dateStr === yesterdayStr) return translate('staff.timesheets.my.list.yesterday', 'Yesterday')
|
|
47
|
-
|
|
48
|
-
const date = new Date(dateStr + 'T00:00:00')
|
|
49
|
-
const dayName = date.toLocaleDateString(undefined, { weekday: 'short' })
|
|
50
|
-
const day = date.getDate()
|
|
51
|
-
const month = date.toLocaleDateString(undefined, { month: 'short' })
|
|
52
|
-
|
|
53
|
-
return `${dayName}, ${day} ${month}`
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function formatDuration(minutes: number): string {
|
|
57
|
-
if (minutes < 60) return `${minutes}m`
|
|
58
|
-
|
|
59
|
-
const hours = Math.floor(minutes / 60)
|
|
60
|
-
const remainingMinutes = minutes % 60
|
|
61
|
-
|
|
62
|
-
if (remainingMinutes === 0) return `${hours}h`
|
|
63
|
-
return `${hours}h ${remainingMinutes}m`
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function formatTimeRange(startedAt: string, endedAt: string): string {
|
|
67
|
-
const start = new Date(startedAt)
|
|
68
|
-
const end = new Date(endedAt)
|
|
69
|
-
|
|
70
|
-
const format = (date: Date) =>
|
|
71
|
-
date.toLocaleTimeString(undefined, {
|
|
72
|
-
hour: 'numeric',
|
|
73
|
-
minute: '2-digit',
|
|
74
|
-
hour12: true,
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
return `${format(start)} - ${format(end)}`
|
|
78
|
-
}
|
|
90
|
+
const ENTRIES_ENDPOINT = '/api/staff/timesheets/time-entries'
|
|
91
|
+
const DESCRIPTION_CONTEXT_ID = 'staff.time_tracking.timesheet.list.description'
|
|
79
92
|
|
|
93
|
+
/**
|
|
94
|
+
* The description of a row, editable in place — carried over from the previous
|
|
95
|
+
* list view, which is where the one-word note that makes an entry readable is
|
|
96
|
+
* normally typed. Its three rules are regression-tested and predate this
|
|
97
|
+
* redesign:
|
|
98
|
+
*
|
|
99
|
+
* * a failed PUT is NOT success — the editor stays open, an error is flashed and
|
|
100
|
+
* the caller is not told the row changed;
|
|
101
|
+
* * a 2xx closes the editor and notifies the caller;
|
|
102
|
+
* * a 409 raises the shared conflict bar instead of a generic error.
|
|
103
|
+
*
|
|
104
|
+
* The write now also carries the record's version (`buildOptimisticLockHeader`),
|
|
105
|
+
* which the old inline editor did not, so two people editing the same entry's
|
|
106
|
+
* description get a conflict rather than a silent last-write-wins.
|
|
107
|
+
*
|
|
108
|
+
* A save is single-flight (`savingRef`). Committing with Enter disables the
|
|
109
|
+
* input, which blurs it, and the blur handler would otherwise fire a second PUT
|
|
110
|
+
* carrying the version captured before the first one landed — the user's own
|
|
111
|
+
* successful edit coming back at them as a conflict.
|
|
112
|
+
*/
|
|
80
113
|
function InlineDescription({
|
|
81
|
-
|
|
82
|
-
initialValue,
|
|
114
|
+
entry,
|
|
83
115
|
placeholder,
|
|
84
116
|
onSaved,
|
|
85
117
|
}: {
|
|
86
|
-
|
|
87
|
-
initialValue: string | null
|
|
118
|
+
entry: TimesheetEntry
|
|
88
119
|
placeholder: string
|
|
89
120
|
onSaved?: () => void
|
|
90
121
|
}) {
|
|
91
122
|
const t = useT()
|
|
92
123
|
const [editing, setEditing] = React.useState(false)
|
|
93
|
-
const [value, setValue] = React.useState(
|
|
124
|
+
const [value, setValue] = React.useState(entry.description ?? '')
|
|
94
125
|
const [saving, setSaving] = React.useState(false)
|
|
126
|
+
const savingRef = React.useRef(false)
|
|
95
127
|
const inputRef = React.useRef<HTMLInputElement>(null)
|
|
128
|
+
const { runMutation, retryLastMutation } = useGuardedMutation<{
|
|
129
|
+
formId: string
|
|
130
|
+
resourceKind: string
|
|
131
|
+
resourceId: string
|
|
132
|
+
retryLastMutation: () => Promise<boolean>
|
|
133
|
+
}>({
|
|
134
|
+
contextId: DESCRIPTION_CONTEXT_ID,
|
|
135
|
+
blockedMessage: t('ui.forms.flash.saveBlocked', 'Save blocked by validation'),
|
|
136
|
+
})
|
|
96
137
|
|
|
97
138
|
React.useEffect(() => {
|
|
98
139
|
if (editing && inputRef.current) inputRef.current.focus()
|
|
99
140
|
}, [editing])
|
|
100
141
|
|
|
101
142
|
const save = React.useCallback(async () => {
|
|
143
|
+
if (savingRef.current) return
|
|
102
144
|
const trimmed = value.trim()
|
|
103
|
-
if (trimmed === (
|
|
145
|
+
if (trimmed === (entry.description ?? '')) {
|
|
104
146
|
setEditing(false)
|
|
105
147
|
return
|
|
106
148
|
}
|
|
149
|
+
const payload = { id: entry.id, notes: trimmed || null }
|
|
150
|
+
savingRef.current = true
|
|
107
151
|
setSaving(true)
|
|
108
152
|
try {
|
|
109
|
-
await
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
153
|
+
await runMutation({
|
|
154
|
+
operation: () =>
|
|
155
|
+
withScopedApiRequestHeaders(buildOptimisticLockHeader(entry.updatedAt), () =>
|
|
156
|
+
apiCallOrThrow(ENTRIES_ENDPOINT, {
|
|
157
|
+
method: 'PUT',
|
|
158
|
+
headers: { 'Content-Type': 'application/json' },
|
|
159
|
+
body: JSON.stringify(payload),
|
|
160
|
+
}),
|
|
161
|
+
),
|
|
162
|
+
context: {
|
|
163
|
+
formId: DESCRIPTION_CONTEXT_ID,
|
|
164
|
+
resourceKind: 'staff.timesheets.time_entry',
|
|
165
|
+
resourceId: entry.id,
|
|
166
|
+
retryLastMutation,
|
|
167
|
+
},
|
|
168
|
+
mutationPayload: payload,
|
|
113
169
|
})
|
|
170
|
+
savingRef.current = false
|
|
114
171
|
setSaving(false)
|
|
115
172
|
setEditing(false)
|
|
116
173
|
onSaved?.()
|
|
117
|
-
} catch (
|
|
174
|
+
} catch (error) {
|
|
175
|
+
savingRef.current = false
|
|
118
176
|
setSaving(false)
|
|
119
|
-
if (!surfaceRecordConflict(
|
|
177
|
+
if (!surfaceRecordConflict(error, t)) {
|
|
120
178
|
flash(
|
|
121
179
|
t('staff.timesheets.my.list.saveError', 'Failed to save description. Please try again.'),
|
|
122
180
|
'error',
|
|
123
181
|
)
|
|
124
182
|
}
|
|
125
183
|
}
|
|
126
|
-
}, [
|
|
184
|
+
}, [entry.description, entry.id, entry.updatedAt, onSaved, retryLastMutation, runMutation, t, value])
|
|
127
185
|
|
|
128
186
|
if (!editing) {
|
|
129
187
|
return (
|
|
130
188
|
<button
|
|
131
189
|
type="button"
|
|
132
190
|
onClick={() => setEditing(true)}
|
|
133
|
-
className={
|
|
134
|
-
|
|
135
|
-
|
|
191
|
+
className={cn(
|
|
192
|
+
'text-left text-xs hover:underline',
|
|
193
|
+
entry.description ? 'text-muted-foreground' : 'italic text-muted-foreground/70',
|
|
194
|
+
)}
|
|
136
195
|
>
|
|
137
|
-
{
|
|
196
|
+
{entry.description || placeholder}
|
|
138
197
|
</button>
|
|
139
198
|
)
|
|
140
199
|
}
|
|
@@ -145,94 +204,390 @@ function InlineDescription({
|
|
|
145
204
|
type="text"
|
|
146
205
|
value={value}
|
|
147
206
|
disabled={saving}
|
|
148
|
-
onChange={(
|
|
149
|
-
onBlur={() => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
207
|
+
onChange={(event) => setValue(event.target.value)}
|
|
208
|
+
onBlur={() => {
|
|
209
|
+
if (savingRef.current) return
|
|
210
|
+
void save()
|
|
211
|
+
}}
|
|
212
|
+
onKeyDown={(event) => {
|
|
213
|
+
if (event.key === 'Enter') void save()
|
|
214
|
+
if (event.key === 'Escape') {
|
|
215
|
+
setValue(entry.description ?? '')
|
|
216
|
+
setEditing(false)
|
|
217
|
+
}
|
|
153
218
|
}}
|
|
154
219
|
placeholder={placeholder}
|
|
155
|
-
className="
|
|
220
|
+
className="w-full border-b border-primary/40 bg-transparent py-0.5 text-xs outline-none placeholder:text-muted-foreground/50"
|
|
156
221
|
/>
|
|
157
222
|
)
|
|
158
223
|
}
|
|
159
224
|
|
|
160
|
-
|
|
225
|
+
function DefaultListView({
|
|
226
|
+
days,
|
|
227
|
+
scaleMinutes,
|
|
228
|
+
dailyTargetMinutes,
|
|
229
|
+
expandedDate,
|
|
230
|
+
onExpandedDateChange,
|
|
231
|
+
targets,
|
|
232
|
+
showAuthor,
|
|
233
|
+
authorNames,
|
|
234
|
+
canManage,
|
|
235
|
+
onQuickAdd,
|
|
236
|
+
onEditEntry,
|
|
237
|
+
onDuplicateEntry,
|
|
238
|
+
onEntryUpdated,
|
|
239
|
+
locale,
|
|
240
|
+
}: ListViewProps) {
|
|
161
241
|
const t = useT()
|
|
162
242
|
|
|
163
|
-
if (
|
|
243
|
+
if (days.length === 0) {
|
|
164
244
|
return (
|
|
165
245
|
<div className="flex items-center justify-center py-12 text-sm text-muted-foreground">
|
|
166
|
-
{t('staff.
|
|
246
|
+
{t('staff.time_tracking.timesheet.list.empty', 'No days in this period.')}
|
|
167
247
|
</div>
|
|
168
248
|
)
|
|
169
249
|
}
|
|
170
250
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
251
|
+
return (
|
|
252
|
+
<div className="flex flex-col gap-4">
|
|
253
|
+
<div className="flex flex-col gap-2">
|
|
254
|
+
{days.map((day) => {
|
|
255
|
+
const expanded = day.date === expandedDate
|
|
256
|
+
const deviation =
|
|
257
|
+
dailyTargetMinutes !== null && !day.isWeekend ? day.totalMinutes - dailyTargetMinutes : null
|
|
258
|
+
return (
|
|
259
|
+
<button
|
|
260
|
+
key={day.date}
|
|
261
|
+
type="button"
|
|
262
|
+
aria-expanded={expanded}
|
|
263
|
+
onClick={() => onExpandedDateChange(expanded ? null : day.date)}
|
|
264
|
+
className={cn(
|
|
265
|
+
'flex w-full items-center gap-3 rounded-md px-2 py-1.5 text-left transition-colors',
|
|
266
|
+
'hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
|
|
267
|
+
expanded ? 'bg-muted/50' : null,
|
|
268
|
+
)}
|
|
269
|
+
>
|
|
270
|
+
<span
|
|
271
|
+
className={cn(
|
|
272
|
+
'w-32 shrink-0 text-sm',
|
|
273
|
+
day.isWeekend ? 'text-muted-foreground' : 'text-foreground',
|
|
274
|
+
)}
|
|
275
|
+
>
|
|
276
|
+
{formatDayLabel(day.date, locale)}
|
|
277
|
+
</span>
|
|
278
|
+
<span className="min-w-0 flex-1">
|
|
279
|
+
<Progress value={loadPercent(day.totalMinutes, scaleMinutes)} size="sm" />
|
|
280
|
+
</span>
|
|
281
|
+
<span
|
|
282
|
+
className={cn(
|
|
283
|
+
'w-16 shrink-0 text-right font-mono text-sm tabular-nums',
|
|
284
|
+
day.totalMinutes > 0 ? 'text-foreground' : 'text-muted-foreground',
|
|
285
|
+
)}
|
|
286
|
+
>
|
|
287
|
+
{day.totalMinutes > 0 ? formatDuration(day.totalMinutes, 'clock') : '—'}
|
|
288
|
+
</span>
|
|
289
|
+
{deviation !== null && deviation < 0 ? (
|
|
290
|
+
<StatusBadge variant="warning">
|
|
291
|
+
{t('staff.time_tracking.timesheet.list.belowTarget', '{duration} below target', {
|
|
292
|
+
duration: formatDuration(Math.abs(deviation), 'clock'),
|
|
293
|
+
})}
|
|
294
|
+
</StatusBadge>
|
|
295
|
+
) : null}
|
|
296
|
+
</button>
|
|
297
|
+
)
|
|
298
|
+
})}
|
|
299
|
+
</div>
|
|
180
300
|
|
|
181
|
-
|
|
301
|
+
{expandedDate ? (
|
|
302
|
+
<ExpandedDay
|
|
303
|
+
day={days.find((day) => day.date === expandedDate) ?? null}
|
|
304
|
+
dailyTargetMinutes={dailyTargetMinutes}
|
|
305
|
+
targets={targets}
|
|
306
|
+
showAuthor={showAuthor}
|
|
307
|
+
authorNames={authorNames}
|
|
308
|
+
canManage={canManage}
|
|
309
|
+
onQuickAdd={onQuickAdd}
|
|
310
|
+
onEditEntry={onEditEntry}
|
|
311
|
+
onDuplicateEntry={onDuplicateEntry}
|
|
312
|
+
onEntryUpdated={onEntryUpdated}
|
|
313
|
+
locale={locale}
|
|
314
|
+
/>
|
|
315
|
+
) : null}
|
|
316
|
+
</div>
|
|
317
|
+
)
|
|
318
|
+
}
|
|
182
319
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
320
|
+
function ExpandedDay({
|
|
321
|
+
day,
|
|
322
|
+
dailyTargetMinutes,
|
|
323
|
+
targets,
|
|
324
|
+
showAuthor,
|
|
325
|
+
authorNames,
|
|
326
|
+
canManage,
|
|
327
|
+
onQuickAdd,
|
|
328
|
+
onEditEntry,
|
|
329
|
+
onDuplicateEntry,
|
|
330
|
+
onEntryUpdated,
|
|
331
|
+
locale,
|
|
332
|
+
}: {
|
|
333
|
+
day: TimesheetDay | null
|
|
334
|
+
dailyTargetMinutes: number | null
|
|
335
|
+
targets: readonly TimesheetLogTarget[]
|
|
336
|
+
showAuthor: boolean
|
|
337
|
+
authorNames: ReadonlyMap<string, string>
|
|
338
|
+
canManage: boolean
|
|
339
|
+
onQuickAdd: (input: ListViewQuickAdd) => Promise<void> | void
|
|
340
|
+
onEditEntry: (entry: TimesheetEntry) => void
|
|
341
|
+
onDuplicateEntry: (entry: TimesheetEntry) => void
|
|
342
|
+
onEntryUpdated?: () => void
|
|
343
|
+
locale?: string
|
|
344
|
+
}) {
|
|
345
|
+
const t = useT()
|
|
346
|
+
if (!day) return null
|
|
347
|
+
const deviation = dailyTargetMinutes !== null && !day.isWeekend ? day.totalMinutes - dailyTargetMinutes : null
|
|
191
348
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
349
|
+
return (
|
|
350
|
+
<div className="flex flex-col gap-3 border-t pt-4">
|
|
351
|
+
<div className="flex flex-wrap items-center justify-between gap-2">
|
|
352
|
+
<span className="text-xs font-semibold uppercase tracking-wide text-muted-foreground">
|
|
353
|
+
{formatLongDayLabel(day.date, locale)} — {formatDuration(day.totalMinutes, 'clock')}
|
|
354
|
+
</span>
|
|
355
|
+
{deviation !== null && deviation !== 0 ? (
|
|
356
|
+
<StatusBadge variant={deviation > 0 ? 'success' : 'warning'}>
|
|
357
|
+
{deviation > 0
|
|
358
|
+
? t('staff.time_tracking.timesheet.list.aboveTarget', '{duration} above target', {
|
|
359
|
+
duration: formatDuration(deviation, 'clock'),
|
|
360
|
+
})
|
|
361
|
+
: t('staff.time_tracking.timesheet.list.belowTarget', '{duration} below target', {
|
|
362
|
+
duration: formatDuration(Math.abs(deviation), 'clock'),
|
|
363
|
+
})}
|
|
364
|
+
</StatusBadge>
|
|
365
|
+
) : null}
|
|
366
|
+
</div>
|
|
200
367
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
368
|
+
{day.entries.length === 0 ? (
|
|
369
|
+
<p className="text-sm text-muted-foreground">
|
|
370
|
+
{t('staff.time_tracking.timesheet.list.noEntries', 'Nothing logged on this day yet.')}
|
|
371
|
+
</p>
|
|
372
|
+
) : (
|
|
373
|
+
<table className="w-full text-sm">
|
|
374
|
+
<tbody>
|
|
375
|
+
{day.entries.map((entry) => (
|
|
376
|
+
<tr key={entry.id} className="border-b last:border-0">
|
|
377
|
+
<td className="w-28 py-2 align-top text-xs text-muted-foreground">
|
|
378
|
+
{entry.startText && entry.endText ? `${entry.startText} – ${entry.endText}` : '—'}
|
|
379
|
+
</td>
|
|
380
|
+
<td className="py-2 align-top">
|
|
381
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
382
|
+
<span className="font-medium">
|
|
383
|
+
{entry.taskTitle ??
|
|
384
|
+
entry.description ??
|
|
385
|
+
t('staff.time_tracking.timesheet.list.noTask', 'No task')}
|
|
386
|
+
</span>
|
|
387
|
+
{entry.isBillable ? null : (
|
|
388
|
+
<StatusBadge variant="neutral">
|
|
389
|
+
{t('staff.time_tracking.timesheet.list.nonBillable', 'non-billable')}
|
|
390
|
+
</StatusBadge>
|
|
391
|
+
)}
|
|
392
|
+
{entry.isLocked ? (
|
|
393
|
+
<StatusBadge variant="neutral">
|
|
394
|
+
<Lock className="size-3" aria-hidden="true" />
|
|
395
|
+
{t('staff.time_tracking.timesheet.list.locked', 'locked')}
|
|
396
|
+
</StatusBadge>
|
|
397
|
+
) : null}
|
|
398
|
+
</div>
|
|
399
|
+
<div className="text-xs text-muted-foreground">
|
|
400
|
+
{[
|
|
401
|
+
entry.projectLabel,
|
|
402
|
+
showAuthor && entry.staffMemberId ? authorNames.get(entry.staffMemberId) ?? null : null,
|
|
403
|
+
]
|
|
404
|
+
.filter((part): part is string => Boolean(part))
|
|
405
|
+
.join(' · ')}
|
|
406
|
+
</div>
|
|
407
|
+
{canManage && !entry.isLocked ? (
|
|
408
|
+
<InlineDescription
|
|
409
|
+
entry={entry}
|
|
410
|
+
placeholder={t('staff.timesheets.my.list.addDescription', 'Add description')}
|
|
411
|
+
onSaved={onEntryUpdated}
|
|
412
|
+
/>
|
|
413
|
+
) : entry.description ? (
|
|
414
|
+
<div className="text-xs text-muted-foreground">{entry.description}</div>
|
|
415
|
+
) : null}
|
|
416
|
+
</td>
|
|
417
|
+
<td className="w-20 py-2 text-right align-top font-mono font-semibold tabular-nums">
|
|
418
|
+
{formatDuration(entry.durationMinutes, 'clock')}
|
|
419
|
+
</td>
|
|
420
|
+
<td className="w-24 py-2 text-right align-top">
|
|
421
|
+
{canManage ? (
|
|
422
|
+
<span className="inline-flex items-center gap-1">
|
|
423
|
+
<Button
|
|
424
|
+
type="button"
|
|
425
|
+
variant="ghost"
|
|
426
|
+
size="2xs"
|
|
427
|
+
aria-label={t('staff.time_tracking.timesheet.list.duplicate', 'Duplicate')}
|
|
428
|
+
onClick={() => onDuplicateEntry(entry)}
|
|
429
|
+
disabled={entry.isLocked}
|
|
430
|
+
>
|
|
431
|
+
<Copy className="size-3.5" aria-hidden="true" />
|
|
432
|
+
</Button>
|
|
433
|
+
<Button
|
|
434
|
+
type="button"
|
|
435
|
+
variant="ghost"
|
|
436
|
+
size="2xs"
|
|
437
|
+
aria-label={t('staff.time_tracking.timesheet.list.edit', 'Edit')}
|
|
438
|
+
onClick={() => onEditEntry(entry)}
|
|
439
|
+
disabled={entry.isLocked}
|
|
440
|
+
>
|
|
441
|
+
<Pencil className="size-3.5" aria-hidden="true" />
|
|
442
|
+
</Button>
|
|
225
443
|
</span>
|
|
226
444
|
) : null}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
</span>
|
|
230
|
-
</div>
|
|
231
|
-
</div>
|
|
445
|
+
</td>
|
|
446
|
+
</tr>
|
|
232
447
|
))}
|
|
233
|
-
</
|
|
234
|
-
|
|
235
|
-
|
|
448
|
+
</tbody>
|
|
449
|
+
</table>
|
|
450
|
+
)}
|
|
451
|
+
|
|
452
|
+
{canManage && targets.length > 0 ? (
|
|
453
|
+
<QuickAddRow key={day.date} day={day} targets={targets} onQuickAdd={onQuickAdd} />
|
|
454
|
+
) : null}
|
|
455
|
+
</div>
|
|
456
|
+
)
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
function QuickAddRow({
|
|
460
|
+
day,
|
|
461
|
+
targets,
|
|
462
|
+
onQuickAdd,
|
|
463
|
+
}: {
|
|
464
|
+
day: TimesheetDay
|
|
465
|
+
targets: readonly TimesheetLogTarget[]
|
|
466
|
+
onQuickAdd: (input: ListViewQuickAdd) => Promise<void> | void
|
|
467
|
+
}) {
|
|
468
|
+
const t = useT()
|
|
469
|
+
const [targetKey, setTargetKey] = React.useState<string>(() => targets[0]?.key ?? '')
|
|
470
|
+
const [minutes, setMinutes] = React.useState<number | null>(null)
|
|
471
|
+
const [durationEpoch, setDurationEpoch] = React.useState(0)
|
|
472
|
+
const suggestedStart = suggestNextStartClock(day)
|
|
473
|
+
const [startClock, setStartClock] = React.useState<string>(suggestedStart ?? '')
|
|
474
|
+
const [submitting, setSubmitting] = React.useState(false)
|
|
475
|
+
const suggestedRef = React.useRef(suggestedStart)
|
|
476
|
+
|
|
477
|
+
// The suggestion follows the day's entries: saving one immediately offers its
|
|
478
|
+
// end for the next. A start the user typed themselves is never overwritten.
|
|
479
|
+
React.useEffect(() => {
|
|
480
|
+
if (suggestedRef.current === suggestedStart) return
|
|
481
|
+
const previousSuggestion = suggestedRef.current
|
|
482
|
+
suggestedRef.current = suggestedStart
|
|
483
|
+
setStartClock((current) => (current === (previousSuggestion ?? '') ? suggestedStart ?? '' : current))
|
|
484
|
+
}, [suggestedStart])
|
|
485
|
+
|
|
486
|
+
const submit = React.useCallback(async () => {
|
|
487
|
+
if (!targetKey || minutes === null || minutes <= 0 || submitting) return
|
|
488
|
+
setSubmitting(true)
|
|
489
|
+
try {
|
|
490
|
+
await onQuickAdd({
|
|
491
|
+
date: day.date,
|
|
492
|
+
targetKey,
|
|
493
|
+
durationMinutes: minutes,
|
|
494
|
+
startClock: startClock.trim() ? startClock.trim() : null,
|
|
495
|
+
})
|
|
496
|
+
setMinutes(null)
|
|
497
|
+
setDurationEpoch((epoch) => epoch + 1)
|
|
498
|
+
} finally {
|
|
499
|
+
setSubmitting(false)
|
|
500
|
+
}
|
|
501
|
+
}, [day.date, minutes, onQuickAdd, startClock, submitting, targetKey])
|
|
502
|
+
|
|
503
|
+
return (
|
|
504
|
+
<div
|
|
505
|
+
className="flex flex-wrap items-start gap-2"
|
|
506
|
+
onKeyDown={(event) => {
|
|
507
|
+
if ((event.metaKey || event.ctrlKey) && event.key === 'Enter') {
|
|
508
|
+
event.preventDefault()
|
|
509
|
+
void submit()
|
|
510
|
+
}
|
|
511
|
+
}}
|
|
512
|
+
>
|
|
513
|
+
<Select value={targetKey} onValueChange={setTargetKey}>
|
|
514
|
+
<SelectTrigger
|
|
515
|
+
className="w-72"
|
|
516
|
+
aria-label={t('staff.time_tracking.timesheet.list.quickAdd.target', 'Project or task')}
|
|
517
|
+
>
|
|
518
|
+
<SelectValue />
|
|
519
|
+
</SelectTrigger>
|
|
520
|
+
<SelectContent>
|
|
521
|
+
{targets.map((target) => (
|
|
522
|
+
<SelectItem key={target.key} value={target.key}>
|
|
523
|
+
{targetLabel(target)}
|
|
524
|
+
</SelectItem>
|
|
525
|
+
))}
|
|
526
|
+
</SelectContent>
|
|
527
|
+
</Select>
|
|
528
|
+
<div className="w-32">
|
|
529
|
+
<DurationInput
|
|
530
|
+
key={durationEpoch}
|
|
531
|
+
variant="compact"
|
|
532
|
+
value={minutes}
|
|
533
|
+
onChange={(next) => setMinutes(next)}
|
|
534
|
+
ariaLabel={t('staff.time_tracking.timesheet.list.quickAdd.duration', 'Duration')}
|
|
535
|
+
placeholder={t('staff.time_tracking.duration.placeholder', '1h 30m')}
|
|
536
|
+
/>
|
|
537
|
+
</div>
|
|
538
|
+
<Input
|
|
539
|
+
size="sm"
|
|
540
|
+
className="w-24"
|
|
541
|
+
inputClassName="font-mono tabular-nums"
|
|
542
|
+
value={startClock}
|
|
543
|
+
onChange={(event) => setStartClock(event.target.value)}
|
|
544
|
+
aria-label={t('staff.time_tracking.timesheet.list.quickAdd.start', 'Start time')}
|
|
545
|
+
placeholder={t('staff.time_tracking.timesheet.list.quickAdd.startPlaceholder', '13:30')}
|
|
546
|
+
/>
|
|
547
|
+
<Button
|
|
548
|
+
type="button"
|
|
549
|
+
size="sm"
|
|
550
|
+
onClick={() => void submit()}
|
|
551
|
+
disabled={submitting || minutes === null || minutes <= 0 || !targetKey}
|
|
552
|
+
>
|
|
553
|
+
<Plus className="size-4" aria-hidden="true" />
|
|
554
|
+
{t('staff.time_tracking.timesheet.list.quickAdd.submit', 'Add')}
|
|
555
|
+
</Button>
|
|
236
556
|
</div>
|
|
237
557
|
)
|
|
238
558
|
}
|
|
559
|
+
|
|
560
|
+
const listViewPropsSchema: z.ZodType<ListViewProps> = z.object({
|
|
561
|
+
days: z.array(opaqueProp<TimesheetDay>()),
|
|
562
|
+
scaleMinutes: z.number().nullable(),
|
|
563
|
+
dailyTargetMinutes: z.number().nullable(),
|
|
564
|
+
expandedDate: z.string().nullable(),
|
|
565
|
+
onExpandedDateChange: callbackProp<(date: string | null) => void>(),
|
|
566
|
+
targets: z.array(opaqueProp<TimesheetLogTarget>()),
|
|
567
|
+
showAuthor: z.boolean(),
|
|
568
|
+
authorNames: opaqueProp<ReadonlyMap<string, string>>(),
|
|
569
|
+
canManage: z.boolean(),
|
|
570
|
+
onQuickAdd: callbackProp<(input: ListViewQuickAdd) => Promise<void> | void>(),
|
|
571
|
+
onEditEntry: callbackProp<(entry: TimesheetEntry) => void>(),
|
|
572
|
+
onDuplicateEntry: callbackProp<(entry: TimesheetEntry) => void>(),
|
|
573
|
+
onEntryUpdated: optionalCallbackProp<() => void>(),
|
|
574
|
+
locale: z.string().optional(),
|
|
575
|
+
})
|
|
576
|
+
|
|
577
|
+
registerComponent<ListViewProps>({
|
|
578
|
+
id: extensionPoints.hosts.timesheetListComponent.componentId,
|
|
579
|
+
component: DefaultListView,
|
|
580
|
+
metadata: {
|
|
581
|
+
module: 'staff',
|
|
582
|
+
description: 'Timesheet list view — one expandable row per day.',
|
|
583
|
+
propsSchema: listViewPropsSchema,
|
|
584
|
+
},
|
|
585
|
+
})
|
|
586
|
+
|
|
587
|
+
export function ListView(props: ListViewProps) {
|
|
588
|
+
const Resolved = useRegisteredComponent<ListViewProps>(
|
|
589
|
+
extensionPoints.hosts.timesheetListComponent.componentId,
|
|
590
|
+
DefaultListView,
|
|
591
|
+
)
|
|
592
|
+
return <Resolved {...props} />
|
|
593
|
+
}
|