@open-mercato/core 0.7.1-develop.7178.1.ab93fbaf4e → 0.7.1-develop.7180.1.9717fbbb43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +2 -2
- package/dist/generated/entities/staff_time_entry/index.js +14 -0
- package/dist/generated/entities/staff_time_entry/index.js.map +2 -2
- package/dist/generated/entities/staff_time_entry_tag/index.js +15 -0
- package/dist/generated/entities/staff_time_entry_tag/index.js.map +7 -0
- package/dist/generated/entities/staff_time_project/index.js +16 -0
- package/dist/generated/entities/staff_time_project/index.js.map +2 -2
- package/dist/generated/entities/staff_time_report/index.js +57 -0
- package/dist/generated/entities/staff_time_report/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_entry/index.js +27 -0
- package/dist/generated/entities/staff_time_report_entry/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_event/index.js +21 -0
- package/dist/generated/entities/staff_time_report_event/index.js.map +7 -0
- package/dist/generated/entities/staff_time_report_project/index.js +15 -0
- package/dist/generated/entities/staff_time_report_project/index.js.map +7 -0
- package/dist/generated/entities/staff_time_tag/index.js +21 -0
- package/dist/generated/entities/staff_time_tag/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task/index.js +37 -0
- package/dist/generated/entities/staff_time_task/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_comment/index.js +21 -0
- package/dist/generated/entities/staff_time_task_comment/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_status/index.js +29 -0
- package/dist/generated/entities/staff_time_task_status/index.js.map +7 -0
- package/dist/generated/entities/staff_time_task_tag/index.js +15 -0
- package/dist/generated/entities/staff_time_task_tag/index.js.map +7 -0
- package/dist/generated/entities.ids.generated.js +11 -1
- package/dist/generated/entities.ids.generated.js.map +2 -2
- package/dist/generated/entity-fields-registry.js +149 -0
- package/dist/generated/entity-fields-registry.js.map +2 -2
- package/dist/helpers/integration/timesheetFixtures.js +7 -0
- package/dist/helpers/integration/timesheetFixtures.js.map +2 -2
- package/dist/modules/auth/cli.js +16 -0
- package/dist/modules/auth/cli.js.map +2 -2
- package/dist/modules/auth/lib/backendChrome.js +1 -0
- package/dist/modules/auth/lib/backendChrome.js.map +2 -2
- package/dist/modules/customer_accounts/lib/customerRoleAcls.js +44 -0
- package/dist/modules/customer_accounts/lib/customerRoleAcls.js.map +7 -0
- package/dist/modules/customer_accounts/setup.js +1 -28
- package/dist/modules/customer_accounts/setup.js.map +2 -2
- package/dist/modules/data_sync/api/options.js +2 -0
- package/dist/modules/data_sync/api/options.js.map +2 -2
- package/dist/modules/data_sync/backend/data-sync/page.js +39 -17
- package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
- package/dist/modules/data_sync/lib/start-controls.js +42 -0
- package/dist/modules/data_sync/lib/start-controls.js.map +7 -0
- package/dist/modules/staff/acl.js +9 -1
- package/dist/modules/staff/acl.js.map +2 -2
- package/dist/modules/staff/ai-agents.js +142 -0
- package/dist/modules/staff/ai-agents.js.map +7 -0
- package/dist/modules/staff/ai-tools/time-tracking-pack.js +348 -0
- package/dist/modules/staff/ai-tools/time-tracking-pack.js.map +7 -0
- package/dist/modules/staff/ai-tools/types.js +54 -0
- package/dist/modules/staff/ai-tools/types.js.map +7 -0
- package/dist/modules/staff/ai-tools.js +8 -0
- package/dist/modules/staff/ai-tools.js.map +7 -0
- package/dist/modules/staff/analytics.js +84 -1
- package/dist/modules/staff/analytics.js.map +2 -2
- package/dist/modules/staff/api/guards.js +37 -3
- package/dist/modules/staff/api/guards.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/accept/route.js +1 -3
- package/dist/modules/staff/api/leave-requests/accept/route.js.map +2 -2
- package/dist/modules/staff/api/leave-requests/reject/route.js +1 -3
- package/dist/modules/staff/api/leave-requests/reject/route.js.map +2 -2
- package/dist/modules/staff/api/portal/time-reports/[id]/route.js +131 -0
- package/dist/modules/staff/api/portal/time-reports/[id]/route.js.map +7 -0
- package/dist/modules/staff/api/portal/time-reports/route.js +179 -0
- package/dist/modules/staff/api/portal/time-reports/route.js.map +7 -0
- package/dist/modules/staff/api/team-members/self/route.js +1 -3
- package/dist/modules/staff/api/team-members/self/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/assign/route.js +1 -3
- package/dist/modules/staff/api/team-members/tags/assign/route.js.map +2 -2
- package/dist/modules/staff/api/team-members/tags/unassign/route.js +1 -3
- package/dist/modules/staff/api/team-members/tags/unassign/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js +174 -0
- package/dist/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.js.map +7 -0
- package/dist/modules/staff/api/timesheets/access-requests/route.js +226 -0
- package/dist/modules/staff/api/timesheets/access-requests/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js +15 -8
- package/dist/modules/staff/api/timesheets/my-projects/[projectId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-projects/route.js +13 -1
- package/dist/modules/staff/api/timesheets/my-projects/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/my-work/myWorkAggregate.js +42 -0
- package/dist/modules/staff/api/timesheets/my-work/myWorkAggregate.js.map +7 -0
- package/dist/modules/staff/api/timesheets/my-work/route.js +383 -0
- package/dist/modules/staff/api/timesheets/my-work/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js +14 -2
- package/dist/modules/staff/api/timesheets/projects/kpis/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js +168 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/close/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js +246 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/export/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js +183 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/sheet/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js +164 -0
- package/dist/modules/staff/api/timesheets/reports/[id]/unlock/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/preview/route.js +360 -0
- package/dist/modules/staff/api/timesheets/reports/preview/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/route.js +316 -0
- package/dist/modules/staff/api/timesheets/reports/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/reports/shared.js +63 -0
- package/dist/modules/staff/api/timesheets/reports/shared.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js +164 -0
- package/dist/modules/staff/api/timesheets/settings/reapply-rounding/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/rounding-impact/route.js +168 -0
- package/dist/modules/staff/api/timesheets/settings/rounding-impact/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/settings/route.js +199 -0
- package/dist/modules/staff/api/timesheets/settings/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/access.js +76 -0
- package/dist/modules/staff/api/timesheets/tags/access.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js +235 -0
- package/dist/modules/staff/api/timesheets/tags/entry-assignments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/route.js +160 -0
- package/dist/modules/staff/api/timesheets/tags/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js +233 -0
- package/dist/modules/staff/api/timesheets/tags/task-assignments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/task-statuses/route.js +188 -0
- package/dist/modules/staff/api/timesheets/task-statuses/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js +399 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/comments/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js +210 -0
- package/dist/modules/staff/api/timesheets/tasks/[id]/status/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/tasks/route.js +333 -0
- package/dist/modules/staff/api/timesheets/tasks/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js +228 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js +29 -10
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js +31 -18
- package/dist/modules/staff/api/timesheets/time-entries/[id]/segments/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js +21 -7
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js +27 -7
- package/dist/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js +215 -32
- package/dist/modules/staff/api/timesheets/time-entries/bulk/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js +378 -0
- package/dist/modules/staff/api/timesheets/time-entries/copy-day/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js +340 -0
- package/dist/modules/staff/api/timesheets/time-entries/overlaps/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-entries/route.js +238 -26
- package/dist/modules/staff/api/timesheets/time-entries/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js +23 -8
- package/dist/modules/staff/api/timesheets/time-entries/start-timer/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js +209 -0
- package/dist/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.js.map +7 -0
- package/dist/modules/staff/api/timesheets/time-projects/[id]/employees/route.js +59 -2
- package/dist/modules/staff/api/timesheets/time-projects/[id]/employees/route.js.map +2 -2
- package/dist/modules/staff/api/timesheets/time-projects/route.js +264 -22
- package/dist/modules/staff/api/timesheets/time-projects/route.js.map +2 -2
- package/dist/modules/staff/backend/staff/time-tracking/board/page.js +110 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/board/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.js +981 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/entries/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.js +583 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.meta.js +15 -0
- package/dist/modules/staff/backend/staff/time-tracking/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.js +65 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.js +229 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.js +1014 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.js +97 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/create/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.js +1040 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.meta.js +19 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.js +353 -0
- package/dist/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.js +457 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.js +697 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.meta.js +16 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/create/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.js +174 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/reports/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.js +546 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/settings/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/GridView.js +710 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/GridView.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.js +646 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.js.map +7 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.meta.js +18 -0
- package/dist/modules/staff/backend/staff/time-tracking/timesheet/page.meta.js.map +7 -0
- package/dist/modules/staff/backend/staff/timesheets/page.js +4 -793
- package/dist/modules/staff/backend/staff/timesheets/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/page.meta.js +2 -7
- package/dist/modules/staff/backend/staff/timesheets/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.js +5 -136
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js +5 -445
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.js.map +3 -3
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.js +4 -76
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.meta.js +1 -7
- package/dist/modules/staff/backend/staff/timesheets/projects/create/page.meta.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js +4 -613
- package/dist/modules/staff/backend/staff/timesheets/projects/page.js.map +2 -2
- package/dist/modules/staff/backend/staff/timesheets/projects/page.meta.js +2 -17
- package/dist/modules/staff/backend/staff/timesheets/projects/page.meta.js.map +2 -2
- package/dist/modules/staff/ce.js +40 -0
- package/dist/modules/staff/ce.js.map +2 -2
- package/dist/modules/staff/cli.js +166 -1
- package/dist/modules/staff/cli.js.map +2 -2
- package/dist/modules/staff/commands/index.js +5 -0
- package/dist/modules/staff/commands/index.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-entries.js +569 -21
- package/dist/modules/staff/commands/timesheets-entries.js.map +3 -3
- package/dist/modules/staff/commands/timesheets-projects.js +450 -7
- package/dist/modules/staff/commands/timesheets-projects.js.map +2 -2
- package/dist/modules/staff/commands/timesheets-reports.js +1036 -0
- package/dist/modules/staff/commands/timesheets-reports.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-tags.js +1015 -0
- package/dist/modules/staff/commands/timesheets-tags.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-task-comments.js +438 -0
- package/dist/modules/staff/commands/timesheets-task-comments.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-task-statuses.js +723 -0
- package/dist/modules/staff/commands/timesheets-task-statuses.js.map +7 -0
- package/dist/modules/staff/commands/timesheets-tasks.js +834 -0
- package/dist/modules/staff/commands/timesheets-tasks.js.map +7 -0
- package/dist/modules/staff/data/enrichers.js +426 -12
- package/dist/modules/staff/data/enrichers.js.map +2 -2
- package/dist/modules/staff/data/entities.js +552 -3
- package/dist/modules/staff/data/entities.js.map +2 -2
- package/dist/modules/staff/data/extensions.js +41 -0
- package/dist/modules/staff/data/extensions.js.map +7 -0
- package/dist/modules/staff/data/validators.js +254 -9
- package/dist/modules/staff/data/validators.js.map +2 -2
- package/dist/modules/staff/di.js +42 -1
- package/dist/modules/staff/di.js.map +2 -2
- package/dist/modules/staff/events.js +84 -6
- package/dist/modules/staff/events.js.map +2 -2
- package/dist/modules/staff/events.payloads.js +158 -0
- package/dist/modules/staff/events.payloads.js.map +7 -0
- package/dist/modules/staff/extension-points.js +261 -0
- package/dist/modules/staff/extension-points.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.js +138 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.js +12 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.js +133 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.js.map +7 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.js +19 -0
- package/dist/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.js.map +7 -0
- package/dist/modules/staff/lib/crud.js +11 -1
- package/dist/modules/staff/lib/crud.js.map +2 -2
- package/dist/modules/staff/lib/time-tracking/access.js +92 -0
- package/dist/modules/staff/lib/time-tracking/access.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/billability.js +39 -0
- package/dist/modules/staff/lib/time-tracking/billability.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/capacity.js +68 -0
- package/dist/modules/staff/lib/time-tracking/capacity.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/componentContracts.js +15 -0
- package/dist/modules/staff/lib/time-tracking/componentContracts.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/cost.js +82 -0
- package/dist/modules/staff/lib/time-tracking/cost.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/duration.js +55 -0
- package/dist/modules/staff/lib/time-tracking/duration.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/featureAccess.js +41 -0
- package/dist/modules/staff/lib/time-tracking/featureAccess.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/interval.js +72 -0
- package/dist/modules/staff/lib/time-tracking/interval.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/migrateProjectCodes.js +88 -0
- package/dist/modules/staff/lib/time-tracking/migrateProjectCodes.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/moneyVisibility.js +10 -0
- package/dist/modules/staff/lib/time-tracking/moneyVisibility.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/overlap.js +87 -0
- package/dist/modules/staff/lib/time-tracking/overlap.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/portalRecipients.js +27 -0
- package/dist/modules/staff/lib/time-tracking/portalRecipients.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/portalReports.js +16 -0
- package/dist/modules/staff/lib/time-tracking/portalReports.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/projectCode.js +135 -0
- package/dist/modules/staff/lib/time-tracking/projectCode.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/reapplyRounding.js +187 -0
- package/dist/modules/staff/lib/time-tracking/reapplyRounding.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/recalculationRunner.js +80 -0
- package/dist/modules/staff/lib/time-tracking/recalculationRunner.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/recalculations.js +56 -0
- package/dist/modules/staff/lib/time-tracking/recalculations.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/invoke.js +63 -0
- package/dist/modules/staff/lib/time-tracking/registries/invoke.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/registry.js +62 -0
- package/dist/modules/staff/lib/time-tracking/registries/registry.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/registries/scope.js +21 -0
- package/dist/modules/staff/lib/time-tracking/registries/scope.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/rollup.js +34 -0
- package/dist/modules/staff/lib/time-tracking/rollup.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/rounding.js +66 -0
- package/dist/modules/staff/lib/time-tracking/rounding.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/roundingImpact.js +39 -0
- package/dist/modules/staff/lib/time-tracking/roundingImpact.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/settingKeys.js +214 -0
- package/dist/modules/staff/lib/time-tracking/settingKeys.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/settings.js +87 -0
- package/dist/modules/staff/lib/time-tracking/settings.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/sqlInClause.js +9 -0
- package/dist/modules/staff/lib/time-tracking/sqlInClause.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking/timeEntrySources.js +48 -0
- package/dist/modules/staff/lib/time-tracking/timeEntrySources.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/BoardFilterChips.js +283 -0
- package/dist/modules/staff/lib/time-tracking-ui/BoardFilterChips.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/CustomerPicker.js +324 -0
- package/dist/modules/staff/lib/time-tracking-ui/CustomerPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/DurationInput.js +121 -0
- package/dist/modules/staff/lib/time-tracking-ui/DurationInput.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryDetailsFields.js +188 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryDetailsFields.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryFilterBar.js +89 -0
- package/dist/modules/staff/lib/time-tracking-ui/EntryFilterBar.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanBoard.js +855 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanBoard.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanCard.js +360 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanCard.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanColumn.js +259 -0
- package/dist/modules/staff/lib/time-tracking-ui/KanbanColumn.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/NewTaskDialog.js +238 -0
- package/dist/modules/staff/lib/time-tracking-ui/NewTaskDialog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/NoProjectAccess.js +130 -0
- package/dist/modules/staff/lib/time-tracking-ui/NoProjectAccess.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/PeriodSelector.js +98 -0
- package/dist/modules/staff/lib/time-tracking-ui/PeriodSelector.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/PhasePlaceholder.js +27 -0
- package/dist/modules/staff/lib/time-tracking-ui/PhasePlaceholder.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCodeField.js +166 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCodeField.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.js +295 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectFormSections.js +212 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectFormSections.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.js +729 -0
- package/dist/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/ReportSheet.js +217 -0
- package/dist/modules/staff/lib/time-tracking-ui/ReportSheet.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TagPicker.js +158 -0
- package/dist/modules/staff/lib/time-tracking-ui/TagPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskBoardScreen.js +224 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskBoardScreen.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskCommentThread.js +93 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskCommentThread.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskDrawer.js +1196 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskDrawer.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskListView.js +176 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskListView.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskPicker.js +307 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskPicker.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskQuickLog.js +284 -0
- package/dist/modules/staff/lib/time-tracking-ui/TaskQuickLog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.js +73 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDialog.js +1499 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDialog.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.js +95 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetCalendar.js +188 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetCalendar.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.js +61 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.js +45 -0
- package/dist/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardDirectory.js +176 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardDirectory.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardFilters.js +82 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardFilters.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardSummary.js +5 -0
- package/dist/modules/staff/lib/time-tracking-ui/boardSummary.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/kanbanBoardData.js +152 -0
- package/dist/modules/staff/lib/time-tracking-ui/kanbanBoardData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/projectTeamAssignment.js +92 -0
- package/dist/modules/staff/lib/time-tracking-ui/projectTeamAssignment.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/taskDrawerData.js +111 -0
- package/dist/modules/staff/lib/time-tracking-ui/taskDrawerData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryDialogState.js +243 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryDialogState.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryListData.js +151 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeEntryListData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.js +105 -0
- package/dist/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetData.js +132 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetData.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetPeriod.js +205 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetPeriod.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetTargets.js +53 -0
- package/dist/modules/staff/lib/time-tracking-ui/timesheetTargets.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/useBoardFilters.js +77 -0
- package/dist/modules/staff/lib/time-tracking-ui/useBoardFilters.js.map +7 -0
- package/dist/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.js +151 -0
- package/dist/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.js.map +7 -0
- package/dist/modules/staff/lib/timeTrackingSeeds.js +809 -0
- package/dist/modules/staff/lib/timeTrackingSeeds.js.map +7 -0
- package/dist/modules/staff/lib/timesheets/timeEntryCacheInvalidation.js +2 -3
- package/dist/modules/staff/lib/timesheets/timeEntryCacheInvalidation.js.map +2 -2
- package/dist/modules/staff/lib/timesheets/timeEntryDecoration.js +152 -0
- package/dist/modules/staff/lib/timesheets/timeEntryDecoration.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetBurn.js +36 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetBurn.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThreshold.js +66 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThreshold.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThresholdState.js +78 -0
- package/dist/modules/staff/lib/timesheets-projects/budgetThresholdState.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectFinancials.js +81 -0
- package/dist/modules/staff/lib/timesheets-projects/computeProjectFinancials.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects/reportSelection.js +44 -0
- package/dist/modules/staff/lib/timesheets-projects/reportSelection.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.js +169 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.js +22 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectCard.js +51 -1
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectCard.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.js +70 -0
- package/dist/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js +63 -0
- package/dist/modules/staff/lib/timesheets-reports/buildReportSheet.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js +170 -0
- package/dist/modules/staff/lib/timesheets-reports/loadReportData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/pdf.js +205 -0
- package/dist/modules/staff/lib/timesheets-reports/pdf.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportApprovalPolicies.js +68 -0
- package/dist/modules/staff/lib/timesheets-reports/reportApprovalPolicies.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigData.js +135 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigState.js +48 -0
- package/dist/modules/staff/lib/timesheets-reports/reportConfigState.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExport.js +262 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExport.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExportFormats.js +34 -0
- package/dist/modules/staff/lib/timesheets-reports/reportExportFormats.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportGroupings.js +79 -0
- package/dist/modules/staff/lib/timesheets-reports/reportGroupings.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportLabels.js +11 -0
- package/dist/modules/staff/lib/timesheets-reports/reportLabels.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportReference.js +83 -0
- package/dist/modules/staff/lib/timesheets-reports/reportReference.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportRows.js +42 -0
- package/dist/modules/staff/lib/timesheets-reports/reportRows.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportSheetData.js +107 -0
- package/dist/modules/staff/lib/timesheets-reports/reportSheetData.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/reportTotals.js +289 -0
- package/dist/modules/staff/lib/timesheets-reports/reportTotals.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-reports/xlsx.js +145 -0
- package/dist/modules/staff/lib/timesheets-reports/xlsx.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/computeTaskRollups.js +116 -0
- package/dist/modules/staff/lib/timesheets-tasks/computeTaskRollups.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.js +50 -0
- package/dist/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/seedProjectStatuses.js +27 -0
- package/dist/modules/staff/lib/timesheets-tasks/seedProjectStatuses.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusPositions.js +65 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusPositions.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusSlug.js +31 -0
- package/dist/modules/staff/lib/timesheets-tasks/statusSlug.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHierarchy.js +31 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHierarchy.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHoursTotals.js +17 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskHoursTotals.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskReference.js +51 -0
- package/dist/modules/staff/lib/timesheets-tasks/taskReference.js.map +7 -0
- package/dist/modules/staff/lib/timesheets-ui/CreateProjectDialog.js +11 -4
- package/dist/modules/staff/lib/timesheets-ui/CreateProjectDialog.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-ui/ListView.js +369 -111
- package/dist/modules/staff/lib/timesheets-ui/ListView.js.map +2 -2
- package/dist/modules/staff/lib/timesheets-ui/TimerBar.js +47 -2
- package/dist/modules/staff/lib/timesheets-ui/TimerBar.js.map +2 -2
- package/dist/modules/staff/migrations/Migration20260813073131_staff.js +79 -0
- package/dist/modules/staff/migrations/Migration20260813073131_staff.js.map +7 -0
- package/dist/modules/staff/migrations/Migration20260824143357_staff.js +15 -0
- package/dist/modules/staff/migrations/Migration20260824143357_staff.js.map +7 -0
- package/dist/modules/staff/notifications.client.js +16 -0
- package/dist/modules/staff/notifications.client.js.map +7 -0
- package/dist/modules/staff/notifications.handlers.js +80 -0
- package/dist/modules/staff/notifications.handlers.js.map +7 -0
- package/dist/modules/staff/notifications.js +168 -0
- package/dist/modules/staff/notifications.js.map +2 -2
- package/dist/modules/staff/search.js +159 -1
- package/dist/modules/staff/search.js.map +2 -2
- package/dist/modules/staff/setup.js +20 -1
- package/dist/modules/staff/setup.js.map +2 -2
- package/dist/modules/staff/subscribers/time-project-access-requested-notification.js +68 -0
- package/dist/modules/staff/subscribers/time-project-access-requested-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-project-budget-threshold-notification.js +149 -0
- package/dist/modules/staff/subscribers/time-project-budget-threshold-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-report-approved-notification.js +78 -0
- package/dist/modules/staff/subscribers/time-report-approved-notification.js.map +7 -0
- package/dist/modules/staff/subscribers/time-report-portal-broadcast.js +78 -0
- package/dist/modules/staff/subscribers/time-report-portal-broadcast.js.map +7 -0
- package/dist/modules/staff/translations.js +4 -1
- package/dist/modules/staff/translations.js.map +2 -2
- package/dist/modules/staff/widgets/components.js +7 -0
- package/dist/modules/staff/widgets/components.js.map +7 -0
- package/dist/modules/staff/widgets/injection/timer-sidebar-indicator/widget.js +5 -4
- package/dist/modules/staff/widgets/injection/timer-sidebar-indicator/widget.js.map +2 -2
- package/dist/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.js +135 -0
- package/dist/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.js.map +7 -0
- package/dist/modules/staff/widgets/notifications/index.js +5 -0
- package/dist/modules/staff/widgets/notifications/index.js.map +7 -0
- package/dist/modules/staff/workers/timesheets-reapply-rounding.js +43 -0
- package/dist/modules/staff/workers/timesheets-reapply-rounding.js.map +7 -0
- package/generated/entities/staff_time_entry/index.ts +7 -0
- package/generated/entities/staff_time_entry_tag/index.ts +6 -0
- package/generated/entities/staff_time_project/index.ts +8 -0
- package/generated/entities/staff_time_report/index.ts +27 -0
- package/generated/entities/staff_time_report_entry/index.ts +12 -0
- package/generated/entities/staff_time_report_event/index.ts +9 -0
- package/generated/entities/staff_time_report_project/index.ts +6 -0
- package/generated/entities/staff_time_tag/index.ts +9 -0
- package/generated/entities/staff_time_task/index.ts +17 -0
- package/generated/entities/staff_time_task_comment/index.ts +9 -0
- package/generated/entities/staff_time_task_status/index.ts +13 -0
- package/generated/entities/staff_time_task_tag/index.ts +6 -0
- package/generated/entities.ids.generated.ts +11 -1
- package/generated/entity-fields-registry.ts +149 -0
- package/package.json +7 -7
- package/src/helpers/integration/timesheetFixtures.ts +31 -1
- package/src/modules/auth/README.md +1 -1
- package/src/modules/auth/cli.ts +35 -1
- package/src/modules/auth/i18n/de.json +7 -0
- package/src/modules/auth/i18n/en.json +7 -0
- package/src/modules/auth/i18n/es.json +7 -0
- package/src/modules/auth/i18n/ko.json +7 -0
- package/src/modules/auth/i18n/pl.json +7 -0
- package/src/modules/auth/lib/backendChrome.tsx +1 -0
- package/src/modules/customer_accounts/lib/customerRoleAcls.ts +79 -0
- package/src/modules/customer_accounts/setup.ts +1 -45
- package/src/modules/data_sync/AGENTS.md +34 -0
- package/src/modules/data_sync/api/options.ts +2 -0
- package/src/modules/data_sync/backend/data-sync/page.tsx +82 -33
- package/src/modules/data_sync/i18n/de.json +1 -0
- package/src/modules/data_sync/i18n/en.json +1 -0
- package/src/modules/data_sync/i18n/es.json +1 -0
- package/src/modules/data_sync/i18n/ko.json +1 -0
- package/src/modules/data_sync/i18n/pl.json +1 -0
- package/src/modules/data_sync/lib/adapter.ts +45 -0
- package/src/modules/data_sync/lib/start-controls.ts +89 -0
- package/src/modules/staff/AGENTS.md +769 -1
- package/src/modules/staff/acl.ts +9 -0
- package/src/modules/staff/ai-agents.ts +189 -0
- package/src/modules/staff/ai-tools/time-tracking-pack.ts +494 -0
- package/src/modules/staff/ai-tools/types.ts +82 -0
- package/src/modules/staff/ai-tools.ts +13 -0
- package/src/modules/staff/analytics.ts +113 -0
- package/src/modules/staff/api/guards.ts +85 -3
- package/src/modules/staff/api/leave-requests/accept/route.ts +0 -2
- package/src/modules/staff/api/leave-requests/reject/route.ts +0 -2
- package/src/modules/staff/api/portal/time-reports/[id]/route.ts +182 -0
- package/src/modules/staff/api/portal/time-reports/route.ts +270 -0
- package/src/modules/staff/api/team-members/self/route.ts +0 -2
- package/src/modules/staff/api/team-members/tags/assign/route.ts +0 -2
- package/src/modules/staff/api/team-members/tags/unassign/route.ts +0 -2
- package/src/modules/staff/api/timesheets/_shared/withTimesheetInterceptors.ts +292 -0
- package/src/modules/staff/api/timesheets/access-requests/route.ts +299 -0
- package/src/modules/staff/api/timesheets/my-projects/[projectId]/route.ts +15 -7
- package/src/modules/staff/api/timesheets/my-projects/route.ts +14 -1
- package/src/modules/staff/api/timesheets/my-work/myWorkAggregate.ts +90 -0
- package/src/modules/staff/api/timesheets/my-work/route.ts +475 -0
- package/src/modules/staff/api/timesheets/projects/kpis/route.ts +15 -2
- package/src/modules/staff/api/timesheets/reports/[id]/close/route.ts +203 -0
- package/src/modules/staff/api/timesheets/reports/[id]/export/route.ts +315 -0
- package/src/modules/staff/api/timesheets/reports/[id]/sheet/route.ts +220 -0
- package/src/modules/staff/api/timesheets/reports/[id]/unlock/route.ts +208 -0
- package/src/modules/staff/api/timesheets/reports/preview/route.ts +449 -0
- package/src/modules/staff/api/timesheets/reports/route.ts +386 -0
- package/src/modules/staff/api/timesheets/reports/shared.ts +121 -0
- package/src/modules/staff/api/timesheets/settings/reapply-rounding/route.ts +205 -0
- package/src/modules/staff/api/timesheets/settings/rounding-impact/route.ts +226 -0
- package/src/modules/staff/api/timesheets/settings/route.ts +242 -0
- package/src/modules/staff/api/timesheets/tags/access.ts +134 -0
- package/src/modules/staff/api/timesheets/tags/entry-assignments/route.ts +290 -0
- package/src/modules/staff/api/timesheets/tags/route.ts +177 -0
- package/src/modules/staff/api/timesheets/tags/task-assignments/route.ts +294 -0
- package/src/modules/staff/api/timesheets/task-statuses/route.ts +232 -0
- package/src/modules/staff/api/timesheets/tasks/[id]/comments/route.ts +532 -0
- package/src/modules/staff/api/timesheets/tasks/[id]/status/route.ts +271 -0
- package/src/modules/staff/api/timesheets/tasks/route.ts +443 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/duplicate/route.ts +306 -0
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/[segmentId]/route.ts +32 -10
- package/src/modules/staff/api/timesheets/time-entries/[id]/segments/route.ts +32 -17
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-start/route.ts +27 -6
- package/src/modules/staff/api/timesheets/time-entries/[id]/timer-stop/route.ts +36 -6
- package/src/modules/staff/api/timesheets/time-entries/bulk/route.ts +331 -34
- package/src/modules/staff/api/timesheets/time-entries/copy-day/route.ts +533 -0
- package/src/modules/staff/api/timesheets/time-entries/overlaps/route.ts +457 -0
- package/src/modules/staff/api/timesheets/time-entries/route.ts +378 -24
- package/src/modules/staff/api/timesheets/time-entries/start-timer/route.ts +31 -9
- package/src/modules/staff/api/timesheets/time-projects/[id]/change-currency/route.ts +246 -0
- package/src/modules/staff/api/timesheets/time-projects/[id]/employees/route.ts +62 -2
- package/src/modules/staff/api/timesheets/time-projects/route.ts +397 -22
- package/src/modules/staff/backend/staff/time-tracking/board/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/board/page.tsx +151 -0
- package/src/modules/staff/backend/staff/time-tracking/entries/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/entries/page.tsx +1229 -0
- package/src/modules/staff/backend/staff/time-tracking/page.meta.ts +11 -0
- package/src/modules/staff/backend/staff/time-tracking/page.tsx +823 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/board/page.tsx +81 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/edit/page.tsx +275 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/[id]/page.tsx +1420 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/create/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/create/page.tsx +109 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/page.meta.ts +15 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/page.tsx +1254 -0
- package/src/modules/staff/backend/staff/time-tracking/projects/projectFormConfig.ts +466 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/[id]/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/[id]/page.tsx +632 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/create/page.meta.ts +12 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/create/page.tsx +867 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/reports/page.tsx +246 -0
- package/src/modules/staff/backend/staff/time-tracking/settings/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/settings/page.tsx +701 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/GridView.tsx +953 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/page.meta.ts +14 -0
- package/src/modules/staff/backend/staff/time-tracking/timesheet/page.tsx +800 -0
- package/src/modules/staff/backend/staff/timesheets/page.meta.ts +6 -6
- package/src/modules/staff/backend/staff/timesheets/page.tsx +12 -1010
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/edit/page.tsx +4 -158
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/[id]/page.tsx +4 -609
- package/src/modules/staff/backend/staff/timesheets/projects/create/page.meta.ts +0 -6
- package/src/modules/staff/backend/staff/timesheets/projects/create/page.tsx +3 -89
- package/src/modules/staff/backend/staff/timesheets/projects/page.meta.ts +2 -19
- package/src/modules/staff/backend/staff/timesheets/projects/page.tsx +3 -778
- package/src/modules/staff/ce.ts +63 -0
- package/src/modules/staff/cli.ts +207 -1
- package/src/modules/staff/commands/index.ts +5 -0
- package/src/modules/staff/commands/timesheets-entries.ts +1006 -28
- package/src/modules/staff/commands/timesheets-projects.ts +593 -7
- package/src/modules/staff/commands/timesheets-reports.ts +1329 -0
- package/src/modules/staff/commands/timesheets-tags.ts +1315 -0
- package/src/modules/staff/commands/timesheets-task-comments.ts +583 -0
- package/src/modules/staff/commands/timesheets-task-statuses.ts +889 -0
- package/src/modules/staff/commands/timesheets-tasks.ts +1121 -0
- package/src/modules/staff/data/enrichers.ts +675 -10
- package/src/modules/staff/data/entities.ts +494 -2
- package/src/modules/staff/data/extensions.ts +68 -0
- package/src/modules/staff/data/validators.ts +348 -3
- package/src/modules/staff/di.ts +96 -0
- package/src/modules/staff/events.payloads.ts +268 -0
- package/src/modules/staff/events.ts +87 -5
- package/src/modules/staff/extension-points.ts +308 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.meta.ts +10 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/[id]/page.tsx +225 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/page.meta.ts +17 -0
- package/src/modules/staff/frontend/[orgSlug]/portal/time-reports/page.tsx +182 -0
- package/src/modules/staff/i18n/de.json +899 -0
- package/src/modules/staff/i18n/en.json +899 -0
- package/src/modules/staff/i18n/es.json +899 -0
- package/src/modules/staff/i18n/ko.json +899 -0
- package/src/modules/staff/i18n/pl.json +899 -0
- package/src/modules/staff/lib/crud.ts +14 -3
- package/src/modules/staff/lib/time-tracking/access.ts +155 -0
- package/src/modules/staff/lib/time-tracking/billability.ts +68 -0
- package/src/modules/staff/lib/time-tracking/capacity.ts +124 -0
- package/src/modules/staff/lib/time-tracking/componentContracts.ts +26 -0
- package/src/modules/staff/lib/time-tracking/cost.ts +144 -0
- package/src/modules/staff/lib/time-tracking/duration.ts +68 -0
- package/src/modules/staff/lib/time-tracking/featureAccess.ts +115 -0
- package/src/modules/staff/lib/time-tracking/interval.ts +90 -0
- package/src/modules/staff/lib/time-tracking/migrateProjectCodes.ts +161 -0
- package/src/modules/staff/lib/time-tracking/moneyVisibility.ts +37 -0
- package/src/modules/staff/lib/time-tracking/overlap.ts +159 -0
- package/src/modules/staff/lib/time-tracking/portalRecipients.ts +76 -0
- package/src/modules/staff/lib/time-tracking/portalReports.ts +31 -0
- package/src/modules/staff/lib/time-tracking/projectCode.ts +221 -0
- package/src/modules/staff/lib/time-tracking/reapplyRounding.ts +313 -0
- package/src/modules/staff/lib/time-tracking/recalculationRunner.ts +118 -0
- package/src/modules/staff/lib/time-tracking/recalculations.ts +135 -0
- package/src/modules/staff/lib/time-tracking/registries/invoke.ts +122 -0
- package/src/modules/staff/lib/time-tracking/registries/registry.ts +124 -0
- package/src/modules/staff/lib/time-tracking/registries/scope.ts +56 -0
- package/src/modules/staff/lib/time-tracking/rollup.ts +59 -0
- package/src/modules/staff/lib/time-tracking/rounding.ts +126 -0
- package/src/modules/staff/lib/time-tracking/roundingImpact.ts +75 -0
- package/src/modules/staff/lib/time-tracking/settingKeys.ts +274 -0
- package/src/modules/staff/lib/time-tracking/settings.ts +168 -0
- package/src/modules/staff/lib/time-tracking/sqlInClause.ts +22 -0
- package/src/modules/staff/lib/time-tracking/timeEntrySources.ts +85 -0
- package/src/modules/staff/lib/time-tracking-ui/BoardFilterChips.tsx +360 -0
- package/src/modules/staff/lib/time-tracking-ui/CustomerPicker.tsx +427 -0
- package/src/modules/staff/lib/time-tracking-ui/DurationInput.tsx +192 -0
- package/src/modules/staff/lib/time-tracking-ui/EntryDetailsFields.tsx +224 -0
- package/src/modules/staff/lib/time-tracking-ui/EntryFilterBar.tsx +144 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanBoard.tsx +1065 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanCard.tsx +435 -0
- package/src/modules/staff/lib/time-tracking-ui/KanbanColumn.tsx +316 -0
- package/src/modules/staff/lib/time-tracking-ui/NewTaskDialog.tsx +291 -0
- package/src/modules/staff/lib/time-tracking-ui/NoProjectAccess.tsx +162 -0
- package/src/modules/staff/lib/time-tracking-ui/PeriodSelector.tsx +149 -0
- package/src/modules/staff/lib/time-tracking-ui/PhasePlaceholder.tsx +31 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectCodeField.tsx +230 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectCurrencyField.tsx +432 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectFormSections.tsx +323 -0
- package/src/modules/staff/lib/time-tracking-ui/ProjectTeamDrawer.tsx +930 -0
- package/src/modules/staff/lib/time-tracking-ui/ReportSheet.tsx +357 -0
- package/src/modules/staff/lib/time-tracking-ui/TagPicker.tsx +195 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskBoardScreen.tsx +243 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskCommentThread.tsx +137 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskDrawer.tsx +1405 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskListView.tsx +260 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskPicker.tsx +435 -0
- package/src/modules/staff/lib/time-tracking-ui/TaskQuickLog.tsx +296 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntriesSummaryFooter.tsx +97 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntryDialog.tsx +1929 -0
- package/src/modules/staff/lib/time-tracking-ui/TimeEntryDurationCell.tsx +126 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetCalendar.tsx +265 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetPeriodFooter.tsx +78 -0
- package/src/modules/staff/lib/time-tracking-ui/TimesheetViewSwitch.tsx +70 -0
- package/src/modules/staff/lib/time-tracking-ui/boardDirectory.ts +231 -0
- package/src/modules/staff/lib/time-tracking-ui/boardFilters.ts +128 -0
- package/src/modules/staff/lib/time-tracking-ui/boardSummary.ts +20 -0
- package/src/modules/staff/lib/time-tracking-ui/kanbanBoardData.ts +228 -0
- package/src/modules/staff/lib/time-tracking-ui/projectTeamAssignment.ts +143 -0
- package/src/modules/staff/lib/time-tracking-ui/taskDrawerData.ts +194 -0
- package/src/modules/staff/lib/time-tracking-ui/timeEntryDialogState.ts +400 -0
- package/src/modules/staff/lib/time-tracking-ui/timeEntryListData.ts +271 -0
- package/src/modules/staff/lib/time-tracking-ui/timeTrackingSettingsForm.ts +168 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetData.ts +225 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetPeriod.ts +278 -0
- package/src/modules/staff/lib/time-tracking-ui/timesheetTargets.ts +93 -0
- package/src/modules/staff/lib/time-tracking-ui/useBoardFilters.ts +107 -0
- package/src/modules/staff/lib/time-tracking-ui/useTimesheetPreferences.ts +245 -0
- package/src/modules/staff/lib/timeTrackingSeeds.ts +1037 -0
- package/src/modules/staff/lib/timesheets/timeEntryCacheInvalidation.ts +11 -10
- package/src/modules/staff/lib/timesheets/timeEntryDecoration.ts +256 -0
- package/src/modules/staff/lib/timesheets-projects/budgetBurn.ts +60 -0
- package/src/modules/staff/lib/timesheets-projects/budgetThreshold.ts +135 -0
- package/src/modules/staff/lib/timesheets-projects/budgetThresholdState.ts +137 -0
- package/src/modules/staff/lib/timesheets-projects/computeProjectFinancials.ts +142 -0
- package/src/modules/staff/lib/timesheets-projects/reportSelection.ts +82 -0
- package/src/modules/staff/lib/timesheets-projects-ui/AssignMembersDialog.tsx +237 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectBudgetCell.tsx +33 -0
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectCard.tsx +56 -1
- package/src/modules/staff/lib/timesheets-projects-ui/ProjectsBulkActionsBar.tsx +90 -0
- package/src/modules/staff/lib/timesheets-reports/buildReportSheet.ts +125 -0
- package/src/modules/staff/lib/timesheets-reports/loadReportData.ts +251 -0
- package/src/modules/staff/lib/timesheets-reports/pdf.ts +263 -0
- package/src/modules/staff/lib/timesheets-reports/reportApprovalPolicies.ts +137 -0
- package/src/modules/staff/lib/timesheets-reports/reportConfigData.ts +247 -0
- package/src/modules/staff/lib/timesheets-reports/reportConfigState.ts +89 -0
- package/src/modules/staff/lib/timesheets-reports/reportExport.ts +373 -0
- package/src/modules/staff/lib/timesheets-reports/reportExportFormats.ts +71 -0
- package/src/modules/staff/lib/timesheets-reports/reportGroupings.ts +153 -0
- package/src/modules/staff/lib/timesheets-reports/reportLabels.ts +23 -0
- package/src/modules/staff/lib/timesheets-reports/reportReference.ts +146 -0
- package/src/modules/staff/lib/timesheets-reports/reportRows.ts +89 -0
- package/src/modules/staff/lib/timesheets-reports/reportSheetData.ts +196 -0
- package/src/modules/staff/lib/timesheets-reports/reportTotals.ts +544 -0
- package/src/modules/staff/lib/timesheets-reports/xlsx.ts +207 -0
- package/src/modules/staff/lib/timesheets-tasks/computeTaskRollups.ts +238 -0
- package/src/modules/staff/lib/timesheets-tasks/defaultStatusTemplate.ts +90 -0
- package/src/modules/staff/lib/timesheets-tasks/seedProjectStatuses.ts +43 -0
- package/src/modules/staff/lib/timesheets-tasks/statusPositions.ts +132 -0
- package/src/modules/staff/lib/timesheets-tasks/statusSlug.ts +43 -0
- package/src/modules/staff/lib/timesheets-tasks/taskHierarchy.ts +99 -0
- package/src/modules/staff/lib/timesheets-tasks/taskHoursTotals.ts +42 -0
- package/src/modules/staff/lib/timesheets-tasks/taskReference.ts +108 -0
- package/src/modules/staff/lib/timesheets-ui/CreateProjectDialog.tsx +18 -4
- package/src/modules/staff/lib/timesheets-ui/ListView.tsx +504 -149
- package/src/modules/staff/lib/timesheets-ui/TimerBar.tsx +50 -2
- package/src/modules/staff/migrations/.snapshot-open-mercato.json +3244 -228
- package/src/modules/staff/migrations/Migration20260813073131_staff.ts +94 -0
- package/src/modules/staff/migrations/Migration20260824143357_staff.ts +17 -0
- package/src/modules/staff/notifications.client.ts +16 -0
- package/src/modules/staff/notifications.handlers.ts +88 -0
- package/src/modules/staff/notifications.ts +163 -0
- package/src/modules/staff/search.ts +191 -1
- package/src/modules/staff/setup.ts +22 -0
- package/src/modules/staff/subscribers/time-project-access-requested-notification.ts +95 -0
- package/src/modules/staff/subscribers/time-project-budget-threshold-notification.ts +226 -0
- package/src/modules/staff/subscribers/time-report-approved-notification.ts +116 -0
- package/src/modules/staff/subscribers/time-report-portal-broadcast.ts +120 -0
- package/src/modules/staff/translations.ts +17 -0
- package/src/modules/staff/widgets/components.ts +34 -0
- package/src/modules/staff/widgets/injection/timer-sidebar-indicator/widget.tsx +6 -5
- package/src/modules/staff/widgets/notifications/TimeProjectAccessRequestedRenderer.tsx +138 -0
- package/src/modules/staff/widgets/notifications/index.ts +1 -0
- package/src/modules/staff/workers/timesheets-reapply-rounding.ts +59 -0
- package/dist/modules/staff/backend/staff/timesheets/projects/projectFormConfig.js +0 -123
- package/dist/modules/staff/backend/staff/timesheets/projects/projectFormConfig.js.map +0 -7
- package/src/modules/staff/backend/staff/timesheets/projects/projectFormConfig.ts +0 -138
|
@@ -0,0 +1,1196 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { useRouter } from "next/navigation";
|
|
5
|
+
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
6
|
+
import { Plus, X } from "lucide-react";
|
|
7
|
+
import {
|
|
8
|
+
Drawer,
|
|
9
|
+
DrawerBody,
|
|
10
|
+
DrawerContent,
|
|
11
|
+
DrawerDescription,
|
|
12
|
+
DrawerFooter,
|
|
13
|
+
DrawerHeader,
|
|
14
|
+
DrawerTitle
|
|
15
|
+
} from "@open-mercato/ui/primitives/drawer";
|
|
16
|
+
import { Avatar } from "@open-mercato/ui/primitives/avatar";
|
|
17
|
+
import { Badge } from "@open-mercato/ui/primitives/badge";
|
|
18
|
+
import { Button } from "@open-mercato/ui/primitives/button";
|
|
19
|
+
import { Checkbox } from "@open-mercato/ui/primitives/checkbox";
|
|
20
|
+
import { Input } from "@open-mercato/ui/primitives/input";
|
|
21
|
+
import { Progress } from "@open-mercato/ui/primitives/progress";
|
|
22
|
+
import {
|
|
23
|
+
Select,
|
|
24
|
+
SelectContent,
|
|
25
|
+
SelectItem,
|
|
26
|
+
SelectTrigger,
|
|
27
|
+
SelectValue
|
|
28
|
+
} from "@open-mercato/ui/primitives/select";
|
|
29
|
+
import { ErrorMessage, LoadingMessage } from "@open-mercato/ui/backend/detail";
|
|
30
|
+
import { apiCall, apiCallOrThrow, withScopedApiRequestHeaders } from "@open-mercato/ui/backend/utils/apiCall";
|
|
31
|
+
import { buildOptimisticLockHeader } from "@open-mercato/ui/backend/utils/optimisticLock";
|
|
32
|
+
import { surfaceRecordConflict } from "@open-mercato/ui/backend/conflicts";
|
|
33
|
+
import { useBackendChrome } from "@open-mercato/ui/backend/BackendChromeProvider";
|
|
34
|
+
import { useConfirmDialog } from "@open-mercato/ui/backend/confirm-dialog";
|
|
35
|
+
import { useGuardedMutation } from "@open-mercato/ui/backend/injection/useGuardedMutation";
|
|
36
|
+
import { InjectionSpot } from "@open-mercato/ui/backend/injection/InjectionSpot";
|
|
37
|
+
import { extensionPoints } from "@open-mercato/core/modules/staff/extension-points";
|
|
38
|
+
import { flash } from "@open-mercato/ui/backend/FlashMessages";
|
|
39
|
+
import { formatCurrency, formatDate } from "@open-mercato/ui/utils/format";
|
|
40
|
+
import { hasFeature } from "@open-mercato/shared/security/features";
|
|
41
|
+
import { useT } from "@open-mercato/shared/lib/i18n/context";
|
|
42
|
+
import { useOrganizationScopeVersion } from "@open-mercato/shared/lib/frontend/useOrganizationScope";
|
|
43
|
+
import { createLogger } from "@open-mercato/shared/lib/logger";
|
|
44
|
+
import { TaskCommentThread } from "./TaskCommentThread.js";
|
|
45
|
+
import { TaskQuickLog } from "./TaskQuickLog.js";
|
|
46
|
+
import { TagPicker, tagChipStyle } from "./TagPicker.js";
|
|
47
|
+
import { slugifyProjectName } from "../time-tracking/projectCode.js";
|
|
48
|
+
import {
|
|
49
|
+
computeSubtaskProgress,
|
|
50
|
+
formatBoardMinutes,
|
|
51
|
+
readItems,
|
|
52
|
+
readString,
|
|
53
|
+
readTotal,
|
|
54
|
+
sortByPosition,
|
|
55
|
+
toBoardStatus,
|
|
56
|
+
toBoardTask
|
|
57
|
+
} from "./kanbanBoardData.js";
|
|
58
|
+
import {
|
|
59
|
+
childMinutes,
|
|
60
|
+
formatElapsed,
|
|
61
|
+
formatSplitMinutes,
|
|
62
|
+
resolveDefaultStatusId,
|
|
63
|
+
resolveDoneStatusId,
|
|
64
|
+
summarizeEntries,
|
|
65
|
+
toDrawerComment,
|
|
66
|
+
toDrawerEntry,
|
|
67
|
+
todayIsoDate,
|
|
68
|
+
buildEntryClocks
|
|
69
|
+
} from "./taskDrawerData.js";
|
|
70
|
+
const logger = createLogger("staff").child({ component: "TaskDrawer" });
|
|
71
|
+
const TASK_ENTITY_ID = "staff:staff_time_task";
|
|
72
|
+
const TASK_DRAWER_MUTATION_CONTEXT_ID = "staff.time_tracking.task_drawer";
|
|
73
|
+
const RATES_FEATURE = "staff.timesheets.rates.view";
|
|
74
|
+
const TASKS_MANAGE_FEATURE = "staff.timesheets.tasks.manage";
|
|
75
|
+
const ENTRIES_LIST_PATH = "/backend/staff/time-tracking/entries";
|
|
76
|
+
const DRAWER_QUERY_ROOT = ["staff", "time-tracking", "task-drawer"];
|
|
77
|
+
const DIRECTORY_PAGE_SIZE = 100;
|
|
78
|
+
const CHILD_PAGE_SIZE = 100;
|
|
79
|
+
const COMMENT_PAGE_SIZE = 50;
|
|
80
|
+
const ENTRY_PAGE_SIZE = 100;
|
|
81
|
+
const MAX_ENTRY_PAGES = 3;
|
|
82
|
+
const RECENT_ENTRY_COUNT = 5;
|
|
83
|
+
const ELAPSED_TICK_MS = 1e3;
|
|
84
|
+
async function fetchProjectEntries(projectId) {
|
|
85
|
+
const rows = [];
|
|
86
|
+
for (let page = 1; page <= MAX_ENTRY_PAGES; page += 1) {
|
|
87
|
+
const call = await apiCall(
|
|
88
|
+
`/api/staff/timesheets/time-entries?projectId=${encodeURIComponent(projectId)}&page=${page}&pageSize=${ENTRY_PAGE_SIZE}&sortField=date&sortDir=desc`
|
|
89
|
+
);
|
|
90
|
+
if (!call.ok) return { rows, partial: true };
|
|
91
|
+
const items = readItems(call.result);
|
|
92
|
+
rows.push(...items);
|
|
93
|
+
if (items.length < ENTRY_PAGE_SIZE) return { rows, partial: false };
|
|
94
|
+
if (rows.length >= readTotal(call.result, rows.length)) return { rows, partial: false };
|
|
95
|
+
}
|
|
96
|
+
return { rows, partial: true };
|
|
97
|
+
}
|
|
98
|
+
function TaskDrawer({
|
|
99
|
+
taskId,
|
|
100
|
+
open,
|
|
101
|
+
onOpenChange,
|
|
102
|
+
projectName,
|
|
103
|
+
focusPanel,
|
|
104
|
+
onChanged
|
|
105
|
+
}) {
|
|
106
|
+
const t = useT();
|
|
107
|
+
const router = useRouter();
|
|
108
|
+
const queryClient = useQueryClient();
|
|
109
|
+
const scopeVersion = useOrganizationScopeVersion();
|
|
110
|
+
const { payload } = useBackendChrome();
|
|
111
|
+
const { confirm, ConfirmDialogElement } = useConfirmDialog();
|
|
112
|
+
const canSeeMoney = hasFeature(payload?.grantedFeatures, RATES_FEATURE);
|
|
113
|
+
const canManage = hasFeature(payload?.grantedFeatures, TASKS_MANAGE_FEATURE);
|
|
114
|
+
const [tagIds, setTagIds] = React.useState([]);
|
|
115
|
+
const [subtaskDraft, setSubtaskDraft] = React.useState("");
|
|
116
|
+
const [composingSubtask, setComposingSubtask] = React.useState(false);
|
|
117
|
+
const [busy, setBusy] = React.useState(false);
|
|
118
|
+
const [timerBusy, setTimerBusy] = React.useState(false);
|
|
119
|
+
const [now, setNow] = React.useState(() => Date.now());
|
|
120
|
+
const saveChainRef = React.useRef(Promise.resolve());
|
|
121
|
+
const versionRef = React.useRef(null);
|
|
122
|
+
const { runMutation, retryLastMutation } = useGuardedMutation({
|
|
123
|
+
contextId: TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
124
|
+
blockedMessage: t("staff.time_tracking.taskDrawer.properties.saveError", "Could not save the change.")
|
|
125
|
+
});
|
|
126
|
+
const taskQuery = useQuery({
|
|
127
|
+
queryKey: [...DRAWER_QUERY_ROOT, "task", `scope:${scopeVersion}`, taskId],
|
|
128
|
+
enabled: open && taskId.length > 0,
|
|
129
|
+
staleTime: 5e3,
|
|
130
|
+
queryFn: async () => {
|
|
131
|
+
const call = await apiCall(
|
|
132
|
+
`/api/staff/timesheets/tasks?id=${encodeURIComponent(taskId)}&pageSize=1`
|
|
133
|
+
);
|
|
134
|
+
if (!call.ok) throw new Error("[internal] task request failed");
|
|
135
|
+
const row = readItems(call.result)[0];
|
|
136
|
+
if (!row) return null;
|
|
137
|
+
const parsed = toBoardTask(row);
|
|
138
|
+
return parsed ? { task: parsed, createdAt: readString(row, "created_at", "createdAt") } : null;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
const task = taskQuery.data?.task ?? null;
|
|
142
|
+
const createdAt = taskQuery.data?.createdAt ?? null;
|
|
143
|
+
const projectId = task?.timeProjectId ?? null;
|
|
144
|
+
const taskInjectionContext = React.useMemo(
|
|
145
|
+
() => ({
|
|
146
|
+
entityId: TASK_ENTITY_ID,
|
|
147
|
+
recordId: taskId,
|
|
148
|
+
taskId,
|
|
149
|
+
timeProjectId: projectId,
|
|
150
|
+
retryLastMutation
|
|
151
|
+
}),
|
|
152
|
+
[projectId, retryLastMutation, taskId]
|
|
153
|
+
);
|
|
154
|
+
const isChildTask = !!task?.parentTaskId;
|
|
155
|
+
React.useEffect(() => {
|
|
156
|
+
if (!task) return;
|
|
157
|
+
versionRef.current = task.updatedAt;
|
|
158
|
+
setTagIds(task.tagIds);
|
|
159
|
+
}, [task]);
|
|
160
|
+
const statusesQuery = useQuery({
|
|
161
|
+
queryKey: [...DRAWER_QUERY_ROOT, "statuses", `scope:${scopeVersion}`, projectId ?? "none"],
|
|
162
|
+
enabled: open && !!projectId,
|
|
163
|
+
staleTime: 3e4,
|
|
164
|
+
queryFn: async () => {
|
|
165
|
+
if (!projectId) return [];
|
|
166
|
+
const call = await apiCall(
|
|
167
|
+
`/api/staff/timesheets/task-statuses?timeProjectId=${encodeURIComponent(projectId)}&page=1&pageSize=${DIRECTORY_PAGE_SIZE}&sortField=position&sortDir=asc`
|
|
168
|
+
);
|
|
169
|
+
if (!call.ok) return [];
|
|
170
|
+
const statuses2 = readItems(call.result).map(toBoardStatus).filter((status2) => status2 !== null);
|
|
171
|
+
return sortByPosition(statuses2);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
const statuses = React.useMemo(() => statusesQuery.data ?? [], [statusesQuery.data]);
|
|
175
|
+
const childrenQuery = useQuery({
|
|
176
|
+
queryKey: [...DRAWER_QUERY_ROOT, "children", `scope:${scopeVersion}`, taskId],
|
|
177
|
+
enabled: open && !isChildTask && !!task,
|
|
178
|
+
staleTime: 1e4,
|
|
179
|
+
queryFn: async () => {
|
|
180
|
+
const call = await apiCall(
|
|
181
|
+
`/api/staff/timesheets/tasks?parentTaskId=${encodeURIComponent(taskId)}&page=1&pageSize=${CHILD_PAGE_SIZE}&sortField=position&sortDir=asc`
|
|
182
|
+
);
|
|
183
|
+
if (!call.ok) return [];
|
|
184
|
+
const rows = readItems(call.result).map(toBoardTask).filter((row) => row !== null);
|
|
185
|
+
return sortByPosition(rows);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
const children = React.useMemo(() => childrenQuery.data ?? [], [childrenQuery.data]);
|
|
189
|
+
const commentsQuery = useQuery({
|
|
190
|
+
queryKey: [...DRAWER_QUERY_ROOT, "comments", `scope:${scopeVersion}`, taskId],
|
|
191
|
+
enabled: open && taskId.length > 0,
|
|
192
|
+
staleTime: 1e4,
|
|
193
|
+
queryFn: async () => {
|
|
194
|
+
const call = await apiCall(
|
|
195
|
+
`/api/staff/timesheets/tasks/${encodeURIComponent(taskId)}/comments?page=1&pageSize=${COMMENT_PAGE_SIZE}`
|
|
196
|
+
);
|
|
197
|
+
if (!call.ok) throw new Error("[internal] comments request failed");
|
|
198
|
+
return readItems(call.result).map(toDrawerComment).filter((comment) => comment !== null);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
const entriesQuery = useQuery({
|
|
202
|
+
queryKey: [...DRAWER_QUERY_ROOT, "entries", `scope:${scopeVersion}`, projectId ?? "none"],
|
|
203
|
+
enabled: open && !!projectId,
|
|
204
|
+
staleTime: 1e4,
|
|
205
|
+
queryFn: async () => projectId ? fetchProjectEntries(projectId) : { rows: [], partial: false }
|
|
206
|
+
});
|
|
207
|
+
const selfQuery = useQuery({
|
|
208
|
+
queryKey: [...DRAWER_QUERY_ROOT, "self", `scope:${scopeVersion}`],
|
|
209
|
+
enabled: open,
|
|
210
|
+
staleTime: 3e5,
|
|
211
|
+
queryFn: async () => {
|
|
212
|
+
const call = await apiCall("/api/staff/team-members/self");
|
|
213
|
+
return call.ok ? call.result?.member?.id ?? null : null;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
const selfStaffMemberId = selfQuery.data ?? null;
|
|
217
|
+
const membersQuery = useQuery({
|
|
218
|
+
queryKey: [...DRAWER_QUERY_ROOT, "members", `scope:${scopeVersion}`],
|
|
219
|
+
enabled: open,
|
|
220
|
+
staleTime: 3e5,
|
|
221
|
+
queryFn: async () => {
|
|
222
|
+
const call = await apiCall(
|
|
223
|
+
`/api/staff/team-members?page=1&pageSize=${DIRECTORY_PAGE_SIZE}&isActive=true`
|
|
224
|
+
);
|
|
225
|
+
if (!call.ok) return [];
|
|
226
|
+
return readItems(call.result).map((row) => {
|
|
227
|
+
const id = readString(row, "id");
|
|
228
|
+
if (!id) return null;
|
|
229
|
+
return { id, name: readString(row, "display_name", "displayName") ?? id };
|
|
230
|
+
}).filter((member) => member !== null);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
const members = React.useMemo(() => membersQuery.data ?? [], [membersQuery.data]);
|
|
234
|
+
const memberNames = React.useMemo(() => {
|
|
235
|
+
const map = /* @__PURE__ */ new Map();
|
|
236
|
+
for (const member of members) map.set(member.id, member.name);
|
|
237
|
+
return map;
|
|
238
|
+
}, [members]);
|
|
239
|
+
const tagsQuery = useQuery({
|
|
240
|
+
queryKey: [...DRAWER_QUERY_ROOT, "tags", `scope:${scopeVersion}`],
|
|
241
|
+
enabled: open,
|
|
242
|
+
staleTime: 3e5,
|
|
243
|
+
queryFn: async () => {
|
|
244
|
+
const call = await apiCall(
|
|
245
|
+
`/api/staff/timesheets/tags?page=1&pageSize=${DIRECTORY_PAGE_SIZE}&sortField=label&sortDir=asc`
|
|
246
|
+
);
|
|
247
|
+
if (!call.ok) return [];
|
|
248
|
+
return readItems(call.result).map((row) => {
|
|
249
|
+
const id = readString(row, "id");
|
|
250
|
+
if (!id) return null;
|
|
251
|
+
return { id, label: readString(row, "label") ?? id, color: readString(row, "color") };
|
|
252
|
+
}).filter((tag) => tag !== null);
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
const tagOptions = React.useMemo(() => tagsQuery.data ?? [], [tagsQuery.data]);
|
|
256
|
+
const runningTimerQuery = useQuery({
|
|
257
|
+
queryKey: [...DRAWER_QUERY_ROOT, "running-timer", `scope:${scopeVersion}`, selfStaffMemberId ?? "none"],
|
|
258
|
+
enabled: open && !!selfStaffMemberId,
|
|
259
|
+
staleTime: 15e3,
|
|
260
|
+
refetchInterval: 3e4,
|
|
261
|
+
queryFn: async () => {
|
|
262
|
+
if (!selfStaffMemberId) return { entryId: null, taskId: null, startedAt: null };
|
|
263
|
+
const call = await apiCall(
|
|
264
|
+
`/api/staff/timesheets/time-entries?staffMemberId=${encodeURIComponent(selfStaffMemberId)}&running=true&pageSize=${ENTRY_PAGE_SIZE}`
|
|
265
|
+
);
|
|
266
|
+
if (!call.ok) return { entryId: null, taskId: null, startedAt: null };
|
|
267
|
+
for (const row of readItems(call.result)) {
|
|
268
|
+
const startedAt = readString(row, "started_at", "startedAt");
|
|
269
|
+
const endedAt = readString(row, "ended_at", "endedAt");
|
|
270
|
+
if (!startedAt || endedAt) continue;
|
|
271
|
+
return {
|
|
272
|
+
entryId: readString(row, "id"),
|
|
273
|
+
taskId: readString(row, "task_id", "taskId"),
|
|
274
|
+
startedAt
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
return { entryId: null, taskId: null, startedAt: null };
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
const runningTimer = runningTimerQuery.data ?? { entryId: null, taskId: null, startedAt: null };
|
|
281
|
+
const timerRunningHere = !!runningTimer.entryId && runningTimer.taskId === taskId;
|
|
282
|
+
React.useEffect(() => {
|
|
283
|
+
if (!open || !timerRunningHere) return;
|
|
284
|
+
const handle = setInterval(() => setNow(Date.now()), ELAPSED_TICK_MS);
|
|
285
|
+
return () => clearInterval(handle);
|
|
286
|
+
}, [open, timerRunningHere]);
|
|
287
|
+
const doneStatusIds = React.useMemo(
|
|
288
|
+
() => new Set(statuses.filter((status2) => status2.isDone).map((status2) => status2.id)),
|
|
289
|
+
[statuses]
|
|
290
|
+
);
|
|
291
|
+
const progress = React.useMemo(
|
|
292
|
+
() => computeSubtaskProgress(children, doneStatusIds).get(taskId) ?? { total: 0, done: 0 },
|
|
293
|
+
[children, doneStatusIds, taskId]
|
|
294
|
+
);
|
|
295
|
+
const subtaskTotal = Math.max(progress.total, task?.childCount ?? 0);
|
|
296
|
+
const taskIdsForEntries = React.useMemo(() => {
|
|
297
|
+
const ids = /* @__PURE__ */ new Set([taskId]);
|
|
298
|
+
for (const child of children) ids.add(child.id);
|
|
299
|
+
return ids;
|
|
300
|
+
}, [children, taskId]);
|
|
301
|
+
const entries = React.useMemo(() => {
|
|
302
|
+
const rows = entriesQuery.data?.rows ?? [];
|
|
303
|
+
return rows.map(toDrawerEntry).filter((entry) => entry !== null && !!entry.taskId && taskIdsForEntries.has(entry.taskId));
|
|
304
|
+
}, [entriesQuery.data, taskIdsForEntries]);
|
|
305
|
+
const totals = React.useMemo(
|
|
306
|
+
() => summarizeEntries(entries, entriesQuery.data?.partial ?? false),
|
|
307
|
+
[entries, entriesQuery.data]
|
|
308
|
+
);
|
|
309
|
+
const invalidate = React.useCallback(
|
|
310
|
+
(part) => {
|
|
311
|
+
queryClient.invalidateQueries({ queryKey: [...DRAWER_QUERY_ROOT, part] }).catch(() => {
|
|
312
|
+
});
|
|
313
|
+
},
|
|
314
|
+
[queryClient]
|
|
315
|
+
);
|
|
316
|
+
const refreshVersion = React.useCallback(async () => {
|
|
317
|
+
const refreshed = await taskQuery.refetch();
|
|
318
|
+
const updatedAt = refreshed.data?.task.updatedAt ?? null;
|
|
319
|
+
if (updatedAt) versionRef.current = updatedAt;
|
|
320
|
+
}, [taskQuery]);
|
|
321
|
+
const reportError = React.useCallback(
|
|
322
|
+
(error, fallback) => {
|
|
323
|
+
if (surfaceRecordConflict(error, t)) {
|
|
324
|
+
invalidate("task");
|
|
325
|
+
invalidate("children");
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
logger.error("staff.time_tracking task drawer mutation failed", { err: error });
|
|
329
|
+
flash(error instanceof Error && error.message ? error.message : fallback, "error");
|
|
330
|
+
},
|
|
331
|
+
[invalidate, t]
|
|
332
|
+
);
|
|
333
|
+
const handleQuickLog = React.useCallback(
|
|
334
|
+
async ({ minutes, description, date, isBillable, startClock, endClock }) => {
|
|
335
|
+
if (!selfStaffMemberId || !projectId) {
|
|
336
|
+
flash(t("staff.time_tracking.taskDrawer.quickLog.error", "Could not save the time entry."), "error");
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
setBusy(true);
|
|
340
|
+
try {
|
|
341
|
+
await runMutation({
|
|
342
|
+
operation: () => apiCallOrThrow(
|
|
343
|
+
"/api/staff/timesheets/time-entries",
|
|
344
|
+
{
|
|
345
|
+
method: "POST",
|
|
346
|
+
headers: { "content-type": "application/json" },
|
|
347
|
+
body: JSON.stringify({
|
|
348
|
+
// US-C5 defaults — today, me, billable — unless the Details block
|
|
349
|
+
// overrode them. The person is never overridable here: logging
|
|
350
|
+
// for somebody else is a different act with different permissions.
|
|
351
|
+
staffMemberId: selfStaffMemberId,
|
|
352
|
+
date,
|
|
353
|
+
durationMinutes: minutes,
|
|
354
|
+
taskId,
|
|
355
|
+
timeProjectId: projectId,
|
|
356
|
+
isBillable,
|
|
357
|
+
description,
|
|
358
|
+
// The clocks are sent as a pair or not at all. A lone
|
|
359
|
+
// `started_at` is indistinguishable from a running timer —
|
|
360
|
+
// `started_at IS NOT NULL AND ended_at IS NULL` is exactly how
|
|
361
|
+
// the list identifies one — so an entry with a start and no end
|
|
362
|
+
// shows up as a timer running since that moment, and stopping it
|
|
363
|
+
// fails because no timer segment was ever opened for it.
|
|
364
|
+
//
|
|
365
|
+
// The duration is authoritative here, so the missing half is
|
|
366
|
+
// derived from it rather than left blank: the same 2-of-3
|
|
367
|
+
// arithmetic the full entry form does.
|
|
368
|
+
...buildEntryClocks({ date, startClock, endClock, minutes }),
|
|
369
|
+
source: "manual"
|
|
370
|
+
})
|
|
371
|
+
},
|
|
372
|
+
{ errorMessage: t("staff.time_tracking.taskDrawer.quickLog.error", "Could not save the time entry.") }
|
|
373
|
+
),
|
|
374
|
+
context: {
|
|
375
|
+
formId: TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
376
|
+
resourceKind: "staff.timesheets.time_entry",
|
|
377
|
+
resourceId: taskId,
|
|
378
|
+
retryLastMutation
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
flash(t("staff.time_tracking.taskDrawer.quickLog.saved", "Time logged."), "success");
|
|
382
|
+
invalidate("task");
|
|
383
|
+
invalidate("entries");
|
|
384
|
+
onChanged?.();
|
|
385
|
+
return true;
|
|
386
|
+
} catch (error) {
|
|
387
|
+
reportError(error, t("staff.time_tracking.taskDrawer.quickLog.error", "Could not save the time entry."));
|
|
388
|
+
return false;
|
|
389
|
+
} finally {
|
|
390
|
+
setBusy(false);
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
[invalidate, onChanged, projectId, reportError, retryLastMutation, runMutation, selfStaffMemberId, t, taskId]
|
|
394
|
+
);
|
|
395
|
+
const stopTimerEntry = React.useCallback(
|
|
396
|
+
async (entryId) => {
|
|
397
|
+
await runMutation({
|
|
398
|
+
operation: () => apiCallOrThrow(
|
|
399
|
+
`/api/staff/timesheets/time-entries/${encodeURIComponent(entryId)}/timer-stop`,
|
|
400
|
+
{ method: "POST" },
|
|
401
|
+
{ errorMessage: t("staff.time_tracking.board.timer.stopError", "Could not stop the timer.") }
|
|
402
|
+
),
|
|
403
|
+
context: {
|
|
404
|
+
formId: TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
405
|
+
resourceKind: "staff.timesheets.time_entry",
|
|
406
|
+
resourceId: entryId,
|
|
407
|
+
retryLastMutation
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
},
|
|
411
|
+
[retryLastMutation, runMutation, t]
|
|
412
|
+
);
|
|
413
|
+
const handleStopTimer = React.useCallback(async () => {
|
|
414
|
+
if (!runningTimer.entryId) return;
|
|
415
|
+
setTimerBusy(true);
|
|
416
|
+
try {
|
|
417
|
+
await stopTimerEntry(runningTimer.entryId);
|
|
418
|
+
await runningTimerQuery.refetch();
|
|
419
|
+
invalidate("task");
|
|
420
|
+
invalidate("entries");
|
|
421
|
+
onChanged?.();
|
|
422
|
+
} catch (error) {
|
|
423
|
+
reportError(error, t("staff.time_tracking.board.timer.stopError", "Could not stop the timer."));
|
|
424
|
+
} finally {
|
|
425
|
+
setTimerBusy(false);
|
|
426
|
+
}
|
|
427
|
+
}, [invalidate, onChanged, reportError, runningTimer.entryId, runningTimerQuery, stopTimerEntry, t]);
|
|
428
|
+
const handleStartTimer = React.useCallback(async () => {
|
|
429
|
+
if (!selfStaffMemberId || !projectId) return;
|
|
430
|
+
if (runningTimer.entryId && runningTimer.taskId !== taskId) {
|
|
431
|
+
const confirmed = await confirm({
|
|
432
|
+
title: t("staff.time_tracking.taskDrawer.timer.switchTitle", "A timer is running on another task"),
|
|
433
|
+
text: t(
|
|
434
|
+
"staff.time_tracking.taskDrawer.timer.switchText",
|
|
435
|
+
"Only one timer can run at a time. Stop the other one and start it here?"
|
|
436
|
+
)
|
|
437
|
+
});
|
|
438
|
+
if (!confirmed) return;
|
|
439
|
+
}
|
|
440
|
+
setTimerBusy(true);
|
|
441
|
+
try {
|
|
442
|
+
if (runningTimer.entryId && runningTimer.taskId !== taskId) {
|
|
443
|
+
await stopTimerEntry(runningTimer.entryId);
|
|
444
|
+
}
|
|
445
|
+
const started = await runMutation({
|
|
446
|
+
operation: () => apiCallOrThrow(
|
|
447
|
+
"/api/staff/timesheets/time-entries/start-timer",
|
|
448
|
+
{
|
|
449
|
+
method: "POST",
|
|
450
|
+
headers: { "content-type": "application/json" },
|
|
451
|
+
body: JSON.stringify({
|
|
452
|
+
staffMemberId: selfStaffMemberId,
|
|
453
|
+
timeProjectId: projectId,
|
|
454
|
+
date: todayIsoDate(),
|
|
455
|
+
notes: task?.title ?? null
|
|
456
|
+
})
|
|
457
|
+
},
|
|
458
|
+
{ errorMessage: t("staff.time_tracking.board.timer.startError", "Could not start the timer.") }
|
|
459
|
+
),
|
|
460
|
+
context: {
|
|
461
|
+
formId: TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
462
|
+
resourceKind: "staff.timesheets.time_entry",
|
|
463
|
+
resourceId: taskId,
|
|
464
|
+
retryLastMutation
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
const entryId = typeof started?.result?.id === "string" ? started.result.id : null;
|
|
468
|
+
if (entryId) {
|
|
469
|
+
const linked = await apiCall("/api/staff/timesheets/time-entries", {
|
|
470
|
+
method: "PUT",
|
|
471
|
+
headers: { "content-type": "application/json" },
|
|
472
|
+
body: JSON.stringify({ id: entryId, taskId })
|
|
473
|
+
});
|
|
474
|
+
if (!linked.ok) {
|
|
475
|
+
flash(
|
|
476
|
+
t(
|
|
477
|
+
"staff.time_tracking.board.timer.linkWarning",
|
|
478
|
+
"The timer is running but is not linked to this task yet."
|
|
479
|
+
),
|
|
480
|
+
"warning"
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
await runningTimerQuery.refetch();
|
|
485
|
+
onChanged?.();
|
|
486
|
+
} catch (error) {
|
|
487
|
+
reportError(error, t("staff.time_tracking.board.timer.startError", "Could not start the timer."));
|
|
488
|
+
} finally {
|
|
489
|
+
setTimerBusy(false);
|
|
490
|
+
}
|
|
491
|
+
}, [
|
|
492
|
+
confirm,
|
|
493
|
+
onChanged,
|
|
494
|
+
projectId,
|
|
495
|
+
reportError,
|
|
496
|
+
retryLastMutation,
|
|
497
|
+
runMutation,
|
|
498
|
+
runningTimer.entryId,
|
|
499
|
+
runningTimer.taskId,
|
|
500
|
+
runningTimerQuery,
|
|
501
|
+
selfStaffMemberId,
|
|
502
|
+
stopTimerEntry,
|
|
503
|
+
t,
|
|
504
|
+
task?.title,
|
|
505
|
+
taskId
|
|
506
|
+
]);
|
|
507
|
+
const runSerialized = React.useCallback(async (job) => {
|
|
508
|
+
const chained = saveChainRef.current.then(job, job);
|
|
509
|
+
saveChainRef.current = chained.catch(() => {
|
|
510
|
+
});
|
|
511
|
+
return chained;
|
|
512
|
+
}, []);
|
|
513
|
+
const saveTaskField = React.useCallback(
|
|
514
|
+
async (patch) => {
|
|
515
|
+
if (!task) return;
|
|
516
|
+
setBusy(true);
|
|
517
|
+
try {
|
|
518
|
+
await runSerialized(async () => {
|
|
519
|
+
await runMutation({
|
|
520
|
+
operation: () => withScopedApiRequestHeaders(
|
|
521
|
+
buildOptimisticLockHeader(versionRef.current),
|
|
522
|
+
() => apiCallOrThrow(
|
|
523
|
+
"/api/staff/timesheets/tasks",
|
|
524
|
+
{
|
|
525
|
+
method: "PUT",
|
|
526
|
+
headers: { "content-type": "application/json" },
|
|
527
|
+
body: JSON.stringify({ id: taskId, ...patch })
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
errorMessage: t(
|
|
531
|
+
"staff.time_tracking.taskDrawer.properties.saveError",
|
|
532
|
+
"Could not save the change."
|
|
533
|
+
)
|
|
534
|
+
}
|
|
535
|
+
)
|
|
536
|
+
),
|
|
537
|
+
context: {
|
|
538
|
+
formId: TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
539
|
+
resourceKind: "staff.timesheets.task",
|
|
540
|
+
resourceId: taskId,
|
|
541
|
+
retryLastMutation
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
await refreshVersion();
|
|
545
|
+
});
|
|
546
|
+
onChanged?.();
|
|
547
|
+
} catch (error) {
|
|
548
|
+
reportError(error, t("staff.time_tracking.taskDrawer.properties.saveError", "Could not save the change."));
|
|
549
|
+
} finally {
|
|
550
|
+
setBusy(false);
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
[onChanged, refreshVersion, reportError, retryLastMutation, runMutation, runSerialized, t, task, taskId]
|
|
554
|
+
);
|
|
555
|
+
const handleStatusChange = React.useCallback(
|
|
556
|
+
(statusId) => {
|
|
557
|
+
if (!task || statusId === task.taskStatusId) return;
|
|
558
|
+
setBusy(true);
|
|
559
|
+
void runSerialized(async () => {
|
|
560
|
+
try {
|
|
561
|
+
const moved = await runMutation({
|
|
562
|
+
operation: () => withScopedApiRequestHeaders(
|
|
563
|
+
buildOptimisticLockHeader(versionRef.current),
|
|
564
|
+
() => apiCallOrThrow(
|
|
565
|
+
`/api/staff/timesheets/tasks/${encodeURIComponent(taskId)}/status`,
|
|
566
|
+
{
|
|
567
|
+
method: "PATCH",
|
|
568
|
+
headers: { "content-type": "application/json" },
|
|
569
|
+
body: JSON.stringify({ taskStatusId: statusId })
|
|
570
|
+
},
|
|
571
|
+
{ errorMessage: t("staff.time_tracking.board.move.error", "Could not move the task.") }
|
|
572
|
+
)
|
|
573
|
+
),
|
|
574
|
+
context: {
|
|
575
|
+
formId: TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
576
|
+
resourceKind: "staff.timesheets.task",
|
|
577
|
+
resourceId: taskId,
|
|
578
|
+
retryLastMutation
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
const updatedAt = typeof moved?.result?.updatedAt === "string" ? moved.result.updatedAt : null;
|
|
582
|
+
if (updatedAt) versionRef.current = updatedAt;
|
|
583
|
+
else await refreshVersion();
|
|
584
|
+
invalidate("task");
|
|
585
|
+
onChanged?.();
|
|
586
|
+
} catch (error) {
|
|
587
|
+
reportError(error, t("staff.time_tracking.board.move.error", "Could not move the task."));
|
|
588
|
+
} finally {
|
|
589
|
+
setBusy(false);
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
},
|
|
593
|
+
[
|
|
594
|
+
invalidate,
|
|
595
|
+
onChanged,
|
|
596
|
+
refreshVersion,
|
|
597
|
+
reportError,
|
|
598
|
+
retryLastMutation,
|
|
599
|
+
runMutation,
|
|
600
|
+
runSerialized,
|
|
601
|
+
t,
|
|
602
|
+
task,
|
|
603
|
+
taskId
|
|
604
|
+
]
|
|
605
|
+
);
|
|
606
|
+
const handleAssigneeChange = React.useCallback(
|
|
607
|
+
(value) => {
|
|
608
|
+
void saveTaskField({ assigneeStaffMemberId: value === "" ? null : value });
|
|
609
|
+
},
|
|
610
|
+
[saveTaskField]
|
|
611
|
+
);
|
|
612
|
+
const handleToggleSubtask = React.useCallback(
|
|
613
|
+
async (child, done) => {
|
|
614
|
+
const targetStatusId = done ? resolveDoneStatusId(statuses) : resolveDefaultStatusId(statuses);
|
|
615
|
+
if (!targetStatusId) return;
|
|
616
|
+
setBusy(true);
|
|
617
|
+
try {
|
|
618
|
+
await runMutation({
|
|
619
|
+
operation: () => (
|
|
620
|
+
// The child's own version, not the parent's — this write touches the
|
|
621
|
+
// child row.
|
|
622
|
+
withScopedApiRequestHeaders(
|
|
623
|
+
buildOptimisticLockHeader(child.updatedAt),
|
|
624
|
+
() => apiCallOrThrow(
|
|
625
|
+
`/api/staff/timesheets/tasks/${encodeURIComponent(child.id)}/status`,
|
|
626
|
+
{
|
|
627
|
+
method: "PATCH",
|
|
628
|
+
headers: { "content-type": "application/json" },
|
|
629
|
+
body: JSON.stringify({ taskStatusId: targetStatusId })
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
errorMessage: t(
|
|
633
|
+
"staff.time_tracking.taskDrawer.subtasks.toggleError",
|
|
634
|
+
"Could not change the subtask status."
|
|
635
|
+
)
|
|
636
|
+
}
|
|
637
|
+
)
|
|
638
|
+
)
|
|
639
|
+
),
|
|
640
|
+
context: {
|
|
641
|
+
formId: TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
642
|
+
resourceKind: "staff.timesheets.task",
|
|
643
|
+
resourceId: child.id,
|
|
644
|
+
retryLastMutation
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
invalidate("children");
|
|
648
|
+
invalidate("task");
|
|
649
|
+
onChanged?.();
|
|
650
|
+
} catch (error) {
|
|
651
|
+
reportError(
|
|
652
|
+
error,
|
|
653
|
+
t("staff.time_tracking.taskDrawer.subtasks.toggleError", "Could not change the subtask status.")
|
|
654
|
+
);
|
|
655
|
+
} finally {
|
|
656
|
+
setBusy(false);
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
[invalidate, onChanged, reportError, retryLastMutation, runMutation, statuses, t]
|
|
660
|
+
);
|
|
661
|
+
const handleAddSubtask = React.useCallback(async () => {
|
|
662
|
+
const title = subtaskDraft.trim();
|
|
663
|
+
if (!title || !projectId) {
|
|
664
|
+
setComposingSubtask(false);
|
|
665
|
+
setSubtaskDraft("");
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
setBusy(true);
|
|
669
|
+
try {
|
|
670
|
+
await runMutation({
|
|
671
|
+
operation: () => apiCallOrThrow(
|
|
672
|
+
"/api/staff/timesheets/tasks",
|
|
673
|
+
{
|
|
674
|
+
method: "POST",
|
|
675
|
+
headers: { "content-type": "application/json" },
|
|
676
|
+
body: JSON.stringify({
|
|
677
|
+
timeProjectId: projectId,
|
|
678
|
+
parentTaskId: taskId,
|
|
679
|
+
title,
|
|
680
|
+
assigneeStaffMemberId: selfStaffMemberId
|
|
681
|
+
})
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
errorMessage: t("staff.time_tracking.taskDrawer.subtasks.addError", "Could not add the subtask.")
|
|
685
|
+
}
|
|
686
|
+
),
|
|
687
|
+
context: {
|
|
688
|
+
formId: TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
689
|
+
resourceKind: "staff.timesheets.task",
|
|
690
|
+
resourceId: taskId,
|
|
691
|
+
retryLastMutation
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
setSubtaskDraft("");
|
|
695
|
+
setComposingSubtask(false);
|
|
696
|
+
invalidate("children");
|
|
697
|
+
invalidate("task");
|
|
698
|
+
onChanged?.();
|
|
699
|
+
} catch (error) {
|
|
700
|
+
reportError(error, t("staff.time_tracking.taskDrawer.subtasks.addError", "Could not add the subtask."));
|
|
701
|
+
} finally {
|
|
702
|
+
setBusy(false);
|
|
703
|
+
}
|
|
704
|
+
}, [
|
|
705
|
+
invalidate,
|
|
706
|
+
onChanged,
|
|
707
|
+
projectId,
|
|
708
|
+
reportError,
|
|
709
|
+
retryLastMutation,
|
|
710
|
+
runMutation,
|
|
711
|
+
selfStaffMemberId,
|
|
712
|
+
subtaskDraft,
|
|
713
|
+
t,
|
|
714
|
+
taskId
|
|
715
|
+
]);
|
|
716
|
+
const handlePostComment = React.useCallback(
|
|
717
|
+
async (body2) => {
|
|
718
|
+
setBusy(true);
|
|
719
|
+
try {
|
|
720
|
+
await runMutation({
|
|
721
|
+
operation: () => apiCallOrThrow(
|
|
722
|
+
`/api/staff/timesheets/tasks/${encodeURIComponent(taskId)}/comments`,
|
|
723
|
+
{
|
|
724
|
+
method: "POST",
|
|
725
|
+
headers: { "content-type": "application/json" },
|
|
726
|
+
body: JSON.stringify({ body: body2 })
|
|
727
|
+
},
|
|
728
|
+
{ errorMessage: t("staff.time_tracking.taskDrawer.comments.error", "Could not post the comment.") }
|
|
729
|
+
),
|
|
730
|
+
context: {
|
|
731
|
+
formId: TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
732
|
+
resourceKind: "staff.timesheets.task_comment",
|
|
733
|
+
resourceId: taskId,
|
|
734
|
+
retryLastMutation
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
invalidate("comments");
|
|
738
|
+
return true;
|
|
739
|
+
} catch (error) {
|
|
740
|
+
reportError(error, t("staff.time_tracking.taskDrawer.comments.error", "Could not post the comment."));
|
|
741
|
+
return false;
|
|
742
|
+
} finally {
|
|
743
|
+
setBusy(false);
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
[invalidate, reportError, retryLastMutation, runMutation, t, taskId]
|
|
747
|
+
);
|
|
748
|
+
const handleTagChange = React.useCallback(
|
|
749
|
+
async (tagId, assign) => {
|
|
750
|
+
setBusy(true);
|
|
751
|
+
const previous = tagIds;
|
|
752
|
+
setTagIds(
|
|
753
|
+
(current) => assign ? Array.from(/* @__PURE__ */ new Set([...current, tagId])) : current.filter((id) => id !== tagId)
|
|
754
|
+
);
|
|
755
|
+
try {
|
|
756
|
+
await runMutation({
|
|
757
|
+
operation: () => apiCallOrThrow(
|
|
758
|
+
"/api/staff/timesheets/tags/task-assignments",
|
|
759
|
+
{
|
|
760
|
+
method: assign ? "POST" : "DELETE",
|
|
761
|
+
headers: { "content-type": "application/json" },
|
|
762
|
+
body: JSON.stringify({ taskId, tagIds: [tagId] })
|
|
763
|
+
},
|
|
764
|
+
{ errorMessage: t("staff.time_tracking.taskDrawer.properties.tagError", "Could not save the tags.") }
|
|
765
|
+
),
|
|
766
|
+
context: {
|
|
767
|
+
formId: TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
768
|
+
resourceKind: "staff.timesheets.task_tag",
|
|
769
|
+
resourceId: taskId,
|
|
770
|
+
retryLastMutation
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
onChanged?.();
|
|
774
|
+
} catch (error) {
|
|
775
|
+
setTagIds(previous);
|
|
776
|
+
reportError(error, t("staff.time_tracking.taskDrawer.properties.tagError", "Could not save the tags."));
|
|
777
|
+
} finally {
|
|
778
|
+
setBusy(false);
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
[onChanged, reportError, retryLastMutation, runMutation, t, tagIds, taskId]
|
|
782
|
+
);
|
|
783
|
+
const createTag = React.useCallback(
|
|
784
|
+
async (label) => {
|
|
785
|
+
try {
|
|
786
|
+
const created = await apiCallOrThrow(
|
|
787
|
+
"/api/staff/timesheets/tags",
|
|
788
|
+
{
|
|
789
|
+
method: "POST",
|
|
790
|
+
headers: { "content-type": "application/json" },
|
|
791
|
+
body: JSON.stringify({ label, slug: slugifyProjectName(label).toLowerCase() })
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
errorMessage: t(
|
|
795
|
+
"staff.time_tracking.entryDialog.errors.createTag",
|
|
796
|
+
"Could not create the tag."
|
|
797
|
+
)
|
|
798
|
+
}
|
|
799
|
+
);
|
|
800
|
+
const id = typeof created?.result?.id === "string" ? created.result.id : null;
|
|
801
|
+
if (!id) return null;
|
|
802
|
+
await queryClient.invalidateQueries({ queryKey: [...DRAWER_QUERY_ROOT, "tags"] });
|
|
803
|
+
return { id, label, color: null };
|
|
804
|
+
} catch (error) {
|
|
805
|
+
logger.warn("staff.time_tracking task drawer tag create failed", { err: error });
|
|
806
|
+
flash(t("staff.time_tracking.entryDialog.errors.createTag", "Could not create the tag."), "error");
|
|
807
|
+
return null;
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
[queryClient, t]
|
|
811
|
+
);
|
|
812
|
+
const status = React.useMemo(
|
|
813
|
+
() => statuses.find((entry) => entry.id === task?.taskStatusId) ?? null,
|
|
814
|
+
[statuses, task?.taskStatusId]
|
|
815
|
+
);
|
|
816
|
+
const statusVariant = status?.isDone ? "success" : status?.isDefault ? "neutral" : "info";
|
|
817
|
+
const recentEntries = React.useMemo(() => entries.slice(0, RECENT_ENTRY_COUNT), [entries]);
|
|
818
|
+
const assignedTags = React.useMemo(() => {
|
|
819
|
+
const byId = new Map(tagOptions.map((tag) => [tag.id, tag]));
|
|
820
|
+
return tagIds.map((id) => byId.get(id) ?? { id, label: id, color: null });
|
|
821
|
+
}, [tagIds, tagOptions]);
|
|
822
|
+
const availableTags = React.useMemo(
|
|
823
|
+
() => tagOptions.filter((tag) => !tagIds.includes(tag.id)),
|
|
824
|
+
[tagIds, tagOptions]
|
|
825
|
+
);
|
|
826
|
+
const doneStatusId = resolveDoneStatusId(statuses);
|
|
827
|
+
const body = (() => {
|
|
828
|
+
if (taskQuery.isLoading) {
|
|
829
|
+
return /* @__PURE__ */ jsx(LoadingMessage, { label: t("staff.time_tracking.taskDrawer.loading", "Loading the task\u2026") });
|
|
830
|
+
}
|
|
831
|
+
if (taskQuery.isError) {
|
|
832
|
+
return /* @__PURE__ */ jsx(ErrorMessage, { label: t("staff.time_tracking.taskDrawer.loadError", "Could not load the task.") });
|
|
833
|
+
}
|
|
834
|
+
if (!task) {
|
|
835
|
+
return /* @__PURE__ */ jsx(
|
|
836
|
+
ErrorMessage,
|
|
837
|
+
{
|
|
838
|
+
label: t("staff.time_tracking.tasks.errors.notFound", "Task not found or not accessible.")
|
|
839
|
+
}
|
|
840
|
+
);
|
|
841
|
+
}
|
|
842
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6", children: [
|
|
843
|
+
/* @__PURE__ */ jsx(
|
|
844
|
+
TaskQuickLog,
|
|
845
|
+
{
|
|
846
|
+
onLog: handleQuickLog,
|
|
847
|
+
logging: busy,
|
|
848
|
+
timerRunningHere,
|
|
849
|
+
elapsed: timerRunningHere ? formatElapsed(runningTimer.startedAt, now) : null,
|
|
850
|
+
timerBusy,
|
|
851
|
+
onStartTimer: () => {
|
|
852
|
+
void handleStartTimer();
|
|
853
|
+
},
|
|
854
|
+
onStopTimer: () => {
|
|
855
|
+
void handleStopTimer();
|
|
856
|
+
},
|
|
857
|
+
autoFocus: focusPanel === "time",
|
|
858
|
+
disabled: !canManage,
|
|
859
|
+
today: todayIsoDate()
|
|
860
|
+
}
|
|
861
|
+
),
|
|
862
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-2", "data-testid": "task-drawer-logged", children: [
|
|
863
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
864
|
+
/* @__PURE__ */ jsx("h3", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: t("staff.time_tracking.taskDrawer.logged.title", "Logged time") }),
|
|
865
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-base font-semibold tabular-nums text-foreground", "data-testid": "task-drawer-logged-total", children: formatBoardMinutes(task.loggedMinutes) })
|
|
866
|
+
] }),
|
|
867
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", "data-testid": "task-drawer-logged-split", children: t("staff.time_tracking.taskDrawer.logged.split", "own {own} \xB7 subtasks {children}", {
|
|
868
|
+
own: formatSplitMinutes(task.ownMinutes),
|
|
869
|
+
children: formatSplitMinutes(childMinutes(task.loggedMinutes, task.ownMinutes))
|
|
870
|
+
}) }),
|
|
871
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
872
|
+
/* @__PURE__ */ jsx(Badge, { variant: "success", children: t("staff.time_tracking.taskDrawer.logged.billable", "billable {hours}", {
|
|
873
|
+
hours: formatBoardMinutes(totals.billableMinutes)
|
|
874
|
+
}) }),
|
|
875
|
+
/* @__PURE__ */ jsx(Badge, { variant: "neutral", children: t("staff.time_tracking.taskDrawer.logged.nonBillable", "non-billable {hours}", {
|
|
876
|
+
hours: formatBoardMinutes(totals.nonBillableMinutes)
|
|
877
|
+
}) }),
|
|
878
|
+
canSeeMoney && totals.cost !== null ? /* @__PURE__ */ jsx(Badge, { variant: "info", "data-testid": "task-drawer-cost", children: t("staff.time_tracking.taskDrawer.logged.cost", "cost {amount}", {
|
|
879
|
+
amount: formatCurrency(totals.cost, totals.currencyCode) ?? String(totals.cost)
|
|
880
|
+
}) }) : null
|
|
881
|
+
] }),
|
|
882
|
+
totals.partial ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
883
|
+
"staff.time_tracking.taskDrawer.logged.partialHint",
|
|
884
|
+
"The split is counted from the most recent entries in this project."
|
|
885
|
+
) }) : null
|
|
886
|
+
] }),
|
|
887
|
+
isChildTask ? null : /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-testid": "task-drawer-subtasks", children: [
|
|
888
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
889
|
+
/* @__PURE__ */ jsx("h3", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: t("staff.time_tracking.taskDrawer.subtasks.title", "Subtasks") }),
|
|
890
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs tabular-nums text-muted-foreground", children: t("staff.time_tracking.taskDrawer.subtasks.count", "{done}/{total}", {
|
|
891
|
+
done: progress.done,
|
|
892
|
+
total: subtaskTotal
|
|
893
|
+
}) })
|
|
894
|
+
] }),
|
|
895
|
+
subtaskTotal > 0 ? /* @__PURE__ */ jsx(Progress, { value: subtaskTotal > 0 ? progress.done / subtaskTotal * 100 : 0, max: 100 }) : null,
|
|
896
|
+
children.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("staff.time_tracking.taskDrawer.subtasks.empty", "No subtasks yet.") }) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col", children: children.map((child) => {
|
|
897
|
+
const done = child.taskStatusId && doneStatusIds.has(child.taskStatusId) || !!child.closedAt;
|
|
898
|
+
const assigneeName = child.assigneeStaffMemberId ? memberNames.get(child.assigneeStaffMemberId) ?? child.assigneeStaffMemberId : t("staff.time_tracking.taskDrawer.properties.unassigned", "Unassigned");
|
|
899
|
+
return /* @__PURE__ */ jsxs(
|
|
900
|
+
"li",
|
|
901
|
+
{
|
|
902
|
+
className: "flex items-center gap-2.5 border-b border-border py-2 last:border-b-0",
|
|
903
|
+
"data-subtask-id": child.id,
|
|
904
|
+
children: [
|
|
905
|
+
/* @__PURE__ */ jsx(
|
|
906
|
+
Checkbox,
|
|
907
|
+
{
|
|
908
|
+
checked: done,
|
|
909
|
+
disabled: !canManage || busy || !doneStatusId,
|
|
910
|
+
"aria-label": t("staff.time_tracking.taskDrawer.subtasks.toggle", "Mark {title} as done", {
|
|
911
|
+
title: child.title
|
|
912
|
+
}),
|
|
913
|
+
onCheckedChange: (next) => {
|
|
914
|
+
void handleToggleSubtask(child, next === true);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
),
|
|
918
|
+
/* @__PURE__ */ jsx(
|
|
919
|
+
"span",
|
|
920
|
+
{
|
|
921
|
+
className: `min-w-0 flex-1 truncate text-sm ${done ? "text-muted-foreground line-through" : "text-foreground"}`,
|
|
922
|
+
children: child.title
|
|
923
|
+
}
|
|
924
|
+
),
|
|
925
|
+
/* @__PURE__ */ jsx(Avatar, { label: assigneeName, size: "xs" }),
|
|
926
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs tabular-nums text-muted-foreground", children: formatBoardMinutes(child.loggedMinutes) })
|
|
927
|
+
]
|
|
928
|
+
},
|
|
929
|
+
child.id
|
|
930
|
+
);
|
|
931
|
+
}) }),
|
|
932
|
+
!doneStatusId && children.length > 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
933
|
+
"staff.time_tracking.taskDrawer.subtasks.noDoneColumn",
|
|
934
|
+
"This project has no done column, so a subtask has no way to close."
|
|
935
|
+
) }) : null,
|
|
936
|
+
canManage ? composingSubtask ? /* @__PURE__ */ jsx(
|
|
937
|
+
Input,
|
|
938
|
+
{
|
|
939
|
+
autoFocus: true,
|
|
940
|
+
size: "sm",
|
|
941
|
+
value: subtaskDraft,
|
|
942
|
+
disabled: busy,
|
|
943
|
+
onChange: (event) => setSubtaskDraft(event.target.value),
|
|
944
|
+
onKeyDown: (event) => {
|
|
945
|
+
if (event.key === "Enter") {
|
|
946
|
+
event.preventDefault();
|
|
947
|
+
void handleAddSubtask();
|
|
948
|
+
}
|
|
949
|
+
if (event.key === "Escape") {
|
|
950
|
+
event.preventDefault();
|
|
951
|
+
event.stopPropagation();
|
|
952
|
+
setComposingSubtask(false);
|
|
953
|
+
setSubtaskDraft("");
|
|
954
|
+
}
|
|
955
|
+
},
|
|
956
|
+
placeholder: t("staff.time_tracking.taskDrawer.subtasks.placeholder", "Subtask title"),
|
|
957
|
+
"aria-label": t("staff.time_tracking.taskDrawer.subtasks.add", "Add subtask"),
|
|
958
|
+
"data-testid": "task-drawer-subtask-input"
|
|
959
|
+
}
|
|
960
|
+
) : /* @__PURE__ */ jsxs(
|
|
961
|
+
Button,
|
|
962
|
+
{
|
|
963
|
+
type: "button",
|
|
964
|
+
variant: "ghost",
|
|
965
|
+
size: "sm",
|
|
966
|
+
className: "self-start",
|
|
967
|
+
onClick: () => setComposingSubtask(true),
|
|
968
|
+
"data-testid": "task-drawer-add-subtask",
|
|
969
|
+
children: [
|
|
970
|
+
/* @__PURE__ */ jsx(Plus, { className: "size-3.5", "aria-hidden": "true" }),
|
|
971
|
+
t("staff.time_tracking.taskDrawer.subtasks.add", "Add subtask")
|
|
972
|
+
]
|
|
973
|
+
}
|
|
974
|
+
) : null
|
|
975
|
+
] }),
|
|
976
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-testid": "task-drawer-entries", children: [
|
|
977
|
+
/* @__PURE__ */ jsx("h3", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: t("staff.time_tracking.taskDrawer.entries.title", "Time entries ({count})", { count: entries.length }) }),
|
|
978
|
+
recentEntries.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("staff.time_tracking.taskDrawer.entries.empty", "No time entries yet.") }) : /* @__PURE__ */ jsx("ul", { className: "flex flex-col", children: recentEntries.map((entry) => /* @__PURE__ */ jsxs(
|
|
979
|
+
"li",
|
|
980
|
+
{
|
|
981
|
+
className: "flex items-center gap-3 border-b border-border py-2 text-sm last:border-b-0",
|
|
982
|
+
"data-entry-id": entry.id,
|
|
983
|
+
children: [
|
|
984
|
+
/* @__PURE__ */ jsx("span", { className: "w-20 shrink-0 text-xs text-muted-foreground", children: formatDate(entry.date) ?? "" }),
|
|
985
|
+
/* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate text-foreground", children: entry.description ?? t("staff.time_tracking.taskDrawer.entries.noDescription", "No description") }),
|
|
986
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-xs tabular-nums text-muted-foreground", children: formatBoardMinutes(entry.durationMinutes) })
|
|
987
|
+
]
|
|
988
|
+
},
|
|
989
|
+
entry.id
|
|
990
|
+
)) }),
|
|
991
|
+
/* @__PURE__ */ jsx(
|
|
992
|
+
Button,
|
|
993
|
+
{
|
|
994
|
+
type: "button",
|
|
995
|
+
variant: "ghost",
|
|
996
|
+
size: "sm",
|
|
997
|
+
className: "self-start",
|
|
998
|
+
onClick: () => router.push(`${ENTRIES_LIST_PATH}?taskId=${encodeURIComponent(taskId)}`),
|
|
999
|
+
children: t("staff.time_tracking.taskDrawer.entries.showAll", "Show all")
|
|
1000
|
+
}
|
|
1001
|
+
)
|
|
1002
|
+
] }),
|
|
1003
|
+
/* @__PURE__ */ jsx(
|
|
1004
|
+
TaskCommentThread,
|
|
1005
|
+
{
|
|
1006
|
+
comments: commentsQuery.data ?? [],
|
|
1007
|
+
loading: commentsQuery.isLoading,
|
|
1008
|
+
loadError: commentsQuery.isError,
|
|
1009
|
+
posting: busy,
|
|
1010
|
+
canComment: canManage,
|
|
1011
|
+
onPost: handlePostComment
|
|
1012
|
+
}
|
|
1013
|
+
),
|
|
1014
|
+
/* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-3", "data-testid": "task-drawer-properties", children: [
|
|
1015
|
+
/* @__PURE__ */ jsx("h3", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: t("staff.time_tracking.taskDrawer.properties.title", "Properties") }),
|
|
1016
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: [
|
|
1017
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
1018
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-muted-foreground", children: t("staff.time_tracking.taskDrawer.properties.status", "Status") }),
|
|
1019
|
+
/* @__PURE__ */ jsxs(
|
|
1020
|
+
Select,
|
|
1021
|
+
{
|
|
1022
|
+
value: task.taskStatusId ?? void 0,
|
|
1023
|
+
disabled: !canManage || busy,
|
|
1024
|
+
onValueChange: handleStatusChange,
|
|
1025
|
+
children: [
|
|
1026
|
+
/* @__PURE__ */ jsx(
|
|
1027
|
+
SelectTrigger,
|
|
1028
|
+
{
|
|
1029
|
+
"aria-label": t("staff.time_tracking.taskDrawer.properties.status", "Status"),
|
|
1030
|
+
"data-testid": "task-drawer-status-select",
|
|
1031
|
+
children: /* @__PURE__ */ jsx(SelectValue, {})
|
|
1032
|
+
}
|
|
1033
|
+
),
|
|
1034
|
+
/* @__PURE__ */ jsx(SelectContent, { children: statuses.map((entry) => /* @__PURE__ */ jsx(SelectItem, { value: entry.id, children: entry.name }, entry.id)) })
|
|
1035
|
+
]
|
|
1036
|
+
}
|
|
1037
|
+
)
|
|
1038
|
+
] }),
|
|
1039
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
1040
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-muted-foreground", children: t("staff.time_tracking.taskDrawer.properties.assignee", "Assignee") }),
|
|
1041
|
+
/* @__PURE__ */ jsxs(
|
|
1042
|
+
Select,
|
|
1043
|
+
{
|
|
1044
|
+
value: task.assigneeStaffMemberId ?? void 0,
|
|
1045
|
+
disabled: !canManage || busy,
|
|
1046
|
+
onValueChange: handleAssigneeChange,
|
|
1047
|
+
children: [
|
|
1048
|
+
/* @__PURE__ */ jsx(
|
|
1049
|
+
SelectTrigger,
|
|
1050
|
+
{
|
|
1051
|
+
"aria-label": t("staff.time_tracking.taskDrawer.properties.assignee", "Assignee"),
|
|
1052
|
+
"data-testid": "task-drawer-assignee-select",
|
|
1053
|
+
children: /* @__PURE__ */ jsx(
|
|
1054
|
+
SelectValue,
|
|
1055
|
+
{
|
|
1056
|
+
placeholder: t("staff.time_tracking.taskDrawer.properties.unassigned", "Unassigned")
|
|
1057
|
+
}
|
|
1058
|
+
)
|
|
1059
|
+
}
|
|
1060
|
+
),
|
|
1061
|
+
/* @__PURE__ */ jsx(SelectContent, { children: members.map((member) => /* @__PURE__ */ jsx(SelectItem, { value: member.id, children: member.name }, member.id)) })
|
|
1062
|
+
]
|
|
1063
|
+
}
|
|
1064
|
+
)
|
|
1065
|
+
] })
|
|
1066
|
+
] }),
|
|
1067
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
|
|
1068
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-muted-foreground", children: t("staff.time_tracking.taskDrawer.properties.tags", "Tags") }),
|
|
1069
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
1070
|
+
assignedTags.map((tag) => /* @__PURE__ */ jsxs(Badge, { variant: "neutral", className: "gap-1", style: tagChipStyle(tag), children: [
|
|
1071
|
+
tag.label,
|
|
1072
|
+
canManage ? /* @__PURE__ */ jsx(
|
|
1073
|
+
"button",
|
|
1074
|
+
{
|
|
1075
|
+
type: "button",
|
|
1076
|
+
"aria-label": t("staff.time_tracking.taskDrawer.properties.removeTag", "Remove tag {label}", {
|
|
1077
|
+
label: tag.label
|
|
1078
|
+
}),
|
|
1079
|
+
onClick: () => {
|
|
1080
|
+
void handleTagChange(tag.id, false);
|
|
1081
|
+
},
|
|
1082
|
+
children: /* @__PURE__ */ jsx(X, { className: "size-3", "aria-hidden": "true" })
|
|
1083
|
+
}
|
|
1084
|
+
) : null
|
|
1085
|
+
] }, tag.id)),
|
|
1086
|
+
canManage ? /* @__PURE__ */ jsx(
|
|
1087
|
+
TagPicker,
|
|
1088
|
+
{
|
|
1089
|
+
available: availableTags,
|
|
1090
|
+
disabled: busy,
|
|
1091
|
+
onAssign: (id) => {
|
|
1092
|
+
void handleTagChange(id, true);
|
|
1093
|
+
},
|
|
1094
|
+
onCreate: createTag,
|
|
1095
|
+
labels: {
|
|
1096
|
+
add: t("staff.time_tracking.taskDrawer.properties.addTag", "Add tag"),
|
|
1097
|
+
create: (name) => t("staff.time_tracking.entryDialog.createTag", 'Create "{name}"', { name }),
|
|
1098
|
+
empty: t("staff.time_tracking.entryDialog.noTags", "No matching tag")
|
|
1099
|
+
},
|
|
1100
|
+
testIdPrefix: "task-drawer"
|
|
1101
|
+
}
|
|
1102
|
+
) : null
|
|
1103
|
+
] }),
|
|
1104
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t(
|
|
1105
|
+
"staff.time_tracking.taskDrawer.properties.tagsPending",
|
|
1106
|
+
"Tags already saved on this task appear here once the task list returns them."
|
|
1107
|
+
) })
|
|
1108
|
+
] }),
|
|
1109
|
+
/* @__PURE__ */ jsx(
|
|
1110
|
+
InjectionSpot,
|
|
1111
|
+
{
|
|
1112
|
+
spotId: extensionPoints.hosts.taskDetailSidebar.spotId,
|
|
1113
|
+
context: taskInjectionContext,
|
|
1114
|
+
data: task
|
|
1115
|
+
}
|
|
1116
|
+
)
|
|
1117
|
+
] }),
|
|
1118
|
+
/* @__PURE__ */ jsx(
|
|
1119
|
+
InjectionSpot,
|
|
1120
|
+
{
|
|
1121
|
+
spotId: extensionPoints.hosts.taskDetailTabs.spotId,
|
|
1122
|
+
context: taskInjectionContext,
|
|
1123
|
+
data: task
|
|
1124
|
+
}
|
|
1125
|
+
)
|
|
1126
|
+
] });
|
|
1127
|
+
})();
|
|
1128
|
+
const createdLabel = formatDate(createdAt);
|
|
1129
|
+
const headerLine = [
|
|
1130
|
+
projectName ?? null,
|
|
1131
|
+
createdLabel ? t("staff.time_tracking.taskDrawer.created", "created {date}", { date: createdLabel }) : null
|
|
1132
|
+
].filter((part) => !!part).join(" \xB7 ");
|
|
1133
|
+
return /* @__PURE__ */ jsx(Drawer, { open, onOpenChange, children: /* @__PURE__ */ jsxs(
|
|
1134
|
+
DrawerContent,
|
|
1135
|
+
{
|
|
1136
|
+
className: "sm:max-w-xl",
|
|
1137
|
+
closeAriaLabel: t("staff.time_tracking.taskDrawer.close", "Close"),
|
|
1138
|
+
"data-testid": "task-drawer",
|
|
1139
|
+
children: [
|
|
1140
|
+
/* @__PURE__ */ jsx(DrawerHeader, { children: /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1.5", children: [
|
|
1141
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1142
|
+
status ? /* @__PURE__ */ jsx(Badge, { variant: statusVariant, children: status.name }) : null,
|
|
1143
|
+
task?.reference ? /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: task.reference }) : null,
|
|
1144
|
+
/* @__PURE__ */ jsx(
|
|
1145
|
+
InjectionSpot,
|
|
1146
|
+
{
|
|
1147
|
+
spotId: extensionPoints.hosts.taskDetailStatusBadges.spotId,
|
|
1148
|
+
context: taskInjectionContext,
|
|
1149
|
+
data: task
|
|
1150
|
+
}
|
|
1151
|
+
)
|
|
1152
|
+
] }),
|
|
1153
|
+
/* @__PURE__ */ jsx(DrawerTitle, { className: "truncate", children: task?.title ?? "" }),
|
|
1154
|
+
/* @__PURE__ */ jsx(DrawerDescription, { children: headerLine }),
|
|
1155
|
+
/* @__PURE__ */ jsx(
|
|
1156
|
+
InjectionSpot,
|
|
1157
|
+
{
|
|
1158
|
+
spotId: extensionPoints.hosts.taskDetailHeader.spotId,
|
|
1159
|
+
context: taskInjectionContext,
|
|
1160
|
+
data: task
|
|
1161
|
+
}
|
|
1162
|
+
)
|
|
1163
|
+
] }) }),
|
|
1164
|
+
/* @__PURE__ */ jsx(DrawerBody, { children: body }),
|
|
1165
|
+
/* @__PURE__ */ jsxs(
|
|
1166
|
+
DrawerFooter,
|
|
1167
|
+
{
|
|
1168
|
+
leading: /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t("staff.time_tracking.taskDrawer.autoSave", "Changes are saved automatically") }),
|
|
1169
|
+
children: [
|
|
1170
|
+
/* @__PURE__ */ jsx(
|
|
1171
|
+
InjectionSpot,
|
|
1172
|
+
{
|
|
1173
|
+
spotId: extensionPoints.hosts.taskDetailFooter.spotId,
|
|
1174
|
+
context: taskInjectionContext,
|
|
1175
|
+
data: task
|
|
1176
|
+
}
|
|
1177
|
+
),
|
|
1178
|
+
/* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: () => onOpenChange(false), children: t("staff.time_tracking.taskDrawer.close", "Close") })
|
|
1179
|
+
]
|
|
1180
|
+
}
|
|
1181
|
+
),
|
|
1182
|
+
ConfirmDialogElement
|
|
1183
|
+
]
|
|
1184
|
+
}
|
|
1185
|
+
) });
|
|
1186
|
+
}
|
|
1187
|
+
var TaskDrawer_default = TaskDrawer;
|
|
1188
|
+
export {
|
|
1189
|
+
ENTRIES_LIST_PATH,
|
|
1190
|
+
RATES_FEATURE,
|
|
1191
|
+
TASKS_MANAGE_FEATURE,
|
|
1192
|
+
TASK_DRAWER_MUTATION_CONTEXT_ID,
|
|
1193
|
+
TaskDrawer,
|
|
1194
|
+
TaskDrawer_default as default
|
|
1195
|
+
};
|
|
1196
|
+
//# sourceMappingURL=TaskDrawer.js.map
|