@tuturuuu/ui 0.16.0 → 0.18.0
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/CHANGELOG.md +38 -0
- package/biome.json +1 -1
- package/package.json +78 -119
- package/src/components/ui/calendar-app/calendar-client-page.tsx +12 -3
- package/src/components/ui/calendar-app/calendar-page-shell.tsx +38 -28
- package/src/components/ui/custom/notification-popover-client.tsx +3 -3
- package/src/components/ui/storefront/browse-panel.tsx +161 -0
- package/src/components/ui/storefront/bundle-selection-dialog.tsx +1 -1
- package/src/components/ui/storefront/cart-popover.tsx +1 -1
- package/src/components/ui/storefront/hero-panel.tsx +35 -30
- package/src/components/ui/storefront/listing-card.tsx +10 -5
- package/src/components/ui/storefront/merch-sections.tsx +7 -5
- package/src/components/ui/storefront/product-detail.tsx +79 -6
- package/src/components/ui/storefront/product-dialog.tsx +5 -1
- package/src/components/ui/storefront/storefront-surface.test.tsx +72 -0
- package/src/components/ui/storefront/storefront-surface.tsx +67 -63
- package/src/components/ui/storefront/types.ts +28 -0
- package/src/components/ui/storefront/utils.ts +4 -5
- package/src/components/ui/tasks/progress/activity-heatmap.tsx +256 -0
- package/src/components/ui/tasks/progress/breakdown-bars.tsx +79 -0
- package/src/components/ui/tasks/progress/cumulative-progress-chart.tsx +185 -0
- package/src/components/ui/tasks/progress/daily-bar-chart.tsx +97 -0
- package/src/components/ui/tasks/progress/habit-gauge.tsx +92 -0
- package/src/components/ui/tasks/progress/mini-sparkline.tsx +56 -0
- package/src/components/ui/tasks/progress/weekday-distribution-chart.tsx +72 -0
- package/src/components/ui/text-editor/editor.tsx +7 -1
- package/src/components/ui/text-editor/extensions.ts +4 -1
- package/src/components/ui/text-editor/mention-extension.tsx +33 -121
- package/src/globals.css +1 -0
- package/src/lib/workspace-actions.ts +15 -4
- package/src/components/ui/calendar-app/components/actions-dropdown.tsx +0 -269
- package/src/components/ui/calendar-app/components/auto-schedule-comprehensive-dialog.tsx +0 -220
- package/src/components/ui/calendar-app/components/calendar-header-actions.tsx +0 -67
- package/src/components/ui/calendar-app/components/experimental-feature-dialog.tsx +0 -56
- package/src/components/ui/calendar-app/components/habits-panel.tsx +0 -335
- package/src/components/ui/calendar-app/components/load-smart-scheduling-tasks.tsx +0 -143
- package/src/components/ui/calendar-app/components/priority-dropdown.tsx +0 -113
- package/src/components/ui/calendar-app/components/priority-view.tsx +0 -954
- package/src/components/ui/calendar-app/components/quick-task-dialog.tsx +0 -335
- package/src/components/ui/calendar-app/components/quick-task-timer.tsx +0 -112
- package/src/components/ui/calendar-app/components/scheduling-dialog.tsx +0 -664
- package/src/components/ui/calendar-app/components/sidebar/calendar-sidebar.tsx +0 -128
- package/src/components/ui/calendar-app/components/sidebar/index.tsx +0 -1
- package/src/components/ui/calendar-app/components/smart-schedule-button.tsx +0 -117
- package/src/components/ui/calendar-app/components/smart-schedule-preview-dialog.tsx +0 -845
- package/src/components/ui/calendar-app/components/smart-schedule-preview-panel.tsx +0 -941
- package/src/components/ui/calendar-app/components/task-fetcher.ts +0 -51
- package/src/components/ui/calendar-app/components/task-form.tsx +0 -132
- package/src/components/ui/calendar-app/components/task-list-form.tsx +0 -84
- package/src/components/ui/calendar-app/components/task-scheduler-panel.tsx +0 -494
- package/src/components/ui/calendar-app/components/tasks-sidebar-content.tsx +0 -232
- package/src/components/ui/calendar-app/components/tasks-sidebar.tsx +0 -31
- package/src/components/ui/calendar-app/components/time-tracker/components/active-session-card.tsx +0 -113
- package/src/components/ui/calendar-app/components/time-tracker/components/index.ts +0 -3
- package/src/components/ui/calendar-app/components/time-tracker/components/session-card.tsx +0 -153
- package/src/components/ui/calendar-app/components/time-tracker/components/stats-cards.tsx +0 -58
- package/src/components/ui/calendar-app/components/time-tracker/dialogs/create-task-dialog.tsx +0 -190
- package/src/components/ui/calendar-app/components/time-tracker/dialogs/delete-session-dialog.tsx +0 -52
- package/src/components/ui/calendar-app/components/time-tracker/dialogs/edit-session-dialog.tsx +0 -173
- package/src/components/ui/calendar-app/components/time-tracker/dialogs/index.ts +0 -3
- package/src/components/ui/calendar-app/components/time-tracker/hooks/index.ts +0 -2
- package/src/components/ui/calendar-app/components/time-tracker/hooks/use-sessions.ts +0 -191
- package/src/components/ui/calendar-app/components/time-tracker/hooks/use-time-tracker.ts +0 -408
- package/src/components/ui/calendar-app/components/time-tracker/index.tsx +0 -907
- package/src/components/ui/calendar-app/components/time-tracker/tabs/history-tab.tsx +0 -28
- package/src/components/ui/calendar-app/components/time-tracker/tabs/index.ts +0 -2
- package/src/components/ui/calendar-app/components/time-tracker/tabs/recent-sessions-tab.tsx +0 -173
- package/src/components/ui/calendar-app/components/time-tracker/time-tracker-trigger.tsx +0 -50
- package/src/components/ui/calendar-app/components/time-tracker/utils/category-colors.ts +0 -38
- package/src/components/ui/calendar-app/components/time-tracker/utils/format-time.ts +0 -26
- package/src/components/ui/calendar-app/components/time-tracker/utils/index.ts +0 -2
- package/src/components/ui/calendar-app/components/time-tracker.tsx +0 -2040
- package/src/components/ui/custom/settings/task-settings.tsx +0 -543
- package/src/components/ui/custom/settings/task-sound-settings.test.tsx +0 -146
- package/src/components/ui/text-editor/__tests__/task-mention-chip.test.tsx +0 -476
- package/src/components/ui/text-editor/task-mention-chip.tsx +0 -1397
- package/src/components/ui/text-editor/task-mention-resolution.ts +0 -235
- package/src/components/ui/text-editor/task-summary-popover.tsx +0 -360
- package/src/components/ui/tu-do/boards/__tests__/board-share-dialog.test.tsx +0 -286
- package/src/components/ui/tu-do/boards/__tests__/quick-create-board-dialog.test.tsx +0 -52
- package/src/components/ui/tu-do/boards/__tests__/task-board-form.test.tsx +0 -142
- package/src/components/ui/tu-do/boards/__tests__/workspace-projects-client-page.test.tsx +0 -169
- package/src/components/ui/tu-do/boards/analytics/GanttChart.tsx +0 -419
- package/src/components/ui/tu-do/boards/analytics/GanttControls.tsx +0 -123
- package/src/components/ui/tu-do/boards/analytics/GanttHeader.tsx +0 -48
- package/src/components/ui/tu-do/boards/analytics/GanttTimeline.tsx +0 -355
- package/src/components/ui/tu-do/boards/analytics/StatusDistribution.tsx +0 -130
- package/src/components/ui/tu-do/boards/analytics/TaskCreationAnalytics.tsx +0 -285
- package/src/components/ui/tu-do/boards/analytics/TaskDetailCard.tsx +0 -270
- package/src/components/ui/tu-do/boards/analytics/TaskGroup.tsx +0 -282
- package/src/components/ui/tu-do/boards/analytics/TaskWorkflowAnalytics.tsx +0 -280
- package/src/components/ui/tu-do/boards/board-public-link-section.tsx +0 -231
- package/src/components/ui/tu-do/boards/board-selector.tsx +0 -301
- package/src/components/ui/tu-do/boards/board-share-dialog.tsx +0 -69
- package/src/components/ui/tu-do/boards/board-share-settings-panel.tsx +0 -351
- package/src/components/ui/tu-do/boards/boardId/__tests__/list-actions.test.tsx +0 -199
- package/src/components/ui/tu-do/boards/boardId/board-column-external-retry.test.tsx +0 -127
- package/src/components/ui/tu-do/boards/boardId/board-column-initial-load.test.ts +0 -38
- package/src/components/ui/tu-do/boards/boardId/board-column.tsx +0 -893
- package/src/components/ui/tu-do/boards/boardId/board-text-utils.test.ts +0 -24
- package/src/components/ui/tu-do/boards/boardId/board-text-utils.ts +0 -11
- package/src/components/ui/tu-do/boards/boardId/enhanced-task-list.tsx +0 -543
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/__tests__/bulk-mutations-external-workspaces.test.tsx +0 -392
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/__tests__/bulk-mutations-move.test.tsx +0 -252
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-actions-island.test.tsx +0 -57
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-actions-island.tsx +0 -106
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-actions-menu.tsx +0 -689
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-custom-date-dialog.tsx +0 -82
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-delete-dialog.tsx +0 -58
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-clear-delete.ts +0 -418
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-move.ts +0 -662
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-relations-assignees.ts +0 -375
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-relations-labels.ts +0 -278
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-relations-projects.ts +0 -297
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-relations.ts +0 -12
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-mutations-updates.ts +0 -462
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-operation-i18n.ts +0 -524
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-operation-types.ts +0 -34
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-operation-utils.ts +0 -377
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-operations.ts +0 -348
- package/src/components/ui/tu-do/boards/boardId/kanban/bulk/bulk-personal-external-move.ts +0 -132
- package/src/components/ui/tu-do/boards/boardId/kanban/data/kanban-deadline-query.ts +0 -90
- package/src/components/ui/tu-do/boards/boardId/kanban/data/use-applied-sets.ts +0 -79
- package/src/components/ui/tu-do/boards/boardId/kanban/data/use-bulk-resources.ts +0 -112
- package/src/components/ui/tu-do/boards/boardId/kanban/data/use-filtered-resources.ts +0 -54
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/__tests__/column-reorder.test.ts +0 -80
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/auto-scroll.test.ts +0 -118
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/auto-scroll.ts +0 -160
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/column-reorder.ts +0 -65
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/drag-preview.tsx +0 -117
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/kanban-sort-helpers.ts +0 -76
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-cache.ts +0 -367
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-geometry.test.ts +0 -67
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-geometry.ts +0 -94
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-order.ts +0 -150
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-pending.test.ts +0 -37
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-pending.ts +0 -42
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-preview.test.ts +0 -318
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-preview.ts +0 -260
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-drag-types.ts +0 -39
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/task-sort-key.ts +0 -47
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/use-kanban-dnd.test.ts +0 -859
- package/src/components/ui/tu-do/boards/boardId/kanban/dnd/use-kanban-dnd.ts +0 -1659
- package/src/components/ui/tu-do/boards/boardId/kanban/kanban-column-collapse.ts +0 -16
- package/src/components/ui/tu-do/boards/boardId/kanban/kanban-constants.ts +0 -43
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/__tests__/kanban-planner-island.test.tsx +0 -380
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/kanban-planner-dialog.tsx +0 -204
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-digest-panel.tsx +0 -61
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-item-strip.tsx +0 -54
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-plan-toolbar.tsx +0 -251
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-scope-badge.tsx +0 -27
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-section.tsx +0 -58
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-share-dialog.tsx +0 -238
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-target-controls.tsx +0 -143
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/planner-utils.ts +0 -65
- package/src/components/ui/tu-do/boards/boardId/kanban/planner/use-kanban-planner-state.ts +0 -234
- package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-column-width.ts +0 -30
- package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-columns.test.tsx +0 -1077
- package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-columns.tsx +0 -447
- package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-deadline-panels.tsx +0 -703
- package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-deadline-tasks.test.ts +0 -267
- package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-deadline-tasks.ts +0 -112
- package/src/components/ui/tu-do/boards/boardId/kanban/rendering/kanban-skeleton.tsx +0 -113
- package/src/components/ui/tu-do/boards/boardId/kanban/selection/use-keyboard-shortcuts.ts +0 -137
- package/src/components/ui/tu-do/boards/boardId/kanban/selection/use-multi-select.ts +0 -119
- package/src/components/ui/tu-do/boards/boardId/kanban.tsx +0 -631
- package/src/components/ui/tu-do/boards/boardId/list-actions.tsx +0 -522
- package/src/components/ui/tu-do/boards/boardId/menus/__tests__/task-estimation-menu.test.tsx +0 -261
- package/src/components/ui/tu-do/boards/boardId/menus/__tests__/task-menus.test.tsx +0 -708
- package/src/components/ui/tu-do/boards/boardId/menus/index.ts +0 -12
- package/src/components/ui/tu-do/boards/boardId/menus/task-assignees-menu.tsx +0 -176
- package/src/components/ui/tu-do/boards/boardId/menus/task-blocking-menu.tsx +0 -304
- package/src/components/ui/tu-do/boards/boardId/menus/task-due-date-menu.tsx +0 -201
- package/src/components/ui/tu-do/boards/boardId/menus/task-estimation-menu.tsx +0 -103
- package/src/components/ui/tu-do/boards/boardId/menus/task-labels-menu.tsx +0 -134
- package/src/components/ui/tu-do/boards/boardId/menus/task-move-menu.tsx +0 -66
- package/src/components/ui/tu-do/boards/boardId/menus/task-parent-menu.tsx +0 -228
- package/src/components/ui/tu-do/boards/boardId/menus/task-picker-popover.tsx +0 -300
- package/src/components/ui/tu-do/boards/boardId/menus/task-priority-menu.tsx +0 -178
- package/src/components/ui/tu-do/boards/boardId/menus/task-projects-menu.tsx +0 -143
- package/src/components/ui/tu-do/boards/boardId/menus/task-related-menu.tsx +0 -242
- package/src/components/ui/tu-do/boards/boardId/menus/task-scheduling-menu.tsx +0 -465
- package/src/components/ui/tu-do/boards/boardId/menus/task-scheduling-utils.ts +0 -109
- package/src/components/ui/tu-do/boards/boardId/status-grouped-board.tsx +0 -533
- package/src/components/ui/tu-do/boards/boardId/status-section.tsx +0 -274
- package/src/components/ui/tu-do/boards/boardId/task-actions.tsx +0 -675
- package/src/components/ui/tu-do/boards/boardId/task-board-server-page.test.tsx +0 -209
- package/src/components/ui/tu-do/boards/boardId/task-board-server-page.tsx +0 -109
- package/src/components/ui/tu-do/boards/boardId/task-card/TaskCardCheckbox.tsx +0 -50
- package/src/components/ui/tu-do/boards/boardId/task-card/TaskCardDates.tsx +0 -123
- package/src/components/ui/tu-do/boards/boardId/task-card/TaskCardHeader.tsx +0 -97
- package/src/components/ui/tu-do/boards/boardId/task-card/TaskCardMetadata.tsx +0 -152
- package/src/components/ui/tu-do/boards/boardId/task-card/measured-task-card.tsx +0 -118
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-archive-visibility.test.ts +0 -44
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-archive-visibility.ts +0 -17
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-checkbox-style.ts +0 -39
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-comparator.test.ts +0 -104
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-comparator.ts +0 -123
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-completion-checkbox-visibility.test.ts +0 -31
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-completion-checkbox-visibility.ts +0 -9
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-identifier-row.test.tsx +0 -124
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-identifier-row.tsx +0 -88
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-label-options.ts +0 -24
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-open-options.test.ts +0 -166
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-open-options.ts +0 -148
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-resource-context.test.ts +0 -113
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-resource-context.ts +0 -50
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-visibility.test.ts +0 -41
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card-visibility.ts +0 -14
- package/src/components/ui/tu-do/boards/boardId/task-card/task-card.tsx +0 -2889
- package/src/components/ui/tu-do/boards/boardId/task-card/task-scheduling-badge.tsx +0 -174
- package/src/components/ui/tu-do/boards/boardId/task-dialogs/BoardEstimationConfigDialog.tsx +0 -499
- package/src/components/ui/tu-do/boards/boardId/task-dialogs/TaskCustomDateDialog.tsx +0 -109
- package/src/components/ui/tu-do/boards/boardId/task-dialogs/TaskDeleteDialog.tsx +0 -96
- package/src/components/ui/tu-do/boards/boardId/task-dialogs/TaskNewLabelDialog.tsx +0 -178
- package/src/components/ui/tu-do/boards/boardId/task-dialogs/TaskNewProjectDialog.tsx +0 -127
- package/src/components/ui/tu-do/boards/boardId/task-filter.test.tsx +0 -152
- package/src/components/ui/tu-do/boards/boardId/task-filter.tsx +0 -996
- package/src/components/ui/tu-do/boards/boardId/task-form.tsx +0 -498
- package/src/components/ui/tu-do/boards/boardId/task-list-drag-preview.test.ts +0 -101
- package/src/components/ui/tu-do/boards/boardId/task-list-form.tsx +0 -91
- package/src/components/ui/tu-do/boards/boardId/task-list.tsx +0 -535
- package/src/components/ui/tu-do/boards/boardId/task-parent-badge-state.test.ts +0 -64
- package/src/components/ui/tu-do/boards/boardId/task-parent-badge-state.ts +0 -31
- package/src/components/ui/tu-do/boards/boardId/task.tsx +0 -2
- package/src/components/ui/tu-do/boards/boardId/timeline/task-edit-dialog.tsx +0 -109
- package/src/components/ui/tu-do/boards/boardId/timeline/timeline-display.ts +0 -103
- package/src/components/ui/tu-do/boards/boardId/timeline/timeline-grid.tsx +0 -381
- package/src/components/ui/tu-do/boards/boardId/timeline/timeline-task-row.tsx +0 -339
- package/src/components/ui/tu-do/boards/boardId/timeline/timeline-toolbar.tsx +0 -356
- package/src/components/ui/tu-do/boards/boardId/timeline/timeline-utils.test.ts +0 -169
- package/src/components/ui/tu-do/boards/boardId/timeline/timeline-utils.ts +0 -517
- package/src/components/ui/tu-do/boards/boardId/timeline-board-open-task.test.tsx +0 -164
- package/src/components/ui/tu-do/boards/boardId/timeline-board.test.tsx +0 -217
- package/src/components/ui/tu-do/boards/boardId/timeline-board.tsx +0 -834
- package/src/components/ui/tu-do/boards/boards-list-skeleton.tsx +0 -62
- package/src/components/ui/tu-do/boards/columns.tsx +0 -159
- package/src/components/ui/tu-do/boards/copy-board-dialog.tsx +0 -156
- package/src/components/ui/tu-do/boards/enhanced-boards-view.tsx +0 -347
- package/src/components/ui/tu-do/boards/form.tsx +0 -264
- package/src/components/ui/tu-do/boards/quick-create-board-dialog.tsx +0 -75
- package/src/components/ui/tu-do/boards/row-actions.tsx +0 -397
- package/src/components/ui/tu-do/boards/share-section.tsx +0 -100
- package/src/components/ui/tu-do/boards/workspace-projects-client-page.tsx +0 -192
- package/src/components/ui/tu-do/boards/workspace-projects-page.tsx +0 -155
- package/src/components/ui/tu-do/cycles/task-cycles-client.tsx +0 -753
- package/src/components/ui/tu-do/cycles/task-cycles-page.tsx +0 -103
- package/src/components/ui/tu-do/drafts/draft-card.tsx +0 -204
- package/src/components/ui/tu-do/drafts/draft-convert-dialog.tsx +0 -195
- package/src/components/ui/tu-do/drafts/drafts-page.tsx +0 -122
- package/src/components/ui/tu-do/drafts/task-drafts-page.tsx +0 -90
- package/src/components/ui/tu-do/estimates/client.tsx +0 -292
- package/src/components/ui/tu-do/estimates/edit-estimation-dialog.tsx +0 -374
- package/src/components/ui/tu-do/estimates/task-estimates-page.tsx +0 -57
- package/src/components/ui/tu-do/estimates/use-task-estimates.ts +0 -324
- package/src/components/ui/tu-do/habits/client.tsx +0 -263
- package/src/components/ui/tu-do/habits/habit-card.tsx +0 -183
- package/src/components/ui/tu-do/habits/habit-form-dialog.tsx +0 -701
- package/src/components/ui/tu-do/habits/habits-page.tsx +0 -27
- package/src/components/ui/tu-do/hooks/__tests__/useDraftPersistence.test.ts +0 -494
- package/src/components/ui/tu-do/hooks/__tests__/useTaskDialog.test.tsx +0 -127
- package/src/components/ui/tu-do/hooks/__tests__/useTaskDialogState.test.ts +0 -217
- package/src/components/ui/tu-do/hooks/__tests__/useTaskLabelManagement.test.tsx +0 -572
- package/src/components/ui/tu-do/hooks/__tests__/useTaskProjectManagement.test.tsx +0 -144
- package/src/components/ui/tu-do/hooks/useDraftPersistence.ts +0 -199
- package/src/components/ui/tu-do/hooks/useTaskCardRelationships.ts +0 -340
- package/src/components/ui/tu-do/hooks/useTaskDialog.ts +0 -122
- package/src/components/ui/tu-do/hooks/useTaskDialogState.ts +0 -145
- package/src/components/ui/tu-do/hooks/useTaskFormState.ts +0 -206
- package/src/components/ui/tu-do/hooks/useTaskKeyboardShortcuts.ts +0 -58
- package/src/components/ui/tu-do/hooks/useTaskLabelManagement.ts +0 -425
- package/src/components/ui/tu-do/hooks/useTaskProjectManagement.ts +0 -454
- package/src/components/ui/tu-do/initiatives/task-initiatives-client.tsx +0 -889
- package/src/components/ui/tu-do/initiatives/task-initiatives-page.tsx +0 -116
- package/src/components/ui/tu-do/labels/client.tsx +0 -201
- package/src/components/ui/tu-do/labels/components/delete-label-dialog.tsx +0 -57
- package/src/components/ui/tu-do/labels/components/label-card.tsx +0 -86
- package/src/components/ui/tu-do/labels/components/label-dialog.tsx +0 -259
- package/src/components/ui/tu-do/labels/components/label-list.tsx +0 -83
- package/src/components/ui/tu-do/labels/hooks/use-task-labels.ts +0 -170
- package/src/components/ui/tu-do/labels/task-labels-page.tsx +0 -53
- package/src/components/ui/tu-do/labels/types.ts +0 -6
- package/src/components/ui/tu-do/logs/columns.tsx +0 -755
- package/src/components/ui/tu-do/logs/logs-client.tsx +0 -1006
- package/src/components/ui/tu-do/logs/logs-timeline.tsx +0 -2483
- package/src/components/ui/tu-do/logs/task-logs-page.tsx +0 -59
- package/src/components/ui/tu-do/my-tasks/__tests__/my-tasks-content.test.tsx +0 -408
- package/src/components/ui/tu-do/my-tasks/__tests__/use-my-tasks-query.test.ts +0 -469
- package/src/components/ui/tu-do/my-tasks/__tests__/use-my-tasks-state.test.ts +0 -1017
- package/src/components/ui/tu-do/my-tasks/__tests__/use-task-context-actions.test.ts +0 -584
- package/src/components/ui/tu-do/my-tasks/ai-credit-indicator.tsx +0 -143
- package/src/components/ui/tu-do/my-tasks/board-selector-dialog.tsx +0 -239
- package/src/components/ui/tu-do/my-tasks/command-bar.tsx +0 -1351
- package/src/components/ui/tu-do/my-tasks/label-project-filter.tsx +0 -194
- package/src/components/ui/tu-do/my-tasks/my-task-context-menu.tsx +0 -356
- package/src/components/ui/tu-do/my-tasks/my-tasks-content.tsx +0 -328
- package/src/components/ui/tu-do/my-tasks/my-tasks-data-loader.tsx +0 -17
- package/src/components/ui/tu-do/my-tasks/my-tasks-filters.tsx +0 -258
- package/src/components/ui/tu-do/my-tasks/my-tasks-header.tsx +0 -121
- package/src/components/ui/tu-do/my-tasks/my-tasks-page.tsx +0 -40
- package/src/components/ui/tu-do/my-tasks/personal-placement-dialog.tsx +0 -188
- package/src/components/ui/tu-do/my-tasks/task-filter.tsx +0 -235
- package/src/components/ui/tu-do/my-tasks/task-list-with-completion.tsx +0 -832
- package/src/components/ui/tu-do/my-tasks/task-list.tsx +0 -258
- package/src/components/ui/tu-do/my-tasks/task-preview-dialog.tsx +0 -1597
- package/src/components/ui/tu-do/my-tasks/task-section.tsx +0 -261
- package/src/components/ui/tu-do/my-tasks/use-my-tasks-query.ts +0 -149
- package/src/components/ui/tu-do/my-tasks/use-my-tasks-state.ts +0 -1037
- package/src/components/ui/tu-do/my-tasks/use-task-context-actions.ts +0 -474
- package/src/components/ui/tu-do/notes/note-edit-dialog.tsx +0 -118
- package/src/components/ui/tu-do/notes/note-list.tsx +0 -799
- package/src/components/ui/tu-do/notes/notes-content.tsx +0 -178
- package/src/components/ui/tu-do/notes/notes-page.tsx +0 -27
- package/src/components/ui/tu-do/progress/task-progress-import-panel.tsx +0 -60
- package/src/components/ui/tu-do/progress/task-progress-leaderboards-panel.tsx +0 -156
- package/src/components/ui/tu-do/progress/task-progress-page.tsx +0 -394
- package/src/components/ui/tu-do/progress/task-progress-panels.tsx +0 -303
- package/src/components/ui/tu-do/projects/components/index.ts +0 -11
- package/src/components/ui/tu-do/projects/components/project-actions-menu.tsx +0 -66
- package/src/components/ui/tu-do/projects/components/project-badges.tsx +0 -84
- package/src/components/ui/tu-do/projects/components/project-filter-menu.tsx +0 -170
- package/src/components/ui/tu-do/projects/components/project-grid-card.tsx +0 -198
- package/src/components/ui/tu-do/projects/components/project-list-item.tsx +0 -195
- package/src/components/ui/tu-do/projects/components/project-metrics.tsx +0 -87
- package/src/components/ui/tu-do/projects/components/project-progress-meter.tsx +0 -33
- package/src/components/ui/tu-do/projects/components/project-sort-menu.tsx +0 -71
- package/src/components/ui/tu-do/projects/components/projects-empty-state.tsx +0 -38
- package/src/components/ui/tu-do/projects/components/projects-loading-state.tsx +0 -26
- package/src/components/ui/tu-do/projects/components/projects-toolbar.tsx +0 -179
- package/src/components/ui/tu-do/projects/dialogs/create-project-dialog.tsx +0 -117
- package/src/components/ui/tu-do/projects/dialogs/edit-project-dialog.tsx +0 -125
- package/src/components/ui/tu-do/projects/dialogs/index.ts +0 -3
- package/src/components/ui/tu-do/projects/dialogs/manage-tasks-dialog.tsx +0 -205
- package/src/components/ui/tu-do/projects/hooks/index.ts +0 -2
- package/src/components/ui/tu-do/projects/hooks/use-project-filters.ts +0 -248
- package/src/components/ui/tu-do/projects/hooks/use-task-projects.ts +0 -238
- package/src/components/ui/tu-do/projects/projectId/components/__tests__/tasks-tab-layout.test.tsx +0 -169
- package/src/components/ui/tu-do/projects/projectId/components/documents-tab.tsx +0 -90
- package/src/components/ui/tu-do/projects/projectId/components/index.ts +0 -9
- package/src/components/ui/tu-do/projects/projectId/components/overview/description-card.tsx +0 -77
- package/src/components/ui/tu-do/projects/projectId/components/overview/linked-documents-card.tsx +0 -81
- package/src/components/ui/tu-do/projects/projectId/components/overview/linked-tasks-card.tsx +0 -85
- package/src/components/ui/tu-do/projects/projectId/components/overview/updates-card.tsx +0 -85
- package/src/components/ui/tu-do/projects/projectId/components/overview-tab.tsx +0 -35
- package/src/components/ui/tu-do/projects/projectId/components/project-configuration.tsx +0 -229
- package/src/components/ui/tu-do/projects/projectId/components/project-header.tsx +0 -115
- package/src/components/ui/tu-do/projects/projectId/components/project-lead-selector.tsx +0 -55
- package/src/components/ui/tu-do/projects/projectId/components/project-overview-context.tsx +0 -82
- package/src/components/ui/tu-do/projects/projectId/components/project-sidebar.tsx +0 -246
- package/src/components/ui/tu-do/projects/projectId/components/tasks-tab.tsx +0 -266
- package/src/components/ui/tu-do/projects/projectId/components/update-card.tsx +0 -162
- package/src/components/ui/tu-do/projects/projectId/components/updates-tab.tsx +0 -129
- package/src/components/ui/tu-do/projects/projectId/dialogs/index.ts +0 -1
- package/src/components/ui/tu-do/projects/projectId/dialogs/link-task-dialog.tsx +0 -114
- package/src/components/ui/tu-do/projects/projectId/hooks/index.ts +0 -4
- package/src/components/ui/tu-do/projects/projectId/hooks/use-animation-variants.ts +0 -68
- package/src/components/ui/tu-do/projects/projectId/hooks/use-project-form.ts +0 -214
- package/src/components/ui/tu-do/projects/projectId/hooks/use-project-updates.ts +0 -209
- package/src/components/ui/tu-do/projects/projectId/hooks/use-task-linking.ts +0 -101
- package/src/components/ui/tu-do/projects/projectId/task-project-detail-page-client.tsx +0 -93
- package/src/components/ui/tu-do/projects/projectId/task-project-detail-page.tsx +0 -78
- package/src/components/ui/tu-do/projects/projectId/task-project-detail.tsx +0 -367
- package/src/components/ui/tu-do/projects/projectId/types.ts +0 -51
- package/src/components/ui/tu-do/projects/task-projects-client.tsx +0 -270
- package/src/components/ui/tu-do/projects/task-projects-page.tsx +0 -97
- package/src/components/ui/tu-do/projects/types.ts +0 -62
- package/src/components/ui/tu-do/providers/__tests__/task-dialog-provider.test.tsx +0 -616
- package/src/components/ui/tu-do/providers/task-dialog-provider.tsx +0 -923
- package/src/components/ui/tu-do/providers/workspace-presence-provider.tsx +0 -88
- package/src/components/ui/tu-do/shared/AccessibleButton.tsx +0 -79
- package/src/components/ui/tu-do/shared/__tests__/assignee-select.test.tsx +0 -143
- package/src/components/ui/tu-do/shared/__tests__/board-client.test.tsx +0 -358
- package/src/components/ui/tu-do/shared/__tests__/board-header.test.tsx +0 -598
- package/src/components/ui/tu-do/shared/__tests__/board-query-cache.test.ts +0 -219
- package/src/components/ui/tu-do/shared/__tests__/board-switcher.test.tsx +0 -374
- package/src/components/ui/tu-do/shared/__tests__/board-views.test.tsx +0 -1288
- package/src/components/ui/tu-do/shared/__tests__/create-list-dialog.test.tsx +0 -118
- package/src/components/ui/tu-do/shared/__tests__/task-board-loading-state.test.tsx +0 -99
- package/src/components/ui/tu-do/shared/__tests__/task-cache-patches.test.ts +0 -147
- package/src/components/ui/tu-do/shared/__tests__/task-detail-page.test.tsx +0 -170
- package/src/components/ui/tu-do/shared/__tests__/task-dialog-manager.test.tsx +0 -945
- package/src/components/ui/tu-do/shared/__tests__/task-legacy-route-recovery.test.tsx +0 -101
- package/src/components/ui/tu-do/shared/__tests__/use-progressive-board-loader.test.tsx +0 -645
- package/src/components/ui/tu-do/shared/assignee-select.tsx +0 -592
- package/src/components/ui/tu-do/shared/board-broadcast-context.tsx +0 -45
- package/src/components/ui/tu-do/shared/board-client.tsx +0 -283
- package/src/components/ui/tu-do/shared/board-config-storage.ts +0 -94
- package/src/components/ui/tu-do/shared/board-header.tsx +0 -803
- package/src/components/ui/tu-do/shared/board-layout-settings.tsx +0 -1134
- package/src/components/ui/tu-do/shared/board-query-cache.ts +0 -157
- package/src/components/ui/tu-do/shared/board-switcher.tsx +0 -322
- package/src/components/ui/tu-do/shared/board-user-presence-avatars.tsx +0 -578
- package/src/components/ui/tu-do/shared/board-views.tsx +0 -1238
- package/src/components/ui/tu-do/shared/clear-menu-item.tsx +0 -34
- package/src/components/ui/tu-do/shared/create-list-dialog.tsx +0 -401
- package/src/components/ui/tu-do/shared/cursor-overlay-multi-wrapper.tsx +0 -245
- package/src/components/ui/tu-do/shared/cursor-overlay.tsx +0 -78
- package/src/components/ui/tu-do/shared/custom-date-picker/custom-date-picker-dialog.tsx +0 -157
- package/src/components/ui/tu-do/shared/description-overflow-warning-dialog.tsx +0 -68
- package/src/components/ui/tu-do/shared/edit-list-dialog.tsx +0 -383
- package/src/components/ui/tu-do/shared/empty-state-card.tsx +0 -46
- package/src/components/ui/tu-do/shared/estimation-mapping.test.ts +0 -32
- package/src/components/ui/tu-do/shared/estimation-mapping.ts +0 -74
- package/src/components/ui/tu-do/shared/estimation-utils.ts +0 -54
- package/src/components/ui/tu-do/shared/fade-setting-initializer.tsx +0 -61
- package/src/components/ui/tu-do/shared/label-chip.tsx +0 -46
- package/src/components/ui/tu-do/shared/list-view-context-menu.test.tsx +0 -203
- package/src/components/ui/tu-do/shared/list-view-sorting.test.ts +0 -50
- package/src/components/ui/tu-do/shared/list-view-sorting.ts +0 -108
- package/src/components/ui/tu-do/shared/list-view.tsx +0 -1248
- package/src/components/ui/tu-do/shared/mention-system/__tests__/mention-system.test.ts +0 -250
- package/src/components/ui/tu-do/shared/mention-system/mention-menu.tsx +0 -217
- package/src/components/ui/tu-do/shared/mention-system/types.ts +0 -141
- package/src/components/ui/tu-do/shared/mention-system/use-mention-suggestions.ts +0 -244
- package/src/components/ui/tu-do/shared/progressive-loader-context.tsx +0 -45
- package/src/components/ui/tu-do/shared/recent-sidebar-events.ts +0 -58
- package/src/components/ui/tu-do/shared/recycle-bin-panel.tsx +0 -651
- package/src/components/ui/tu-do/shared/relationship-task-identifier.ts +0 -14
- package/src/components/ui/tu-do/shared/slash-commands/__tests__/slash-commands.test.ts +0 -315
- package/src/components/ui/tu-do/shared/slash-commands/definitions.ts +0 -167
- package/src/components/ui/tu-do/shared/slash-commands/slash-command-menu.tsx +0 -114
- package/src/components/ui/tu-do/shared/special-task-list-pins.ts +0 -51
- package/src/components/ui/tu-do/shared/sync-warning-dialog.tsx +0 -133
- package/src/components/ui/tu-do/shared/task-board-errors.ts +0 -19
- package/src/components/ui/tu-do/shared/task-board-loading-state.tsx +0 -82
- package/src/components/ui/tu-do/shared/task-cache-patches.ts +0 -394
- package/src/components/ui/tu-do/shared/task-detail-page.tsx +0 -176
- package/src/components/ui/tu-do/shared/task-detail-server-page.tsx +0 -37
- package/src/components/ui/tu-do/shared/task-dialog-manager.tsx +0 -596
- package/src/components/ui/tu-do/shared/task-dialog-presentation.test.ts +0 -53
- package/src/components/ui/tu-do/shared/task-dialog-presentation.ts +0 -30
- package/src/components/ui/tu-do/shared/task-dialog-wrapper.tsx +0 -28
- package/src/components/ui/tu-do/shared/task-due-date-visibility.test.ts +0 -72
- package/src/components/ui/tu-do/shared/task-due-date-visibility.ts +0 -38
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/compact-task-create-popover.test.tsx +0 -325
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/compact-task-create-popover.tsx +0 -268
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/mobile-floating-save-button.tsx +0 -46
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/quick-settings-popover.tsx +0 -198
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/smart-task-suggestions-panel.test.tsx +0 -129
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/smart-task-suggestions-panel.tsx +0 -358
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-description-editor.tsx +0 -496
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-dialog-header.tsx +0 -545
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-list-picker-panel.tsx +0 -220
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-list-selector.tsx +0 -165
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-list-trigger-styles.ts +0 -69
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-name-input.test.tsx +0 -180
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-name-input.tsx +0 -218
- package/src/components/ui/tu-do/shared/task-edit-dialog/components/task-suggestion-menus.tsx +0 -148
- package/src/components/ui/tu-do/shared/task-edit-dialog/constants.ts +0 -18
- package/src/components/ui/tu-do/shared/task-edit-dialog/context-menu-guard.test.ts +0 -37
- package/src/components/ui/tu-do/shared/task-edit-dialog/description-diff-viewer.tsx +0 -1665
- package/src/components/ui/tu-do/shared/task-edit-dialog/description-versions.test.ts +0 -97
- package/src/components/ui/tu-do/shared/task-edit-dialog/description-versions.ts +0 -210
- package/src/components/ui/tu-do/shared/task-edit-dialog/field-diff-viewer.tsx +0 -716
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-dialog-close.test.ts +0 -218
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-dialog-keyboard-shortcuts.test.ts +0 -140
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-mutations.test.tsx +0 -231
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-overrides.test.ts +0 -412
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-realtime-sync.test.tsx +0 -237
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-task-yjs-sync.test.ts +0 -190
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/__tests__/use-update-shared-task.test.ts +0 -107
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/task-api.test.ts +0 -171
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/task-api.ts +0 -296
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-editor-commands.ts +0 -314
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-suggestion-menus.ts +0 -503
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-change-detection.ts +0 -175
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-data.ts +0 -401
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-dependencies.ts +0 -773
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-dialog-close.ts +0 -193
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-dialog-keyboard-shortcuts.ts +0 -365
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-form-reset.ts +0 -231
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-form-state.ts +0 -307
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-mutations.ts +0 -609
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-overrides.ts +0 -134
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-realtime-sync.ts +0 -270
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-relationships.test.tsx +0 -212
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-relationships.ts +0 -554
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-revert.ts +0 -140
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-save.test.ts +0 -289
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-save.ts +0 -1473
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-snapshot.ts +0 -59
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-task-yjs-sync.ts +0 -224
- package/src/components/ui/tu-do/shared/task-edit-dialog/hooks/use-update-shared-task.ts +0 -60
- package/src/components/ui/tu-do/shared/task-edit-dialog/personal-overrides-section.tsx +0 -368
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/components/clickable-task-item.tsx +0 -90
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/components/index.ts +0 -4
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/components/subtask-action-buttons.tsx +0 -140
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/components/tab-button.tsx +0 -76
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/components/task-relationship-action-buttons.tsx +0 -178
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/dependencies-section.tsx +0 -140
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/index.ts +0 -35
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/parent-section.tsx +0 -70
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/related-section.tsx +0 -81
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/subtasks-section.tsx +0 -87
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/task-search-popover.tsx +0 -229
- package/src/components/ui/tu-do/shared/task-edit-dialog/relationships/types/task-relationships.types.ts +0 -194
- package/src/components/ui/tu-do/shared/task-edit-dialog/selective-revert-panel.test.tsx +0 -91
- package/src/components/ui/tu-do/shared/task-edit-dialog/selective-revert-panel.tsx +0 -365
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-activity-section.tsx +0 -802
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-delete-dialog.tsx +0 -104
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-change-dialog.test.tsx +0 -63
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-change-dialog.tsx +0 -218
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-restore-banner.tsx +0 -83
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-version-restore-dialog.test.tsx +0 -120
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-description-version-restore-dialog.tsx +0 -180
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-dialog-actions.test.tsx +0 -68
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-dialog-actions.tsx +0 -239
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-instances-section.tsx +0 -173
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-properties-section.test.tsx +0 -303
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-properties-section.tsx +0 -2213
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-relationships-properties.tsx +0 -315
- package/src/components/ui/tu-do/shared/task-edit-dialog/task-snapshot-dialog.tsx +0 -167
- package/src/components/ui/tu-do/shared/task-edit-dialog/types/pending-relationship.test.ts +0 -52
- package/src/components/ui/tu-do/shared/task-edit-dialog/types/pending-relationship.ts +0 -134
- package/src/components/ui/tu-do/shared/task-edit-dialog/types.ts +0 -64
- package/src/components/ui/tu-do/shared/task-edit-dialog/user-display.test.ts +0 -58
- package/src/components/ui/tu-do/shared/task-edit-dialog/user-display.ts +0 -45
- package/src/components/ui/tu-do/shared/task-edit-dialog/utils/inline-task-target-list.test.ts +0 -98
- package/src/components/ui/tu-do/shared/task-edit-dialog/utils/inline-task-target-list.ts +0 -39
- package/src/components/ui/tu-do/shared/task-edit-dialog/utils.test.ts +0 -504
- package/src/components/ui/tu-do/shared/task-edit-dialog/utils.ts +0 -582
- package/src/components/ui/tu-do/shared/task-edit-dialog/yjs-prosemirror-compat.test.ts +0 -65
- package/src/components/ui/tu-do/shared/task-edit-dialog.tsx +0 -3196
- package/src/components/ui/tu-do/shared/task-estimation-display.tsx +0 -52
- package/src/components/ui/tu-do/shared/task-estimation-picker.tsx +0 -226
- package/src/components/ui/tu-do/shared/task-filter.types.ts +0 -65
- package/src/components/ui/tu-do/shared/task-label-selector.tsx +0 -217
- package/src/components/ui/tu-do/shared/task-labels-display.test.tsx +0 -51
- package/src/components/ui/tu-do/shared/task-labels-display.tsx +0 -119
- package/src/components/ui/tu-do/shared/task-legacy-route-recovery.tsx +0 -65
- package/src/components/ui/tu-do/shared/task-projects-display.tsx +0 -80
- package/src/components/ui/tu-do/shared/task-quick-create-target-list.ts +0 -20
- package/src/components/ui/tu-do/shared/task-resource-search-field.tsx +0 -49
- package/src/components/ui/tu-do/shared/task-resource-search-filters.ts +0 -27
- package/src/components/ui/tu-do/shared/task-row-actions-menu.test.tsx +0 -138
- package/src/components/ui/tu-do/shared/task-row-actions-menu.tsx +0 -402
- package/src/components/ui/tu-do/shared/task-share-dialog/components/share-link-settings.tsx +0 -86
- package/src/components/ui/tu-do/shared/task-share-dialog/components/shares-list.tsx +0 -85
- package/src/components/ui/tu-do/shared/task-share-dialog/hooks/use-task-sharing.ts +0 -296
- package/src/components/ui/tu-do/shared/task-share-dialog.tsx +0 -144
- package/src/components/ui/tu-do/shared/task-sound-effects.test.ts +0 -189
- package/src/components/ui/tu-do/shared/task-sound-effects.tsx +0 -468
- package/src/components/ui/tu-do/shared/task-url.ts +0 -56
- package/src/components/ui/tu-do/shared/text-diff-viewer.tsx +0 -55
- package/src/components/ui/tu-do/shared/types.ts +0 -14
- package/src/components/ui/tu-do/shared/unsaved-changes-warning-dialog.tsx +0 -71
- package/src/components/ui/tu-do/shared/use-progressive-board-loader.ts +0 -312
- package/src/components/ui/tu-do/shared/user-avatar.tsx +0 -46
- package/src/components/ui/tu-do/shared/user-presence-avatars.tsx +0 -415
- package/src/components/ui/tu-do/shared/utils/translate-task-list-display-name.ts +0 -28
- package/src/components/ui/tu-do/tasks-route-context.tsx +0 -50
- package/src/components/ui/tu-do/templates/client.tsx +0 -505
- package/src/components/ui/tu-do/templates/marketplace/client.tsx +0 -487
- package/src/components/ui/tu-do/templates/marketplace/task-marketplace-page.tsx +0 -169
- package/src/components/ui/tu-do/templates/save-as-template-dialog.tsx +0 -381
- package/src/components/ui/tu-do/templates/task-template-api.ts +0 -142
- package/src/components/ui/tu-do/templates/task-template-card.tsx +0 -118
- package/src/components/ui/tu-do/templates/task-template-client.test.tsx +0 -52
- package/src/components/ui/tu-do/templates/task-template-client.tsx +0 -258
- package/src/components/ui/tu-do/templates/task-template-dialogs.test.tsx +0 -167
- package/src/components/ui/tu-do/templates/task-template-dialogs.tsx +0 -376
- package/src/components/ui/tu-do/templates/task-templates-hub.test.tsx +0 -114
- package/src/components/ui/tu-do/templates/task-templates-hub.tsx +0 -53
- package/src/components/ui/tu-do/templates/task-templates-page.tsx +0 -157
- package/src/components/ui/tu-do/templates/templateId/client.tsx +0 -674
- package/src/components/ui/tu-do/templates/templateId/edit-template-dialog.tsx +0 -300
- package/src/components/ui/tu-do/templates/templateId/share-template-dialog.tsx +0 -261
- package/src/components/ui/tu-do/templates/templateId/task-template-detail-page-client.tsx +0 -127
- package/src/components/ui/tu-do/templates/templateId/task-template-detail-page.tsx +0 -89
- package/src/components/ui/tu-do/templates/templateId/use-template-dialog.tsx +0 -165
- package/src/components/ui/tu-do/templates/types.ts +0 -53
- package/src/components/ui/tu-do/utils/__tests__/label-colors.test.ts +0 -43
- package/src/components/ui/tu-do/utils/__tests__/taskColorUtils.test.ts +0 -267
- package/src/components/ui/tu-do/utils/__tests__/taskConstants.test.ts +0 -178
- package/src/components/ui/tu-do/utils/__tests__/taskDateUtils.test.ts +0 -226
- package/src/components/ui/tu-do/utils/__tests__/weekDateUtils.test.ts +0 -182
- package/src/components/ui/tu-do/utils/label-colors.test.ts +0 -15
- package/src/components/ui/tu-do/utils/label-colors.ts +0 -59
- package/src/components/ui/tu-do/utils/taskColorUtils.ts +0 -116
- package/src/components/ui/tu-do/utils/taskConstants.ts +0 -102
- package/src/components/ui/tu-do/utils/taskDateUtils.ts +0 -81
- package/src/components/ui/tu-do/utils/taskPriorityUtils.tsx +0 -80
- package/src/components/ui/tu-do/utils/weekDateUtils.ts +0 -64
- package/src/hooks/__tests__/use-task-actions.test.tsx +0 -2098
- package/src/hooks/__tests__/useBoardPresence.test.tsx +0 -191
- package/src/hooks/__tests__/useBoardRealtime.test.tsx +0 -1036
- package/src/hooks/__tests__/useCursorTracking.test.tsx +0 -212
- package/src/hooks/task-actions-personal-external.ts +0 -313
- package/src/hooks/use-task-actions.ts +0 -1910
- package/src/hooks/useBoardPresence.ts +0 -364
- package/src/hooks/useBoardRealtime.ts +0 -428
- package/src/hooks/useBoardRealtime.types.ts +0 -56
- package/src/hooks/useBoardRealtimeEventHandler.ts +0 -452
- package/src/hooks/useCursorTracking.ts +0 -402
- package/src/hooks/usePresence.ts +0 -272
- package/src/hooks/useTaskUserRealtime.ts +0 -340
- /package/src/{components/ui/tu-do/shared → lib}/task-open-events.ts +0 -0
|
@@ -1,2213 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
AlertCircle,
|
|
5
|
-
AlertTriangle,
|
|
6
|
-
Box,
|
|
7
|
-
Briefcase,
|
|
8
|
-
Calendar,
|
|
9
|
-
CalendarClock,
|
|
10
|
-
Check,
|
|
11
|
-
CheckCircle,
|
|
12
|
-
ChevronDown,
|
|
13
|
-
Clock,
|
|
14
|
-
Flag,
|
|
15
|
-
Loader2,
|
|
16
|
-
Minus,
|
|
17
|
-
Pen,
|
|
18
|
-
Plus,
|
|
19
|
-
Save,
|
|
20
|
-
Scissors,
|
|
21
|
-
Tag,
|
|
22
|
-
Timer,
|
|
23
|
-
User,
|
|
24
|
-
Users,
|
|
25
|
-
X,
|
|
26
|
-
Zap,
|
|
27
|
-
} from '@tuturuuu/icons';
|
|
28
|
-
import type { TaskPriority } from '@tuturuuu/types/primitives/Priority';
|
|
29
|
-
import type { CalendarHoursType } from '@tuturuuu/types/primitives/Task';
|
|
30
|
-
import type { TaskList } from '@tuturuuu/types/primitives/TaskList';
|
|
31
|
-
import { Badge } from '@tuturuuu/ui/badge';
|
|
32
|
-
import { Button } from '@tuturuuu/ui/button';
|
|
33
|
-
import { DateTimePicker } from '@tuturuuu/ui/date-time-picker';
|
|
34
|
-
import { useCalendarPreferences } from '@tuturuuu/ui/hooks/use-calendar-preferences';
|
|
35
|
-
import { Label } from '@tuturuuu/ui/label';
|
|
36
|
-
import { Popover, PopoverContent, PopoverTrigger } from '@tuturuuu/ui/popover';
|
|
37
|
-
import { Progress } from '@tuturuuu/ui/progress';
|
|
38
|
-
import { Switch } from '@tuturuuu/ui/switch';
|
|
39
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from '@tuturuuu/ui/tooltip';
|
|
40
|
-
import { cn } from '@tuturuuu/utils/format';
|
|
41
|
-
import { computeAccessibleLabelStyles } from '@tuturuuu/utils/label-colors';
|
|
42
|
-
import dayjs from 'dayjs';
|
|
43
|
-
import { useTranslations } from 'next-intl';
|
|
44
|
-
import {
|
|
45
|
-
type ComponentProps,
|
|
46
|
-
cloneElement,
|
|
47
|
-
isValidElement,
|
|
48
|
-
type ReactElement,
|
|
49
|
-
type ReactNode,
|
|
50
|
-
useCallback,
|
|
51
|
-
useEffect,
|
|
52
|
-
useMemo,
|
|
53
|
-
useRef,
|
|
54
|
-
useState,
|
|
55
|
-
} from 'react';
|
|
56
|
-
import { PRIORITY_BADGE_COLORS } from '../../utils/taskConstants';
|
|
57
|
-
import { getPriorityIcon } from '../../utils/taskPriorityUtils';
|
|
58
|
-
import { ClearMenuItem } from '../clear-menu-item';
|
|
59
|
-
import { EmptyStateCard } from '../empty-state-card';
|
|
60
|
-
import {
|
|
61
|
-
buildEstimationIndices,
|
|
62
|
-
mapEstimationPoints,
|
|
63
|
-
} from '../estimation-mapping';
|
|
64
|
-
import { LabelChip } from '../label-chip';
|
|
65
|
-
import type { SchedulingSettings } from '../task-edit-dialog/hooks/use-task-mutations';
|
|
66
|
-
import type { WorkspaceTaskLabel } from '../task-edit-dialog/types';
|
|
67
|
-
import { TaskResourceSearchField } from '../task-resource-search-field';
|
|
68
|
-
import {
|
|
69
|
-
labelNameMatchesQuery,
|
|
70
|
-
memberMatchesSearchQuery,
|
|
71
|
-
projectNameMatchesQuery,
|
|
72
|
-
} from '../task-resource-search-filters';
|
|
73
|
-
import { UserAvatar } from '../user-avatar';
|
|
74
|
-
import { translateTaskListNameForDisplay } from '../utils/translate-task-list-display-name';
|
|
75
|
-
import { TaskListSelector } from './components/task-list-selector';
|
|
76
|
-
import {
|
|
77
|
-
getTaskListTriggerIcon,
|
|
78
|
-
getTaskListTriggerSurfaceClass,
|
|
79
|
-
} from './components/task-list-trigger-styles';
|
|
80
|
-
|
|
81
|
-
// Scheduled calendar event type
|
|
82
|
-
export interface ScheduledCalendarEvent {
|
|
83
|
-
id: string;
|
|
84
|
-
title: string;
|
|
85
|
-
start_at: string;
|
|
86
|
-
end_at: string;
|
|
87
|
-
scheduled_minutes: number;
|
|
88
|
-
completed: boolean;
|
|
89
|
-
locked?: boolean;
|
|
90
|
-
scheduling_reason?: string;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
interface TaskPropertiesSectionProps {
|
|
94
|
-
// IDs
|
|
95
|
-
wsId: string;
|
|
96
|
-
boardId: string;
|
|
97
|
-
taskId?: string;
|
|
98
|
-
// State
|
|
99
|
-
priority: TaskPriority | null;
|
|
100
|
-
startDate: Date | undefined;
|
|
101
|
-
endDate: Date | undefined;
|
|
102
|
-
estimationPoints: number | null | undefined;
|
|
103
|
-
selectedLabels: WorkspaceTaskLabel[];
|
|
104
|
-
selectedProjects: any[];
|
|
105
|
-
selectedListId: string;
|
|
106
|
-
selectedAssignees: any[];
|
|
107
|
-
isLoading: boolean;
|
|
108
|
-
isPersonalWorkspace: boolean;
|
|
109
|
-
canUseBoardAssignees?: boolean;
|
|
110
|
-
isCreateMode: boolean;
|
|
111
|
-
// Scheduling state
|
|
112
|
-
totalDuration: number | null;
|
|
113
|
-
isSplittable: boolean;
|
|
114
|
-
minSplitDurationMinutes: number | null;
|
|
115
|
-
maxSplitDurationMinutes: number | null;
|
|
116
|
-
calendarHours: CalendarHoursType | null;
|
|
117
|
-
autoSchedule: boolean;
|
|
118
|
-
// Saved scheduling state (for comparison)
|
|
119
|
-
savedSchedulingSettings?: SchedulingSettings;
|
|
120
|
-
// Scheduled events for this task
|
|
121
|
-
scheduledEvents?: ScheduledCalendarEvent[];
|
|
122
|
-
|
|
123
|
-
// Data
|
|
124
|
-
availableLists: TaskList[];
|
|
125
|
-
availableLabels: WorkspaceTaskLabel[];
|
|
126
|
-
taskProjects: any[];
|
|
127
|
-
workspaceMembers: any[];
|
|
128
|
-
boardConfig: any;
|
|
129
|
-
|
|
130
|
-
// Handlers
|
|
131
|
-
onPriorityChange: (priority: TaskPriority | null) => void;
|
|
132
|
-
onStartDateChange: (date: Date | undefined) => void;
|
|
133
|
-
onEndDateChange: (date: Date | undefined) => void;
|
|
134
|
-
onEstimationChange: (points: number | null) => void;
|
|
135
|
-
onLabelToggle: (label: WorkspaceTaskLabel) => void;
|
|
136
|
-
onProjectToggle: (project: any) => void;
|
|
137
|
-
onListChange: (listId: string) => void;
|
|
138
|
-
onAssigneeToggle: (assignee: any) => void;
|
|
139
|
-
onQuickDueDate: (days: number | null) => void;
|
|
140
|
-
onShowNewLabelDialog: () => void;
|
|
141
|
-
onShowNewProjectDialog: () => void;
|
|
142
|
-
onShowEstimationConfigDialog: () => void;
|
|
143
|
-
// Scheduling handlers
|
|
144
|
-
onTotalDurationChange: (duration: number | null) => void;
|
|
145
|
-
onIsSplittableChange: (splittable: boolean) => void;
|
|
146
|
-
onMinSplitDurationChange: (minutes: number | null) => void;
|
|
147
|
-
onMaxSplitDurationChange: (minutes: number | null) => void;
|
|
148
|
-
onCalendarHoursChange: (hourType: CalendarHoursType | null) => void;
|
|
149
|
-
onAutoScheduleChange: (autoSchedule: boolean) => void;
|
|
150
|
-
onSaveSchedulingSettings: (settings: SchedulingSettings) => Promise<boolean>;
|
|
151
|
-
schedulingSaving: boolean;
|
|
152
|
-
disabled?: boolean;
|
|
153
|
-
/** When true, hides fields not supported by drafts (projects, scheduling) */
|
|
154
|
-
isDraftMode?: boolean;
|
|
155
|
-
/** Compact icon-only controls for the create popover. */
|
|
156
|
-
variant?: 'default' | 'compact';
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
type TaskPropertyPopoverId =
|
|
160
|
-
| 'priority'
|
|
161
|
-
| 'list'
|
|
162
|
-
| 'dates'
|
|
163
|
-
| 'estimation'
|
|
164
|
-
| 'labels'
|
|
165
|
-
| 'projects'
|
|
166
|
-
| 'assignees'
|
|
167
|
-
| 'scheduling';
|
|
168
|
-
|
|
169
|
-
const TASK_PROPERTY_POPOVER_TRIGGER_ATTRIBUTE =
|
|
170
|
-
'data-task-property-popover-trigger';
|
|
171
|
-
|
|
172
|
-
const taskPropertyPopoverIds = new Set<TaskPropertyPopoverId>([
|
|
173
|
-
'priority',
|
|
174
|
-
'list',
|
|
175
|
-
'dates',
|
|
176
|
-
'estimation',
|
|
177
|
-
'labels',
|
|
178
|
-
'projects',
|
|
179
|
-
'assignees',
|
|
180
|
-
'scheduling',
|
|
181
|
-
]);
|
|
182
|
-
|
|
183
|
-
function isTaskPropertyPopoverId(
|
|
184
|
-
value: string | null
|
|
185
|
-
): value is TaskPropertyPopoverId {
|
|
186
|
-
return !!value && taskPropertyPopoverIds.has(value as TaskPropertyPopoverId);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function getTaskPropertyPopoverIdFromTarget(
|
|
190
|
-
target: EventTarget | null
|
|
191
|
-
): TaskPropertyPopoverId | null {
|
|
192
|
-
if (typeof Element === 'undefined' || !(target instanceof Element)) {
|
|
193
|
-
return null;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const trigger = target.closest(
|
|
197
|
-
`[${TASK_PROPERTY_POPOVER_TRIGGER_ATTRIBUTE}]`
|
|
198
|
-
);
|
|
199
|
-
const popoverId =
|
|
200
|
-
trigger?.getAttribute(TASK_PROPERTY_POPOVER_TRIGGER_ATTRIBUTE) ?? null;
|
|
201
|
-
|
|
202
|
-
return isTaskPropertyPopoverId(popoverId) ? popoverId : null;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function TaskPropertyPopoverTrigger({
|
|
206
|
-
children,
|
|
207
|
-
compact,
|
|
208
|
-
label,
|
|
209
|
-
popoverId,
|
|
210
|
-
}: {
|
|
211
|
-
children: ReactNode;
|
|
212
|
-
compact: boolean;
|
|
213
|
-
label: ReactNode;
|
|
214
|
-
popoverId: TaskPropertyPopoverId;
|
|
215
|
-
}) {
|
|
216
|
-
const trigger = isValidElement(children)
|
|
217
|
-
? cloneElement(children as ReactElement<Record<string, unknown>>, {
|
|
218
|
-
[TASK_PROPERTY_POPOVER_TRIGGER_ATTRIBUTE]: popoverId,
|
|
219
|
-
})
|
|
220
|
-
: children;
|
|
221
|
-
|
|
222
|
-
if (!compact) {
|
|
223
|
-
return <PopoverTrigger asChild>{trigger}</PopoverTrigger>;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
return (
|
|
227
|
-
<Tooltip>
|
|
228
|
-
<TooltipTrigger asChild>
|
|
229
|
-
<PopoverTrigger asChild>{trigger}</PopoverTrigger>
|
|
230
|
-
</TooltipTrigger>
|
|
231
|
-
<TooltipContent side="bottom">{label}</TooltipContent>
|
|
232
|
-
</Tooltip>
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
type TaskPropertyPopoverContentProps = ComponentProps<typeof PopoverContent>;
|
|
237
|
-
|
|
238
|
-
// Calendar hours type options
|
|
239
|
-
const getCalendarHoursOptions = (t: any) => [
|
|
240
|
-
{
|
|
241
|
-
value: 'work_hours' as CalendarHoursType,
|
|
242
|
-
label: t('ws-task-boards.dialog.work_hours'),
|
|
243
|
-
icon: Briefcase,
|
|
244
|
-
description: t('ws-task-boards.dialog.schedule_during_work_hours'),
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
value: 'meeting_hours' as CalendarHoursType,
|
|
248
|
-
label: t('ws-task-boards.dialog.meeting_hours'),
|
|
249
|
-
icon: Calendar,
|
|
250
|
-
description: t('ws-task-boards.dialog.schedule_during_meeting_hours'),
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
value: 'personal_hours' as CalendarHoursType,
|
|
254
|
-
label: t('ws-task-boards.dialog.personal_hours'),
|
|
255
|
-
icon: User,
|
|
256
|
-
description: t('ws-task-boards.dialog.schedule_during_personal_hours'),
|
|
257
|
-
},
|
|
258
|
-
];
|
|
259
|
-
|
|
260
|
-
// Format duration helper - rounds to avoid floating point issues
|
|
261
|
-
function formatDuration(totalMinutes: number, t: any): string {
|
|
262
|
-
const roundedTotal = Math.round(totalMinutes);
|
|
263
|
-
const hours = Math.floor(roundedTotal / 60);
|
|
264
|
-
const minutes = roundedTotal % 60;
|
|
265
|
-
const h = t('ws-task-boards.dialog.h');
|
|
266
|
-
const m = t('ws-task-boards.dialog.m');
|
|
267
|
-
|
|
268
|
-
if (hours === 0) return `${minutes}${m}`;
|
|
269
|
-
if (minutes === 0) return `${hours}${h}`;
|
|
270
|
-
return `${hours}${h} ${minutes}${m}`;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
// Custom duration input component with better UX
|
|
274
|
-
interface DurationInputProps {
|
|
275
|
-
value: number;
|
|
276
|
-
onChange: (value: number, direction?: 'increment' | 'decrement') => void;
|
|
277
|
-
min?: number;
|
|
278
|
-
max?: number;
|
|
279
|
-
step?: number;
|
|
280
|
-
disabled?: boolean;
|
|
281
|
-
label: string;
|
|
282
|
-
className?: string;
|
|
283
|
-
// For minute inputs that need to rollover to hours
|
|
284
|
-
allowRollover?: boolean;
|
|
285
|
-
canDecrement?: boolean;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
function DurationInput({
|
|
289
|
-
value,
|
|
290
|
-
onChange,
|
|
291
|
-
min = 0,
|
|
292
|
-
max = 999,
|
|
293
|
-
step = 1,
|
|
294
|
-
disabled = false,
|
|
295
|
-
label,
|
|
296
|
-
className,
|
|
297
|
-
allowRollover = false,
|
|
298
|
-
canDecrement,
|
|
299
|
-
}: DurationInputProps) {
|
|
300
|
-
const handleIncrement = () => {
|
|
301
|
-
if (allowRollover) {
|
|
302
|
-
// For rollover mode, pass the would-be value and direction
|
|
303
|
-
onChange(value + step, 'increment');
|
|
304
|
-
} else {
|
|
305
|
-
const newValue = Math.min(value + step, max);
|
|
306
|
-
onChange(newValue);
|
|
307
|
-
}
|
|
308
|
-
};
|
|
309
|
-
|
|
310
|
-
const handleDecrement = () => {
|
|
311
|
-
if (allowRollover) {
|
|
312
|
-
// For rollover mode, pass the would-be value and direction
|
|
313
|
-
onChange(value - step, 'decrement');
|
|
314
|
-
} else {
|
|
315
|
-
const newValue = Math.max(value - step, min);
|
|
316
|
-
onChange(newValue);
|
|
317
|
-
}
|
|
318
|
-
};
|
|
319
|
-
|
|
320
|
-
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
321
|
-
const parsed = parseInt(e.target.value, 10);
|
|
322
|
-
if (Number.isNaN(parsed)) {
|
|
323
|
-
onChange(min);
|
|
324
|
-
} else {
|
|
325
|
-
onChange(Math.max(min, Math.min(parsed, max)));
|
|
326
|
-
}
|
|
327
|
-
};
|
|
328
|
-
|
|
329
|
-
// Determine if decrement is allowed
|
|
330
|
-
const decrementDisabled = allowRollover
|
|
331
|
-
? canDecrement === false
|
|
332
|
-
: value <= min;
|
|
333
|
-
|
|
334
|
-
return (
|
|
335
|
-
<div className={cn('flex items-center gap-1', className)}>
|
|
336
|
-
<div className="flex h-8 items-center overflow-hidden rounded-md border bg-background">
|
|
337
|
-
<button
|
|
338
|
-
type="button"
|
|
339
|
-
onClick={handleDecrement}
|
|
340
|
-
disabled={disabled || decrementDisabled}
|
|
341
|
-
className="flex h-full w-7 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"
|
|
342
|
-
>
|
|
343
|
-
<Minus className="h-3 w-3" />
|
|
344
|
-
</button>
|
|
345
|
-
<input
|
|
346
|
-
type="text"
|
|
347
|
-
inputMode="numeric"
|
|
348
|
-
pattern="[0-9]*"
|
|
349
|
-
value={value}
|
|
350
|
-
onChange={handleInputChange}
|
|
351
|
-
disabled={disabled}
|
|
352
|
-
className="h-full w-10 border-x bg-transparent text-center text-sm outline-none [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"
|
|
353
|
-
/>
|
|
354
|
-
<button
|
|
355
|
-
type="button"
|
|
356
|
-
onClick={handleIncrement}
|
|
357
|
-
disabled={disabled}
|
|
358
|
-
className="flex h-full w-7 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50"
|
|
359
|
-
>
|
|
360
|
-
<Plus className="h-3 w-3" />
|
|
361
|
-
</button>
|
|
362
|
-
</div>
|
|
363
|
-
<span className="text-muted-foreground text-xs">{label}</span>
|
|
364
|
-
</div>
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
export function TaskPropertiesSection(props: TaskPropertiesSectionProps) {
|
|
369
|
-
const {
|
|
370
|
-
wsId,
|
|
371
|
-
boardId,
|
|
372
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
373
|
-
taskId: _taskId,
|
|
374
|
-
priority,
|
|
375
|
-
startDate,
|
|
376
|
-
endDate,
|
|
377
|
-
estimationPoints,
|
|
378
|
-
selectedLabels,
|
|
379
|
-
selectedProjects,
|
|
380
|
-
selectedListId,
|
|
381
|
-
selectedAssignees,
|
|
382
|
-
isLoading,
|
|
383
|
-
isPersonalWorkspace,
|
|
384
|
-
canUseBoardAssignees = !isPersonalWorkspace,
|
|
385
|
-
isCreateMode,
|
|
386
|
-
// Scheduling state
|
|
387
|
-
totalDuration,
|
|
388
|
-
isSplittable,
|
|
389
|
-
minSplitDurationMinutes,
|
|
390
|
-
maxSplitDurationMinutes,
|
|
391
|
-
calendarHours,
|
|
392
|
-
autoSchedule,
|
|
393
|
-
savedSchedulingSettings,
|
|
394
|
-
scheduledEvents,
|
|
395
|
-
availableLists,
|
|
396
|
-
availableLabels,
|
|
397
|
-
taskProjects,
|
|
398
|
-
workspaceMembers,
|
|
399
|
-
boardConfig,
|
|
400
|
-
onPriorityChange,
|
|
401
|
-
onStartDateChange,
|
|
402
|
-
onEndDateChange,
|
|
403
|
-
onEstimationChange,
|
|
404
|
-
onLabelToggle,
|
|
405
|
-
onProjectToggle,
|
|
406
|
-
onListChange,
|
|
407
|
-
onAssigneeToggle,
|
|
408
|
-
onQuickDueDate,
|
|
409
|
-
onShowNewLabelDialog,
|
|
410
|
-
onShowNewProjectDialog,
|
|
411
|
-
onShowEstimationConfigDialog,
|
|
412
|
-
// Scheduling handlers
|
|
413
|
-
onTotalDurationChange,
|
|
414
|
-
onIsSplittableChange,
|
|
415
|
-
onMinSplitDurationChange,
|
|
416
|
-
onMaxSplitDurationChange,
|
|
417
|
-
onCalendarHoursChange,
|
|
418
|
-
onAutoScheduleChange,
|
|
419
|
-
onSaveSchedulingSettings,
|
|
420
|
-
schedulingSaving,
|
|
421
|
-
disabled = false,
|
|
422
|
-
isDraftMode = false,
|
|
423
|
-
variant = 'default',
|
|
424
|
-
} = props;
|
|
425
|
-
|
|
426
|
-
const t = useTranslations();
|
|
427
|
-
const isCompact = variant === 'compact';
|
|
428
|
-
const triggerBaseClass = cn(
|
|
429
|
-
'inline-flex shrink-0 items-center border font-medium text-xs transition-colors',
|
|
430
|
-
isCompact
|
|
431
|
-
? 'h-9 w-9 justify-center rounded-md p-0'
|
|
432
|
-
: 'h-8 gap-1.5 rounded-lg px-3'
|
|
433
|
-
);
|
|
434
|
-
const compactLabelClass = isCompact ? 'sr-only' : undefined;
|
|
435
|
-
|
|
436
|
-
const selectedListForSummary = useMemo(
|
|
437
|
-
() =>
|
|
438
|
-
selectedListId
|
|
439
|
-
? availableLists?.find((l) => l.id === selectedListId)
|
|
440
|
-
: undefined,
|
|
441
|
-
[availableLists, selectedListId]
|
|
442
|
-
);
|
|
443
|
-
|
|
444
|
-
const listNameLabels = useMemo(
|
|
445
|
-
() => ({
|
|
446
|
-
toDo: t('common.list_name_to_do'),
|
|
447
|
-
inProgress: t('common.list_name_in_progress'),
|
|
448
|
-
review: t('common.list_name_review'),
|
|
449
|
-
done: t('common.list_name_done'),
|
|
450
|
-
closed: t('common.list_name_closed'),
|
|
451
|
-
documents: t('common.documents'),
|
|
452
|
-
}),
|
|
453
|
-
[t]
|
|
454
|
-
);
|
|
455
|
-
|
|
456
|
-
const ListSummaryTriggerIcon = getTaskListTriggerIcon(selectedListForSummary);
|
|
457
|
-
const listSummarySurfaceClass = getTaskListTriggerSurfaceClass(
|
|
458
|
-
selectedListForSummary
|
|
459
|
-
);
|
|
460
|
-
|
|
461
|
-
const { weekStartsOn, timezone, timeFormat } = useCalendarPreferences();
|
|
462
|
-
|
|
463
|
-
const [isMetadataExpanded, setIsMetadataExpanded] = useState(false);
|
|
464
|
-
const [activePopover, setActivePopover] =
|
|
465
|
-
useState<TaskPropertyPopoverId | null>(null);
|
|
466
|
-
const [labelSearchQuery, setLabelSearchQuery] = useState('');
|
|
467
|
-
const [projectSearchQuery, setProjectSearchQuery] = useState('');
|
|
468
|
-
const [assigneeSearchQuery, setAssigneeSearchQuery] = useState('');
|
|
469
|
-
|
|
470
|
-
const isPopoverOpen = useCallback(
|
|
471
|
-
(popoverId: TaskPropertyPopoverId) => activePopover === popoverId,
|
|
472
|
-
[activePopover]
|
|
473
|
-
);
|
|
474
|
-
|
|
475
|
-
const openPropertyPopover = useCallback(
|
|
476
|
-
(popoverId: TaskPropertyPopoverId) => {
|
|
477
|
-
setActivePopover(popoverId);
|
|
478
|
-
},
|
|
479
|
-
[]
|
|
480
|
-
);
|
|
481
|
-
|
|
482
|
-
const closePropertyPopover = useCallback(
|
|
483
|
-
(popoverId: TaskPropertyPopoverId) => {
|
|
484
|
-
setActivePopover((currentPopover) =>
|
|
485
|
-
currentPopover === popoverId ? null : currentPopover
|
|
486
|
-
);
|
|
487
|
-
},
|
|
488
|
-
[]
|
|
489
|
-
);
|
|
490
|
-
|
|
491
|
-
const setPopoverOpen = useCallback(
|
|
492
|
-
(popoverId: TaskPropertyPopoverId, open: boolean) => {
|
|
493
|
-
if (open) {
|
|
494
|
-
openPropertyPopover(popoverId);
|
|
495
|
-
return;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
closePropertyPopover(popoverId);
|
|
499
|
-
},
|
|
500
|
-
[closePropertyPopover, openPropertyPopover]
|
|
501
|
-
);
|
|
502
|
-
|
|
503
|
-
const handlePropertyPopoverCloseAutoFocus = useCallback<
|
|
504
|
-
NonNullable<TaskPropertyPopoverContentProps['onCloseAutoFocus']>
|
|
505
|
-
>((event) => {
|
|
506
|
-
event.preventDefault();
|
|
507
|
-
}, []);
|
|
508
|
-
|
|
509
|
-
const handlePropertyPopoverInteractOutside = useCallback<
|
|
510
|
-
NonNullable<TaskPropertyPopoverContentProps['onInteractOutside']>
|
|
511
|
-
>(
|
|
512
|
-
(event) => {
|
|
513
|
-
const targetPopoverId = getTaskPropertyPopoverIdFromTarget(event.target);
|
|
514
|
-
|
|
515
|
-
if (!targetPopoverId || targetPopoverId === activePopover) {
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
event.preventDefault();
|
|
520
|
-
|
|
521
|
-
const openTargetPopover = () => {
|
|
522
|
-
openPropertyPopover(targetPopoverId);
|
|
523
|
-
};
|
|
524
|
-
|
|
525
|
-
if (typeof window !== 'undefined' && window.requestAnimationFrame) {
|
|
526
|
-
window.requestAnimationFrame(openTargetPopover);
|
|
527
|
-
return;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
openTargetPopover();
|
|
531
|
-
},
|
|
532
|
-
[activePopover, openPropertyPopover]
|
|
533
|
-
);
|
|
534
|
-
|
|
535
|
-
const propertyPopoverContentProps = useMemo(
|
|
536
|
-
() => ({
|
|
537
|
-
onCloseAutoFocus: handlePropertyPopoverCloseAutoFocus,
|
|
538
|
-
onInteractOutside: handlePropertyPopoverInteractOutside,
|
|
539
|
-
}),
|
|
540
|
-
[handlePropertyPopoverCloseAutoFocus, handlePropertyPopoverInteractOutside]
|
|
541
|
-
);
|
|
542
|
-
|
|
543
|
-
useEffect(() => {
|
|
544
|
-
if (activePopover !== 'labels') {
|
|
545
|
-
setLabelSearchQuery('');
|
|
546
|
-
}
|
|
547
|
-
}, [activePopover]);
|
|
548
|
-
|
|
549
|
-
useEffect(() => {
|
|
550
|
-
if (activePopover !== 'projects') {
|
|
551
|
-
setProjectSearchQuery('');
|
|
552
|
-
}
|
|
553
|
-
}, [activePopover]);
|
|
554
|
-
|
|
555
|
-
useEffect(() => {
|
|
556
|
-
if (activePopover !== 'assignees') {
|
|
557
|
-
setAssigneeSearchQuery('');
|
|
558
|
-
}
|
|
559
|
-
}, [activePopover]);
|
|
560
|
-
|
|
561
|
-
const unselectedAvailableLabels = useMemo(
|
|
562
|
-
() =>
|
|
563
|
-
availableLabels.filter(
|
|
564
|
-
(l) => !selectedLabels.some((sl) => sl.id === l.id)
|
|
565
|
-
),
|
|
566
|
-
[availableLabels, selectedLabels]
|
|
567
|
-
);
|
|
568
|
-
const filteredUnselectedLabels = useMemo(
|
|
569
|
-
() =>
|
|
570
|
-
unselectedAvailableLabels.filter((l) =>
|
|
571
|
-
labelNameMatchesQuery(l.name, labelSearchQuery)
|
|
572
|
-
),
|
|
573
|
-
[unselectedAvailableLabels, labelSearchQuery]
|
|
574
|
-
);
|
|
575
|
-
|
|
576
|
-
const unselectedTaskProjects = useMemo(
|
|
577
|
-
() =>
|
|
578
|
-
taskProjects.filter(
|
|
579
|
-
(p) => !selectedProjects.some((sp) => sp.id === p.id)
|
|
580
|
-
),
|
|
581
|
-
[taskProjects, selectedProjects]
|
|
582
|
-
);
|
|
583
|
-
const filteredUnselectedProjects = useMemo(
|
|
584
|
-
() =>
|
|
585
|
-
unselectedTaskProjects.filter((p) =>
|
|
586
|
-
projectNameMatchesQuery(p.name, projectSearchQuery)
|
|
587
|
-
),
|
|
588
|
-
[unselectedTaskProjects, projectSearchQuery]
|
|
589
|
-
);
|
|
590
|
-
|
|
591
|
-
const unselectedWorkspaceMembers = useMemo(
|
|
592
|
-
() =>
|
|
593
|
-
workspaceMembers.filter(
|
|
594
|
-
(m) =>
|
|
595
|
-
!selectedAssignees.some(
|
|
596
|
-
(a) => (a.id || a.user_id) === (m.user_id || m.id)
|
|
597
|
-
)
|
|
598
|
-
),
|
|
599
|
-
[workspaceMembers, selectedAssignees]
|
|
600
|
-
);
|
|
601
|
-
const filteredUnselectedMembers = useMemo(
|
|
602
|
-
() =>
|
|
603
|
-
unselectedWorkspaceMembers.filter((m) =>
|
|
604
|
-
memberMatchesSearchQuery(
|
|
605
|
-
{ display_name: m.display_name, email: m.email },
|
|
606
|
-
assigneeSearchQuery
|
|
607
|
-
)
|
|
608
|
-
),
|
|
609
|
-
[unselectedWorkspaceMembers, assigneeSearchQuery]
|
|
610
|
-
);
|
|
611
|
-
|
|
612
|
-
// Track last saved settings locally (updates after successful save)
|
|
613
|
-
const [lastSavedSettings, setLastSavedSettings] = useState<
|
|
614
|
-
SchedulingSettings | undefined
|
|
615
|
-
>(savedSchedulingSettings);
|
|
616
|
-
|
|
617
|
-
// Update lastSavedSettings when prop changes (e.g., task is refetched)
|
|
618
|
-
// Use deep comparison since savedSchedulingSettings is a new object each render
|
|
619
|
-
const previousSavedRef = useRef(savedSchedulingSettings);
|
|
620
|
-
useEffect(() => {
|
|
621
|
-
const propValues = savedSchedulingSettings;
|
|
622
|
-
const prevValues = previousSavedRef.current;
|
|
623
|
-
|
|
624
|
-
// Deep compare to avoid overwriting on every render
|
|
625
|
-
const hasChanged =
|
|
626
|
-
propValues?.totalDuration !== prevValues?.totalDuration ||
|
|
627
|
-
propValues?.isSplittable !== prevValues?.isSplittable ||
|
|
628
|
-
propValues?.minSplitDurationMinutes !==
|
|
629
|
-
prevValues?.minSplitDurationMinutes ||
|
|
630
|
-
propValues?.maxSplitDurationMinutes !==
|
|
631
|
-
prevValues?.maxSplitDurationMinutes ||
|
|
632
|
-
propValues?.calendarHours !== prevValues?.calendarHours ||
|
|
633
|
-
propValues?.autoSchedule !== prevValues?.autoSchedule;
|
|
634
|
-
|
|
635
|
-
if (hasChanged) {
|
|
636
|
-
previousSavedRef.current = propValues;
|
|
637
|
-
setLastSavedSettings(propValues);
|
|
638
|
-
}
|
|
639
|
-
}, [savedSchedulingSettings]);
|
|
640
|
-
|
|
641
|
-
// Computed duration values
|
|
642
|
-
const totalMinutes = (totalDuration ?? 0) * 60;
|
|
643
|
-
const durationHours = Math.floor(totalMinutes / 60);
|
|
644
|
-
const durationMinutes = Math.round(totalMinutes % 60);
|
|
645
|
-
|
|
646
|
-
// Check if scheduling settings have unsaved changes
|
|
647
|
-
const hasUnsavedSchedulingChanges = useMemo(() => {
|
|
648
|
-
if (isCreateMode) return false; // In create mode, all changes are pending until save
|
|
649
|
-
if (!lastSavedSettings) return false; // No saved state to compare against
|
|
650
|
-
|
|
651
|
-
return (
|
|
652
|
-
totalDuration !== lastSavedSettings.totalDuration ||
|
|
653
|
-
isSplittable !== lastSavedSettings.isSplittable ||
|
|
654
|
-
minSplitDurationMinutes !== lastSavedSettings.minSplitDurationMinutes ||
|
|
655
|
-
maxSplitDurationMinutes !== lastSavedSettings.maxSplitDurationMinutes ||
|
|
656
|
-
calendarHours !== lastSavedSettings.calendarHours ||
|
|
657
|
-
autoSchedule !== lastSavedSettings.autoSchedule
|
|
658
|
-
);
|
|
659
|
-
}, [
|
|
660
|
-
isCreateMode,
|
|
661
|
-
lastSavedSettings,
|
|
662
|
-
totalDuration,
|
|
663
|
-
isSplittable,
|
|
664
|
-
minSplitDurationMinutes,
|
|
665
|
-
maxSplitDurationMinutes,
|
|
666
|
-
calendarHours,
|
|
667
|
-
autoSchedule,
|
|
668
|
-
]);
|
|
669
|
-
|
|
670
|
-
// Check if save is allowed (must have non-zero duration, hour type selected, and unsaved changes)
|
|
671
|
-
const canSaveScheduling = useMemo(() => {
|
|
672
|
-
const hasDuration = durationHours > 0 || durationMinutes > 0;
|
|
673
|
-
const hasHourType = calendarHours !== null;
|
|
674
|
-
return (
|
|
675
|
-
hasUnsavedSchedulingChanges &&
|
|
676
|
-
hasDuration &&
|
|
677
|
-
hasHourType &&
|
|
678
|
-
!schedulingSaving
|
|
679
|
-
);
|
|
680
|
-
}, [
|
|
681
|
-
hasUnsavedSchedulingChanges,
|
|
682
|
-
durationHours,
|
|
683
|
-
durationMinutes,
|
|
684
|
-
calendarHours,
|
|
685
|
-
schedulingSaving,
|
|
686
|
-
]);
|
|
687
|
-
|
|
688
|
-
// Handle save scheduling settings
|
|
689
|
-
const handleSaveSchedulingSettings = useCallback(async () => {
|
|
690
|
-
const settings: SchedulingSettings = {
|
|
691
|
-
totalDuration,
|
|
692
|
-
isSplittable,
|
|
693
|
-
minSplitDurationMinutes,
|
|
694
|
-
maxSplitDurationMinutes,
|
|
695
|
-
calendarHours,
|
|
696
|
-
autoSchedule,
|
|
697
|
-
};
|
|
698
|
-
const success = await onSaveSchedulingSettings(settings);
|
|
699
|
-
if (success) {
|
|
700
|
-
// Update local saved state to reflect the successful save
|
|
701
|
-
setLastSavedSettings(settings);
|
|
702
|
-
setPopoverOpen('scheduling', false);
|
|
703
|
-
}
|
|
704
|
-
}, [
|
|
705
|
-
totalDuration,
|
|
706
|
-
isSplittable,
|
|
707
|
-
minSplitDurationMinutes,
|
|
708
|
-
maxSplitDurationMinutes,
|
|
709
|
-
calendarHours,
|
|
710
|
-
autoSchedule,
|
|
711
|
-
onSaveSchedulingSettings,
|
|
712
|
-
setPopoverOpen,
|
|
713
|
-
]);
|
|
714
|
-
|
|
715
|
-
// Handle clear and save scheduling settings
|
|
716
|
-
const handleClearSchedulingSettings = useCallback(async () => {
|
|
717
|
-
// Clear all local state first
|
|
718
|
-
onTotalDurationChange(null);
|
|
719
|
-
onIsSplittableChange(false);
|
|
720
|
-
onMinSplitDurationChange(null);
|
|
721
|
-
onMaxSplitDurationChange(null);
|
|
722
|
-
onCalendarHoursChange(null);
|
|
723
|
-
onAutoScheduleChange(false);
|
|
724
|
-
|
|
725
|
-
// Save cleared settings to database
|
|
726
|
-
const clearedSettings: SchedulingSettings = {
|
|
727
|
-
totalDuration: null,
|
|
728
|
-
isSplittable: false,
|
|
729
|
-
minSplitDurationMinutes: null,
|
|
730
|
-
maxSplitDurationMinutes: null,
|
|
731
|
-
calendarHours: null,
|
|
732
|
-
autoSchedule: false,
|
|
733
|
-
};
|
|
734
|
-
const success = await onSaveSchedulingSettings(clearedSettings);
|
|
735
|
-
if (success) {
|
|
736
|
-
setLastSavedSettings(clearedSettings);
|
|
737
|
-
setPopoverOpen('scheduling', false);
|
|
738
|
-
}
|
|
739
|
-
}, [
|
|
740
|
-
onTotalDurationChange,
|
|
741
|
-
onIsSplittableChange,
|
|
742
|
-
onMinSplitDurationChange,
|
|
743
|
-
onMaxSplitDurationChange,
|
|
744
|
-
onCalendarHoursChange,
|
|
745
|
-
onAutoScheduleChange,
|
|
746
|
-
onSaveSchedulingSettings,
|
|
747
|
-
setPopoverOpen,
|
|
748
|
-
]);
|
|
749
|
-
|
|
750
|
-
// Note: Manual scheduling removed - handled by Smart Schedule button in Calendar
|
|
751
|
-
|
|
752
|
-
// Handlers for duration inputs
|
|
753
|
-
const handleDurationHoursChange = useCallback(
|
|
754
|
-
(hours: number) => {
|
|
755
|
-
const clampedHours = Math.max(0, hours);
|
|
756
|
-
const totalHours = (clampedHours * 60 + durationMinutes) / 60;
|
|
757
|
-
onTotalDurationChange(totalHours > 0 ? totalHours : null);
|
|
758
|
-
},
|
|
759
|
-
[durationMinutes, onTotalDurationChange]
|
|
760
|
-
);
|
|
761
|
-
|
|
762
|
-
const handleDurationMinutesChange = useCallback(
|
|
763
|
-
(minutes: number, direction?: 'increment' | 'decrement') => {
|
|
764
|
-
let newHours = durationHours;
|
|
765
|
-
let newMinutes = minutes;
|
|
766
|
-
|
|
767
|
-
// Handle rollover for increment/decrement
|
|
768
|
-
if (direction === 'increment' && minutes > 45) {
|
|
769
|
-
newMinutes = 0;
|
|
770
|
-
newHours = durationHours + 1;
|
|
771
|
-
} else if (direction === 'decrement' && minutes < 0) {
|
|
772
|
-
if (durationHours > 0) {
|
|
773
|
-
newMinutes = 45;
|
|
774
|
-
newHours = durationHours - 1;
|
|
775
|
-
} else {
|
|
776
|
-
newMinutes = 0;
|
|
777
|
-
}
|
|
778
|
-
} else {
|
|
779
|
-
// For direct input, snap to nearest 15-minute interval
|
|
780
|
-
newMinutes = Math.round(minutes / 15) * 15;
|
|
781
|
-
if (newMinutes >= 60) {
|
|
782
|
-
newMinutes = 0;
|
|
783
|
-
newHours = durationHours + 1;
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
const totalHours = (newHours * 60 + newMinutes) / 60;
|
|
788
|
-
onTotalDurationChange(totalHours > 0 ? totalHours : null);
|
|
789
|
-
},
|
|
790
|
-
[durationHours, onTotalDurationChange]
|
|
791
|
-
);
|
|
792
|
-
|
|
793
|
-
const handleSplittableChange = useCallback(
|
|
794
|
-
(checked: boolean) => {
|
|
795
|
-
onIsSplittableChange(checked);
|
|
796
|
-
// Set defaults when enabling
|
|
797
|
-
if (checked) {
|
|
798
|
-
if (minSplitDurationMinutes === null) {
|
|
799
|
-
onMinSplitDurationChange(30);
|
|
800
|
-
}
|
|
801
|
-
if (maxSplitDurationMinutes === null) {
|
|
802
|
-
onMaxSplitDurationChange(120);
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
},
|
|
806
|
-
[
|
|
807
|
-
minSplitDurationMinutes,
|
|
808
|
-
maxSplitDurationMinutes,
|
|
809
|
-
onIsSplittableChange,
|
|
810
|
-
onMinSplitDurationChange,
|
|
811
|
-
onMaxSplitDurationChange,
|
|
812
|
-
]
|
|
813
|
-
);
|
|
814
|
-
|
|
815
|
-
const estimationIndices: number[] = useMemo(() => {
|
|
816
|
-
return boardConfig?.estimation_type
|
|
817
|
-
? buildEstimationIndices({
|
|
818
|
-
extended: boardConfig?.extended_estimation,
|
|
819
|
-
allowZero: boardConfig?.allow_zero_estimates,
|
|
820
|
-
})
|
|
821
|
-
: [];
|
|
822
|
-
}, [
|
|
823
|
-
boardConfig?.estimation_type,
|
|
824
|
-
boardConfig?.extended_estimation,
|
|
825
|
-
boardConfig?.allow_zero_estimates,
|
|
826
|
-
]);
|
|
827
|
-
|
|
828
|
-
const handleEndDateChange = useCallback(
|
|
829
|
-
(date: Date | undefined) => {
|
|
830
|
-
if (date) {
|
|
831
|
-
let selectedDate = dayjs(date);
|
|
832
|
-
if (
|
|
833
|
-
selectedDate.hour() === 0 &&
|
|
834
|
-
selectedDate.minute() === 0 &&
|
|
835
|
-
selectedDate.second() === 0 &&
|
|
836
|
-
selectedDate.millisecond() === 0
|
|
837
|
-
) {
|
|
838
|
-
selectedDate = selectedDate.endOf('day');
|
|
839
|
-
}
|
|
840
|
-
// If both start and end dates are empty, set start date to start of today
|
|
841
|
-
if (!startDate && !endDate) {
|
|
842
|
-
onStartDateChange(dayjs().startOf('day').toDate());
|
|
843
|
-
}
|
|
844
|
-
onEndDateChange(selectedDate.toDate());
|
|
845
|
-
} else {
|
|
846
|
-
onEndDateChange(undefined);
|
|
847
|
-
}
|
|
848
|
-
},
|
|
849
|
-
[startDate, endDate, onStartDateChange, onEndDateChange]
|
|
850
|
-
);
|
|
851
|
-
|
|
852
|
-
// Wrapper for quick due date that also sets start date if both are empty
|
|
853
|
-
const handleQuickDueDate = useCallback(
|
|
854
|
-
(days: number | null) => {
|
|
855
|
-
// If both start and end dates are empty, set start date to start of today
|
|
856
|
-
if (!startDate && !endDate && days !== null) {
|
|
857
|
-
onStartDateChange(dayjs().startOf('day').toDate());
|
|
858
|
-
}
|
|
859
|
-
onQuickDueDate(days);
|
|
860
|
-
},
|
|
861
|
-
[startDate, endDate, onStartDateChange, onQuickDueDate]
|
|
862
|
-
);
|
|
863
|
-
|
|
864
|
-
return (
|
|
865
|
-
<div className={cn(!isCompact && 'border-y bg-muted/30')}>
|
|
866
|
-
{/* Header with toggle button */}
|
|
867
|
-
{!isCompact && (
|
|
868
|
-
<button
|
|
869
|
-
type="button"
|
|
870
|
-
onClick={() => setIsMetadataExpanded(!isMetadataExpanded)}
|
|
871
|
-
className="flex w-full items-center justify-between px-4 py-2.5 text-left transition-colors hover:bg-muted/50 md:px-8"
|
|
872
|
-
>
|
|
873
|
-
<div className="flex min-w-0 flex-1 items-center gap-2">
|
|
874
|
-
<ChevronDown
|
|
875
|
-
className={cn(
|
|
876
|
-
'h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200',
|
|
877
|
-
!isMetadataExpanded && '-rotate-90'
|
|
878
|
-
)}
|
|
879
|
-
/>
|
|
880
|
-
<span className="shrink-0 font-semibold text-foreground text-sm">
|
|
881
|
-
{t('ws-task-boards.dialog.properties')}
|
|
882
|
-
</span>
|
|
883
|
-
|
|
884
|
-
{/* Summary badges when collapsed */}
|
|
885
|
-
{!isMetadataExpanded && (
|
|
886
|
-
<div className="scrollbar-hide ml-2 flex min-w-0 flex-1 items-center gap-1.5 overflow-x-auto">
|
|
887
|
-
{priority && (
|
|
888
|
-
<Badge
|
|
889
|
-
variant="secondary"
|
|
890
|
-
className={cn(
|
|
891
|
-
'h-5 shrink-0 gap-1 border px-2 font-medium text-[10px]',
|
|
892
|
-
PRIORITY_BADGE_COLORS[priority]
|
|
893
|
-
)}
|
|
894
|
-
>
|
|
895
|
-
{getPriorityIcon(priority, 'h-2.5 w-2.5')}
|
|
896
|
-
{t(`tasks.priority_${priority}`)}
|
|
897
|
-
</Badge>
|
|
898
|
-
)}
|
|
899
|
-
{selectedListId && (
|
|
900
|
-
<Badge
|
|
901
|
-
variant="secondary"
|
|
902
|
-
className={cn(
|
|
903
|
-
'h-5 shrink-0 gap-1 border px-2 font-medium text-[10px]',
|
|
904
|
-
listSummarySurfaceClass ??
|
|
905
|
-
'border-border bg-muted/50 text-muted-foreground'
|
|
906
|
-
)}
|
|
907
|
-
>
|
|
908
|
-
<ListSummaryTriggerIcon className="h-2.5 w-2.5" />
|
|
909
|
-
{selectedListForSummary
|
|
910
|
-
? translateTaskListNameForDisplay(
|
|
911
|
-
selectedListForSummary.name,
|
|
912
|
-
listNameLabels
|
|
913
|
-
)
|
|
914
|
-
: t('ws-task-boards.dialog.field.list')}
|
|
915
|
-
</Badge>
|
|
916
|
-
)}
|
|
917
|
-
{(startDate || endDate) && (
|
|
918
|
-
<Badge
|
|
919
|
-
variant="secondary"
|
|
920
|
-
className="h-5 shrink-0 gap-1 border border-dynamic-orange/30 bg-dynamic-orange/15 px-2 font-medium text-[10px] text-dynamic-orange"
|
|
921
|
-
>
|
|
922
|
-
<Calendar className="h-2.5 w-2.5" />
|
|
923
|
-
{startDate || endDate
|
|
924
|
-
? `${startDate ? new Date(startDate).toLocaleDateString(t('common.locale', { defaultValue: 'en-US' }), { month: 'short', day: 'numeric' }) : t('ws-task-boards.dialog.field.start_date')} → ${endDate ? new Date(endDate).toLocaleDateString(t('common.locale', { defaultValue: 'en-US' }), { month: 'short', day: 'numeric' }) : t('ws-task-boards.dialog.field.end_date')}`
|
|
925
|
-
: t('ws-task-boards.dialog.field.end_date')}
|
|
926
|
-
</Badge>
|
|
927
|
-
)}
|
|
928
|
-
{estimationPoints != null && (
|
|
929
|
-
<Badge
|
|
930
|
-
variant="secondary"
|
|
931
|
-
className="h-5 shrink-0 gap-1 border border-dynamic-purple/30 bg-dynamic-purple/15 px-2 font-medium text-[10px] text-dynamic-purple"
|
|
932
|
-
>
|
|
933
|
-
<Timer className="h-2.5 w-2.5" />
|
|
934
|
-
{boardConfig?.estimation_type
|
|
935
|
-
? mapEstimationPoints(
|
|
936
|
-
estimationPoints,
|
|
937
|
-
boardConfig.estimation_type
|
|
938
|
-
)
|
|
939
|
-
: t('ws-task-boards.dialog.field.estimation')}
|
|
940
|
-
</Badge>
|
|
941
|
-
)}
|
|
942
|
-
{selectedLabels.length > 0 && (
|
|
943
|
-
<Badge
|
|
944
|
-
variant="secondary"
|
|
945
|
-
className="h-5 shrink-0 gap-1 border border-dynamic-indigo/30 bg-dynamic-indigo/15 px-2 font-medium text-[10px] text-dynamic-indigo"
|
|
946
|
-
>
|
|
947
|
-
<Tag className="h-2.5 w-2.5" />
|
|
948
|
-
{selectedLabels.length === 1
|
|
949
|
-
? selectedLabels[0]?.name
|
|
950
|
-
: t('common.n_labels', { count: selectedLabels.length })}
|
|
951
|
-
</Badge>
|
|
952
|
-
)}
|
|
953
|
-
{selectedProjects.length > 0 && (
|
|
954
|
-
<Badge
|
|
955
|
-
variant="secondary"
|
|
956
|
-
className="h-5 shrink-0 gap-1 border border-dynamic-sky/30 bg-dynamic-sky/15 px-2 font-medium text-[10px] text-dynamic-sky"
|
|
957
|
-
>
|
|
958
|
-
<Box className="h-2.5 w-2.5" />
|
|
959
|
-
{selectedProjects.length === 1
|
|
960
|
-
? selectedProjects[0]?.name
|
|
961
|
-
: t('common.n_projects', {
|
|
962
|
-
count: selectedProjects.length,
|
|
963
|
-
})}
|
|
964
|
-
</Badge>
|
|
965
|
-
)}
|
|
966
|
-
{selectedAssignees.length > 0 && canUseBoardAssignees && (
|
|
967
|
-
<Badge
|
|
968
|
-
variant="secondary"
|
|
969
|
-
className="h-5 shrink-0 gap-1 border border-dynamic-cyan/30 bg-dynamic-cyan/15 px-2 font-medium text-[10px] text-dynamic-cyan"
|
|
970
|
-
>
|
|
971
|
-
<Users className="h-2.5 w-2.5" />
|
|
972
|
-
{selectedAssignees.length === 1
|
|
973
|
-
? selectedAssignees[0]?.display_name ||
|
|
974
|
-
t('ws-task-boards.dialog.unknown_user')
|
|
975
|
-
: t('common.n_assignees', {
|
|
976
|
-
count: selectedAssignees.length,
|
|
977
|
-
})}
|
|
978
|
-
</Badge>
|
|
979
|
-
)}
|
|
980
|
-
{totalMinutes > 0 && (
|
|
981
|
-
<Badge
|
|
982
|
-
variant="secondary"
|
|
983
|
-
className={cn(
|
|
984
|
-
'h-5 shrink-0 gap-1 border px-2 font-medium text-[10px]',
|
|
985
|
-
!disabled && hasUnsavedSchedulingChanges
|
|
986
|
-
? 'border-dynamic-yellow/50 border-dashed bg-dynamic-yellow/15 text-dynamic-yellow'
|
|
987
|
-
: 'border-dynamic-teal/30 bg-dynamic-teal/15 text-dynamic-teal'
|
|
988
|
-
)}
|
|
989
|
-
>
|
|
990
|
-
{!disabled && hasUnsavedSchedulingChanges ? (
|
|
991
|
-
<AlertCircle className="h-2.5 w-2.5" />
|
|
992
|
-
) : (
|
|
993
|
-
<CalendarClock className="h-2.5 w-2.5" />
|
|
994
|
-
)}
|
|
995
|
-
{formatDuration(totalMinutes, t)}
|
|
996
|
-
{!disabled && hasUnsavedSchedulingChanges && (
|
|
997
|
-
<span className="text-[8px] opacity-75">
|
|
998
|
-
{t('ws-task-boards.dialog.unsaved')}
|
|
999
|
-
</span>
|
|
1000
|
-
)}
|
|
1001
|
-
</Badge>
|
|
1002
|
-
)}
|
|
1003
|
-
</div>
|
|
1004
|
-
)}
|
|
1005
|
-
</div>
|
|
1006
|
-
</button>
|
|
1007
|
-
)}
|
|
1008
|
-
|
|
1009
|
-
{/* Expandable badges section */}
|
|
1010
|
-
{(isCompact || isMetadataExpanded) && (
|
|
1011
|
-
<div
|
|
1012
|
-
className={cn(isCompact ? 'px-0 py-0' : 'border-t px-4 py-3 md:px-8')}
|
|
1013
|
-
>
|
|
1014
|
-
<div
|
|
1015
|
-
className={cn(
|
|
1016
|
-
'flex flex-wrap items-center',
|
|
1017
|
-
isCompact ? 'gap-1.5' : 'gap-2'
|
|
1018
|
-
)}
|
|
1019
|
-
>
|
|
1020
|
-
{/* Priority Badge */}
|
|
1021
|
-
<Popover
|
|
1022
|
-
open={isPopoverOpen('priority')}
|
|
1023
|
-
onOpenChange={(open) => setPopoverOpen('priority', open)}
|
|
1024
|
-
>
|
|
1025
|
-
<TaskPropertyPopoverTrigger
|
|
1026
|
-
compact={isCompact}
|
|
1027
|
-
label={
|
|
1028
|
-
priority
|
|
1029
|
-
? t(`tasks.priority_${priority}`)
|
|
1030
|
-
: t('common.priority')
|
|
1031
|
-
}
|
|
1032
|
-
popoverId="priority"
|
|
1033
|
-
>
|
|
1034
|
-
<button
|
|
1035
|
-
type="button"
|
|
1036
|
-
disabled={disabled}
|
|
1037
|
-
aria-label={
|
|
1038
|
-
priority
|
|
1039
|
-
? t(`tasks.priority_${priority}`)
|
|
1040
|
-
: t('common.priority')
|
|
1041
|
-
}
|
|
1042
|
-
className={cn(
|
|
1043
|
-
triggerBaseClass,
|
|
1044
|
-
priority
|
|
1045
|
-
? PRIORITY_BADGE_COLORS[priority]
|
|
1046
|
-
: 'border-input bg-background text-foreground hover:bg-muted',
|
|
1047
|
-
disabled && 'cursor-not-allowed opacity-50'
|
|
1048
|
-
)}
|
|
1049
|
-
>
|
|
1050
|
-
{priority ? (
|
|
1051
|
-
getPriorityIcon(priority, 'h-3.5 w-3.5')
|
|
1052
|
-
) : (
|
|
1053
|
-
<Flag className="h-3.5 w-3.5" />
|
|
1054
|
-
)}
|
|
1055
|
-
<span className={compactLabelClass}>
|
|
1056
|
-
{priority
|
|
1057
|
-
? t(`tasks.priority_${priority}`)
|
|
1058
|
-
: t('common.priority')}
|
|
1059
|
-
</span>
|
|
1060
|
-
</button>
|
|
1061
|
-
</TaskPropertyPopoverTrigger>
|
|
1062
|
-
<PopoverContent
|
|
1063
|
-
align="start"
|
|
1064
|
-
className="w-56 p-0"
|
|
1065
|
-
{...propertyPopoverContentProps}
|
|
1066
|
-
>
|
|
1067
|
-
<div className="p-1">
|
|
1068
|
-
{[
|
|
1069
|
-
{
|
|
1070
|
-
value: 'critical',
|
|
1071
|
-
label: t('tasks.priority_critical'),
|
|
1072
|
-
color: 'text-dynamic-red',
|
|
1073
|
-
},
|
|
1074
|
-
{
|
|
1075
|
-
value: 'high',
|
|
1076
|
-
label: t('tasks.priority_high'),
|
|
1077
|
-
color: 'text-dynamic-orange',
|
|
1078
|
-
},
|
|
1079
|
-
{
|
|
1080
|
-
value: 'normal',
|
|
1081
|
-
label: t('tasks.priority_normal'),
|
|
1082
|
-
color: 'text-dynamic-yellow',
|
|
1083
|
-
},
|
|
1084
|
-
{
|
|
1085
|
-
value: 'low',
|
|
1086
|
-
label: t('tasks.priority_low'),
|
|
1087
|
-
color: 'text-dynamic-blue',
|
|
1088
|
-
},
|
|
1089
|
-
].map((opt) => (
|
|
1090
|
-
<button
|
|
1091
|
-
key={opt.value}
|
|
1092
|
-
type="button"
|
|
1093
|
-
onClick={() => {
|
|
1094
|
-
onPriorityChange(opt.value as TaskPriority);
|
|
1095
|
-
setPopoverOpen('priority', false);
|
|
1096
|
-
}}
|
|
1097
|
-
className={cn(
|
|
1098
|
-
'flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-muted',
|
|
1099
|
-
priority === opt.value && 'bg-muted font-medium'
|
|
1100
|
-
)}
|
|
1101
|
-
>
|
|
1102
|
-
{getPriorityIcon(
|
|
1103
|
-
opt.value as TaskPriority,
|
|
1104
|
-
cn('h-4 w-4', opt.color)
|
|
1105
|
-
)}
|
|
1106
|
-
<span className="flex-1">{opt.label}</span>
|
|
1107
|
-
{priority === opt.value && (
|
|
1108
|
-
<Check className="h-4 w-4 shrink-0 text-primary" />
|
|
1109
|
-
)}
|
|
1110
|
-
</button>
|
|
1111
|
-
))}
|
|
1112
|
-
{priority && (
|
|
1113
|
-
<ClearMenuItem
|
|
1114
|
-
label={t('ws-task-boards.dialog.clear_priority')}
|
|
1115
|
-
onClick={() => {
|
|
1116
|
-
onPriorityChange(null);
|
|
1117
|
-
setPopoverOpen('priority', false);
|
|
1118
|
-
}}
|
|
1119
|
-
/>
|
|
1120
|
-
)}
|
|
1121
|
-
</div>
|
|
1122
|
-
</PopoverContent>
|
|
1123
|
-
</Popover>
|
|
1124
|
-
|
|
1125
|
-
<TaskListSelector
|
|
1126
|
-
wsId={wsId}
|
|
1127
|
-
boardId={boardId}
|
|
1128
|
-
selectedListId={selectedListId}
|
|
1129
|
-
availableLists={availableLists}
|
|
1130
|
-
disabled={disabled}
|
|
1131
|
-
compact={isCompact}
|
|
1132
|
-
open={isPopoverOpen('list')}
|
|
1133
|
-
onOpenChange={(open) => setPopoverOpen('list', open)}
|
|
1134
|
-
onPopoverCloseAutoFocus={handlePropertyPopoverCloseAutoFocus}
|
|
1135
|
-
onPopoverInteractOutside={handlePropertyPopoverInteractOutside}
|
|
1136
|
-
onListChange={onListChange}
|
|
1137
|
-
propertyPopoverId="list"
|
|
1138
|
-
/>
|
|
1139
|
-
|
|
1140
|
-
{/* Dates Badge */}
|
|
1141
|
-
<Popover
|
|
1142
|
-
open={isPopoverOpen('dates')}
|
|
1143
|
-
onOpenChange={(open) => setPopoverOpen('dates', open)}
|
|
1144
|
-
>
|
|
1145
|
-
<TaskPropertyPopoverTrigger
|
|
1146
|
-
compact={isCompact}
|
|
1147
|
-
label={
|
|
1148
|
-
startDate || endDate
|
|
1149
|
-
? `${startDate ? new Date(startDate).toLocaleDateString(t('common.locale', { defaultValue: 'en-US' }), { month: 'short', day: 'numeric' }) : t('ws-task-boards.dialog.no_start_date')} → ${endDate ? new Date(endDate).toLocaleDateString(t('common.locale', { defaultValue: 'en-US' }), { month: 'short', day: 'numeric' }) : t('ws-task-boards.dialog.no_due_date')}`
|
|
1150
|
-
: t('ws-task-boards.dialog.dates')
|
|
1151
|
-
}
|
|
1152
|
-
popoverId="dates"
|
|
1153
|
-
>
|
|
1154
|
-
<button
|
|
1155
|
-
type="button"
|
|
1156
|
-
disabled={disabled}
|
|
1157
|
-
aria-label={t('ws-task-boards.dialog.dates')}
|
|
1158
|
-
className={cn(
|
|
1159
|
-
triggerBaseClass,
|
|
1160
|
-
startDate || endDate
|
|
1161
|
-
? 'border-dynamic-orange/30 bg-dynamic-orange/15 text-dynamic-orange hover:border-dynamic-orange/50 hover:bg-dynamic-orange/20'
|
|
1162
|
-
: 'border-border bg-background text-muted-foreground hover:border-primary/30 hover:bg-muted hover:text-foreground',
|
|
1163
|
-
disabled && 'cursor-not-allowed opacity-50'
|
|
1164
|
-
)}
|
|
1165
|
-
>
|
|
1166
|
-
<Calendar className="h-3.5 w-3.5" />
|
|
1167
|
-
<span className={compactLabelClass}>
|
|
1168
|
-
{startDate || endDate
|
|
1169
|
-
? `${startDate ? new Date(startDate).toLocaleDateString(t('common.locale', { defaultValue: 'en-US' }), { month: 'short', day: 'numeric' }) : t('ws-task-boards.dialog.no_start_date')} → ${endDate ? new Date(endDate).toLocaleDateString(t('common.locale', { defaultValue: 'en-US' }), { month: 'short', day: 'numeric' }) : t('ws-task-boards.dialog.no_due_date')}`
|
|
1170
|
-
: t('ws-task-boards.dialog.dates')}
|
|
1171
|
-
</span>
|
|
1172
|
-
</button>
|
|
1173
|
-
</TaskPropertyPopoverTrigger>
|
|
1174
|
-
<PopoverContent
|
|
1175
|
-
align="start"
|
|
1176
|
-
className="w-80 p-0"
|
|
1177
|
-
{...propertyPopoverContentProps}
|
|
1178
|
-
>
|
|
1179
|
-
<div className="rounded-lg p-3.5">
|
|
1180
|
-
<div className="space-y-3">
|
|
1181
|
-
{/* Start Date */}
|
|
1182
|
-
<div className="space-y-1.5">
|
|
1183
|
-
<Label className="font-normal text-muted-foreground text-xs">
|
|
1184
|
-
{t('ws-task-boards.dialog.start_date')}
|
|
1185
|
-
</Label>
|
|
1186
|
-
<DateTimePicker
|
|
1187
|
-
date={startDate}
|
|
1188
|
-
setDate={onStartDateChange}
|
|
1189
|
-
showTimeSelect={true}
|
|
1190
|
-
allowClear={true}
|
|
1191
|
-
showFooterControls={true}
|
|
1192
|
-
maxDate={endDate}
|
|
1193
|
-
preferences={{ weekStartsOn, timezone, timeFormat }}
|
|
1194
|
-
/>
|
|
1195
|
-
</div>
|
|
1196
|
-
|
|
1197
|
-
{/* Due Date */}
|
|
1198
|
-
<div className="space-y-1.5">
|
|
1199
|
-
<Label className="font-normal text-muted-foreground text-xs">
|
|
1200
|
-
{t('ws-task-boards.dialog.due_date')}
|
|
1201
|
-
</Label>
|
|
1202
|
-
<DateTimePicker
|
|
1203
|
-
date={endDate}
|
|
1204
|
-
setDate={handleEndDateChange}
|
|
1205
|
-
showTimeSelect={true}
|
|
1206
|
-
allowClear={true}
|
|
1207
|
-
showFooterControls={true}
|
|
1208
|
-
minDate={startDate}
|
|
1209
|
-
preferences={{ weekStartsOn, timezone, timeFormat }}
|
|
1210
|
-
/>
|
|
1211
|
-
|
|
1212
|
-
{/* Date Range Warning */}
|
|
1213
|
-
{startDate && endDate && startDate > endDate && (
|
|
1214
|
-
<div className="flex items-center gap-2 rounded-md border border-dynamic-orange/30 bg-dynamic-orange/10 px-3 py-2 text-xs">
|
|
1215
|
-
<AlertTriangle className="h-3.5 w-3.5 shrink-0 text-dynamic-orange" />
|
|
1216
|
-
<span className="text-dynamic-orange">
|
|
1217
|
-
{t(
|
|
1218
|
-
'ws-task-boards.dialog.start_date_after_due_date'
|
|
1219
|
-
)}
|
|
1220
|
-
</span>
|
|
1221
|
-
</div>
|
|
1222
|
-
)}
|
|
1223
|
-
|
|
1224
|
-
{/* Quick Due Date Actions */}
|
|
1225
|
-
<div className="space-y-1.5 pt-2">
|
|
1226
|
-
<Label className="font-normal text-muted-foreground text-xs">
|
|
1227
|
-
{t('ws-task-boards.dialog.quick_actions')}
|
|
1228
|
-
</Label>
|
|
1229
|
-
<div className="grid grid-cols-2 gap-1.5 md:gap-2">
|
|
1230
|
-
<Button
|
|
1231
|
-
type="button"
|
|
1232
|
-
variant="outline"
|
|
1233
|
-
size="xs"
|
|
1234
|
-
onClick={() => handleQuickDueDate(0)}
|
|
1235
|
-
disabled={isLoading}
|
|
1236
|
-
className="h-7 text-[11px] transition-all hover:border-dynamic-orange/50 hover:bg-dynamic-orange/5 md:text-xs"
|
|
1237
|
-
>
|
|
1238
|
-
{t('common.today')}
|
|
1239
|
-
</Button>
|
|
1240
|
-
<Button
|
|
1241
|
-
type="button"
|
|
1242
|
-
variant="outline"
|
|
1243
|
-
size="xs"
|
|
1244
|
-
onClick={() => handleQuickDueDate(1)}
|
|
1245
|
-
disabled={isLoading}
|
|
1246
|
-
className="h-7 text-[11px] transition-all hover:border-dynamic-orange/50 hover:bg-dynamic-orange/5 md:text-xs"
|
|
1247
|
-
>
|
|
1248
|
-
{t('common.tomorrow')}
|
|
1249
|
-
</Button>
|
|
1250
|
-
<Button
|
|
1251
|
-
type="button"
|
|
1252
|
-
variant="outline"
|
|
1253
|
-
size="xs"
|
|
1254
|
-
onClick={() => {
|
|
1255
|
-
// Calculate days until end of week (respects first day of week setting)
|
|
1256
|
-
const endOfWeekDay =
|
|
1257
|
-
((weekStartsOn ?? 0) - 1 + 7) % 7;
|
|
1258
|
-
const daysUntilEnd =
|
|
1259
|
-
(endOfWeekDay - dayjs().day() + 7) % 7;
|
|
1260
|
-
handleQuickDueDate(daysUntilEnd);
|
|
1261
|
-
}}
|
|
1262
|
-
disabled={isLoading}
|
|
1263
|
-
className="h-7 text-[11px] transition-all hover:border-dynamic-orange/50 hover:bg-dynamic-orange/5 md:text-xs"
|
|
1264
|
-
>
|
|
1265
|
-
{t('common.this_week')}
|
|
1266
|
-
</Button>
|
|
1267
|
-
<Button
|
|
1268
|
-
type="button"
|
|
1269
|
-
variant="outline"
|
|
1270
|
-
size="xs"
|
|
1271
|
-
onClick={() => {
|
|
1272
|
-
// Calculate days until end of next week (respects first day of week setting)
|
|
1273
|
-
const endOfWeekDay =
|
|
1274
|
-
((weekStartsOn ?? 0) - 1 + 7) % 7;
|
|
1275
|
-
const daysUntilEnd =
|
|
1276
|
-
(endOfWeekDay - dayjs().day() + 7) % 7;
|
|
1277
|
-
handleQuickDueDate(daysUntilEnd + 7);
|
|
1278
|
-
}}
|
|
1279
|
-
disabled={isLoading}
|
|
1280
|
-
className="h-7 text-[11px] transition-all hover:border-dynamic-orange/50 hover:bg-dynamic-orange/5 md:text-xs"
|
|
1281
|
-
>
|
|
1282
|
-
{t('common.next_week')}
|
|
1283
|
-
</Button>
|
|
1284
|
-
</div>
|
|
1285
|
-
</div>
|
|
1286
|
-
</div>
|
|
1287
|
-
</div>
|
|
1288
|
-
</div>
|
|
1289
|
-
</PopoverContent>
|
|
1290
|
-
</Popover>
|
|
1291
|
-
|
|
1292
|
-
{/* Estimation Points Badge */}
|
|
1293
|
-
<Popover
|
|
1294
|
-
open={isPopoverOpen('estimation')}
|
|
1295
|
-
onOpenChange={(open) => setPopoverOpen('estimation', open)}
|
|
1296
|
-
>
|
|
1297
|
-
<TaskPropertyPopoverTrigger
|
|
1298
|
-
compact={isCompact}
|
|
1299
|
-
label={
|
|
1300
|
-
boardConfig?.estimation_type && estimationPoints != null
|
|
1301
|
-
? mapEstimationPoints(
|
|
1302
|
-
estimationPoints,
|
|
1303
|
-
boardConfig.estimation_type
|
|
1304
|
-
)
|
|
1305
|
-
: t('ws-task-boards.dialog.estimate')
|
|
1306
|
-
}
|
|
1307
|
-
popoverId="estimation"
|
|
1308
|
-
>
|
|
1309
|
-
<button
|
|
1310
|
-
type="button"
|
|
1311
|
-
disabled={disabled}
|
|
1312
|
-
aria-label={t('ws-task-boards.dialog.estimate')}
|
|
1313
|
-
className={cn(
|
|
1314
|
-
triggerBaseClass,
|
|
1315
|
-
estimationPoints != null
|
|
1316
|
-
? 'border-dynamic-purple/30 bg-dynamic-purple/15 text-dynamic-purple hover:border-dynamic-purple/50 hover:bg-dynamic-purple/20'
|
|
1317
|
-
: 'border-border bg-background text-muted-foreground hover:border-primary/30 hover:bg-muted hover:text-foreground',
|
|
1318
|
-
disabled && 'cursor-not-allowed opacity-50'
|
|
1319
|
-
)}
|
|
1320
|
-
>
|
|
1321
|
-
<Timer className="h-3.5 w-3.5" />
|
|
1322
|
-
<span className={compactLabelClass}>
|
|
1323
|
-
{boardConfig?.estimation_type
|
|
1324
|
-
? estimationPoints != null
|
|
1325
|
-
? mapEstimationPoints(
|
|
1326
|
-
estimationPoints,
|
|
1327
|
-
boardConfig.estimation_type
|
|
1328
|
-
)
|
|
1329
|
-
: t('ws-task-boards.dialog.estimate')
|
|
1330
|
-
: t('ws-task-boards.dialog.estimate')}
|
|
1331
|
-
</span>
|
|
1332
|
-
</button>
|
|
1333
|
-
</TaskPropertyPopoverTrigger>
|
|
1334
|
-
<PopoverContent
|
|
1335
|
-
align="start"
|
|
1336
|
-
className="w-64 p-0"
|
|
1337
|
-
{...propertyPopoverContentProps}
|
|
1338
|
-
>
|
|
1339
|
-
{!boardConfig?.estimation_type ? (
|
|
1340
|
-
<EmptyStateCard
|
|
1341
|
-
title={t('ws-task-boards.dialog.no_estimation_configured')}
|
|
1342
|
-
description={t(
|
|
1343
|
-
'ws-task-boards.dialog.configure_estimation_description'
|
|
1344
|
-
)}
|
|
1345
|
-
actionLabel={t('common.configure')}
|
|
1346
|
-
ActionIcon={Pen}
|
|
1347
|
-
onAction={() => {
|
|
1348
|
-
setPopoverOpen('estimation', false);
|
|
1349
|
-
onShowEstimationConfigDialog();
|
|
1350
|
-
}}
|
|
1351
|
-
/>
|
|
1352
|
-
) : (
|
|
1353
|
-
<div className="p-1">
|
|
1354
|
-
{estimationIndices.map((idx) => (
|
|
1355
|
-
<button
|
|
1356
|
-
key={idx}
|
|
1357
|
-
type="button"
|
|
1358
|
-
onClick={() => {
|
|
1359
|
-
onEstimationChange(idx);
|
|
1360
|
-
setPopoverOpen('estimation', false);
|
|
1361
|
-
}}
|
|
1362
|
-
className={cn(
|
|
1363
|
-
'flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-muted',
|
|
1364
|
-
estimationPoints === idx && 'bg-muted font-medium'
|
|
1365
|
-
)}
|
|
1366
|
-
>
|
|
1367
|
-
<Timer className="h-4 w-4 text-dynamic-purple" />
|
|
1368
|
-
<span className="flex-1">
|
|
1369
|
-
{mapEstimationPoints(
|
|
1370
|
-
idx,
|
|
1371
|
-
boardConfig.estimation_type
|
|
1372
|
-
)}
|
|
1373
|
-
</span>
|
|
1374
|
-
{estimationPoints === idx && (
|
|
1375
|
-
<Check className="h-4 w-4 shrink-0 text-primary" />
|
|
1376
|
-
)}
|
|
1377
|
-
</button>
|
|
1378
|
-
))}
|
|
1379
|
-
{estimationPoints != null && (
|
|
1380
|
-
<ClearMenuItem
|
|
1381
|
-
label={t('ws-task-boards.dialog.clear_estimate')}
|
|
1382
|
-
onClick={() => {
|
|
1383
|
-
onEstimationChange(null);
|
|
1384
|
-
setPopoverOpen('estimation', false);
|
|
1385
|
-
}}
|
|
1386
|
-
/>
|
|
1387
|
-
)}
|
|
1388
|
-
</div>
|
|
1389
|
-
)}
|
|
1390
|
-
</PopoverContent>
|
|
1391
|
-
</Popover>
|
|
1392
|
-
|
|
1393
|
-
{/* Labels Badge */}
|
|
1394
|
-
<Popover
|
|
1395
|
-
open={isPopoverOpen('labels')}
|
|
1396
|
-
onOpenChange={(open) => {
|
|
1397
|
-
setPopoverOpen('labels', open);
|
|
1398
|
-
if (!open) setLabelSearchQuery('');
|
|
1399
|
-
}}
|
|
1400
|
-
>
|
|
1401
|
-
<TaskPropertyPopoverTrigger
|
|
1402
|
-
compact={isCompact}
|
|
1403
|
-
label={
|
|
1404
|
-
selectedLabels.length === 0
|
|
1405
|
-
? t('common.labels')
|
|
1406
|
-
: selectedLabels.length === 1
|
|
1407
|
-
? selectedLabels[0]?.name
|
|
1408
|
-
: t('common.n_labels', {
|
|
1409
|
-
count: selectedLabels.length,
|
|
1410
|
-
})
|
|
1411
|
-
}
|
|
1412
|
-
popoverId="labels"
|
|
1413
|
-
>
|
|
1414
|
-
<button
|
|
1415
|
-
type="button"
|
|
1416
|
-
disabled={disabled}
|
|
1417
|
-
aria-label={t('common.labels')}
|
|
1418
|
-
className={cn(
|
|
1419
|
-
triggerBaseClass,
|
|
1420
|
-
selectedLabels.length > 0
|
|
1421
|
-
? 'border-dynamic-indigo/30 bg-dynamic-indigo/15 text-dynamic-indigo hover:border-dynamic-indigo/50 hover:bg-dynamic-indigo/20'
|
|
1422
|
-
: 'border-border bg-background text-muted-foreground hover:border-primary/30 hover:bg-muted hover:text-foreground',
|
|
1423
|
-
disabled && 'cursor-not-allowed opacity-50'
|
|
1424
|
-
)}
|
|
1425
|
-
>
|
|
1426
|
-
<Tag className="h-3.5 w-3.5" />
|
|
1427
|
-
<span className={compactLabelClass}>
|
|
1428
|
-
{selectedLabels.length === 0
|
|
1429
|
-
? t('common.labels')
|
|
1430
|
-
: selectedLabels.length === 1
|
|
1431
|
-
? selectedLabels[0]?.name
|
|
1432
|
-
: t('common.n_labels', {
|
|
1433
|
-
count: selectedLabels.length,
|
|
1434
|
-
})}
|
|
1435
|
-
</span>
|
|
1436
|
-
</button>
|
|
1437
|
-
</TaskPropertyPopoverTrigger>
|
|
1438
|
-
<PopoverContent
|
|
1439
|
-
align="start"
|
|
1440
|
-
className="w-72 p-0"
|
|
1441
|
-
{...propertyPopoverContentProps}
|
|
1442
|
-
>
|
|
1443
|
-
{availableLabels.length === 0 ? (
|
|
1444
|
-
<EmptyStateCard
|
|
1445
|
-
title={t('ws-task-boards.dialog.no_labels_configured')}
|
|
1446
|
-
description={t(
|
|
1447
|
-
'ws-task-boards.dialog.create_labels_description'
|
|
1448
|
-
)}
|
|
1449
|
-
actionLabel={t('ws-task-boards.dialog.create_label')}
|
|
1450
|
-
ActionIcon={Plus}
|
|
1451
|
-
onAction={() => {
|
|
1452
|
-
setPopoverOpen('labels', false);
|
|
1453
|
-
onShowNewLabelDialog();
|
|
1454
|
-
}}
|
|
1455
|
-
/>
|
|
1456
|
-
) : (
|
|
1457
|
-
<>
|
|
1458
|
-
{selectedLabels.length > 0 && (
|
|
1459
|
-
<div className="border-b p-2">
|
|
1460
|
-
<div className="flex flex-wrap gap-1.5">
|
|
1461
|
-
{selectedLabels.map((label) => {
|
|
1462
|
-
const styles = computeAccessibleLabelStyles(
|
|
1463
|
-
label.color
|
|
1464
|
-
);
|
|
1465
|
-
return (
|
|
1466
|
-
<Badge
|
|
1467
|
-
key={label.id}
|
|
1468
|
-
variant="secondary"
|
|
1469
|
-
className={cn(
|
|
1470
|
-
'h-6 cursor-pointer gap-1 px-2 text-xs transition-opacity hover:opacity-80',
|
|
1471
|
-
disabled && 'pointer-events-none'
|
|
1472
|
-
)}
|
|
1473
|
-
style={
|
|
1474
|
-
styles
|
|
1475
|
-
? {
|
|
1476
|
-
backgroundColor: styles.bg,
|
|
1477
|
-
borderColor: styles.border,
|
|
1478
|
-
color: styles.text,
|
|
1479
|
-
}
|
|
1480
|
-
: undefined
|
|
1481
|
-
}
|
|
1482
|
-
onClick={() =>
|
|
1483
|
-
!disabled && onLabelToggle(label)
|
|
1484
|
-
}
|
|
1485
|
-
>
|
|
1486
|
-
{label.name}
|
|
1487
|
-
{!disabled && <X className="h-2.5 w-2.5" />}
|
|
1488
|
-
</Badge>
|
|
1489
|
-
);
|
|
1490
|
-
})}
|
|
1491
|
-
</div>
|
|
1492
|
-
</div>
|
|
1493
|
-
)}
|
|
1494
|
-
<TaskResourceSearchField
|
|
1495
|
-
value={labelSearchQuery}
|
|
1496
|
-
onChange={setLabelSearchQuery}
|
|
1497
|
-
placeholder={t('common.search_labels')}
|
|
1498
|
-
/>
|
|
1499
|
-
<div
|
|
1500
|
-
className="max-h-60 overflow-y-auto overscroll-contain"
|
|
1501
|
-
onWheel={(e) => e.stopPropagation()}
|
|
1502
|
-
>
|
|
1503
|
-
<div className="p-1">
|
|
1504
|
-
{labelSearchQuery &&
|
|
1505
|
-
unselectedAvailableLabels.length > 0 &&
|
|
1506
|
-
filteredUnselectedLabels.length === 0 ? (
|
|
1507
|
-
<div className="px-2 py-4 text-center text-muted-foreground text-xs">
|
|
1508
|
-
{t('common.no_labels_found')}
|
|
1509
|
-
</div>
|
|
1510
|
-
) : (
|
|
1511
|
-
filteredUnselectedLabels.map((label) => (
|
|
1512
|
-
<button
|
|
1513
|
-
key={label.id}
|
|
1514
|
-
type="button"
|
|
1515
|
-
onClick={() => onLabelToggle(label)}
|
|
1516
|
-
className="flex w-full items-center rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted"
|
|
1517
|
-
>
|
|
1518
|
-
<LabelChip
|
|
1519
|
-
label={label}
|
|
1520
|
-
showIcon={false}
|
|
1521
|
-
className="h-6 px-2 text-xs"
|
|
1522
|
-
/>
|
|
1523
|
-
</button>
|
|
1524
|
-
))
|
|
1525
|
-
)}
|
|
1526
|
-
</div>
|
|
1527
|
-
</div>
|
|
1528
|
-
<div className="border-t p-2">
|
|
1529
|
-
<Button
|
|
1530
|
-
size="sm"
|
|
1531
|
-
variant="ghost"
|
|
1532
|
-
onClick={() => {
|
|
1533
|
-
setPopoverOpen('labels', false);
|
|
1534
|
-
onShowNewLabelDialog();
|
|
1535
|
-
}}
|
|
1536
|
-
className="h-8 w-full justify-start"
|
|
1537
|
-
>
|
|
1538
|
-
<Plus className="mr-1.5 h-3.5 w-3.5" />
|
|
1539
|
-
{t('ws-task-boards.dialog.create_new_label')}
|
|
1540
|
-
</Button>
|
|
1541
|
-
</div>
|
|
1542
|
-
</>
|
|
1543
|
-
)}
|
|
1544
|
-
</PopoverContent>
|
|
1545
|
-
</Popover>
|
|
1546
|
-
|
|
1547
|
-
{/* Projects Badge — not available for drafts */}
|
|
1548
|
-
{!isDraftMode && (
|
|
1549
|
-
<Popover
|
|
1550
|
-
open={isPopoverOpen('projects')}
|
|
1551
|
-
onOpenChange={(open) => {
|
|
1552
|
-
setPopoverOpen('projects', open);
|
|
1553
|
-
if (!open) setProjectSearchQuery('');
|
|
1554
|
-
}}
|
|
1555
|
-
>
|
|
1556
|
-
<TaskPropertyPopoverTrigger
|
|
1557
|
-
compact={isCompact}
|
|
1558
|
-
label={
|
|
1559
|
-
selectedProjects.length === 0
|
|
1560
|
-
? t('common.projects')
|
|
1561
|
-
: selectedProjects.length === 1
|
|
1562
|
-
? selectedProjects[0]?.name
|
|
1563
|
-
: t('common.n_projects', {
|
|
1564
|
-
count: selectedProjects.length,
|
|
1565
|
-
})
|
|
1566
|
-
}
|
|
1567
|
-
popoverId="projects"
|
|
1568
|
-
>
|
|
1569
|
-
<button
|
|
1570
|
-
type="button"
|
|
1571
|
-
disabled={disabled}
|
|
1572
|
-
aria-label={t('common.projects')}
|
|
1573
|
-
className={cn(
|
|
1574
|
-
triggerBaseClass,
|
|
1575
|
-
selectedProjects.length > 0
|
|
1576
|
-
? 'border-dynamic-sky/30 bg-dynamic-sky/15 text-dynamic-sky hover:border-dynamic-sky/50 hover:bg-dynamic-sky/20'
|
|
1577
|
-
: 'border-border bg-background text-muted-foreground hover:border-primary/30 hover:bg-muted hover:text-foreground',
|
|
1578
|
-
disabled && 'cursor-not-allowed opacity-50'
|
|
1579
|
-
)}
|
|
1580
|
-
>
|
|
1581
|
-
<Box className="h-3.5 w-3.5" />
|
|
1582
|
-
<span className={compactLabelClass}>
|
|
1583
|
-
{selectedProjects.length === 0
|
|
1584
|
-
? t('common.projects')
|
|
1585
|
-
: selectedProjects.length === 1
|
|
1586
|
-
? selectedProjects[0]?.name
|
|
1587
|
-
: t('common.n_projects', {
|
|
1588
|
-
count: selectedProjects.length,
|
|
1589
|
-
})}
|
|
1590
|
-
</span>
|
|
1591
|
-
</button>
|
|
1592
|
-
</TaskPropertyPopoverTrigger>
|
|
1593
|
-
<PopoverContent
|
|
1594
|
-
align="start"
|
|
1595
|
-
className="w-72 p-0"
|
|
1596
|
-
{...propertyPopoverContentProps}
|
|
1597
|
-
>
|
|
1598
|
-
{taskProjects.length === 0 ? (
|
|
1599
|
-
<EmptyStateCard
|
|
1600
|
-
title={t('ws-task-boards.dialog.no_projects_configured')}
|
|
1601
|
-
description={t(
|
|
1602
|
-
'ws-task-boards.dialog.create_projects_description'
|
|
1603
|
-
)}
|
|
1604
|
-
actionLabel={t('ws-task-boards.dialog.create_project')}
|
|
1605
|
-
ActionIcon={Plus}
|
|
1606
|
-
onAction={() => {
|
|
1607
|
-
setPopoverOpen('projects', false);
|
|
1608
|
-
onShowNewProjectDialog();
|
|
1609
|
-
}}
|
|
1610
|
-
/>
|
|
1611
|
-
) : (
|
|
1612
|
-
<>
|
|
1613
|
-
{selectedProjects.length > 0 && (
|
|
1614
|
-
<div className="border-b p-2">
|
|
1615
|
-
<div className="flex flex-wrap gap-1.5">
|
|
1616
|
-
{selectedProjects.map((project) => (
|
|
1617
|
-
<Badge
|
|
1618
|
-
key={project.id}
|
|
1619
|
-
variant="secondary"
|
|
1620
|
-
className={cn(
|
|
1621
|
-
'item-center h-auto cursor-pointer gap-1 whitespace-normal border-dynamic-sky/30 bg-dynamic-sky/10 px-2 text-dynamic-sky text-xs transition-opacity hover:opacity-80',
|
|
1622
|
-
disabled && 'pointer-events-none'
|
|
1623
|
-
)}
|
|
1624
|
-
onClick={() =>
|
|
1625
|
-
!disabled && onProjectToggle(project)
|
|
1626
|
-
}
|
|
1627
|
-
>
|
|
1628
|
-
<span className="wrap-break-word">
|
|
1629
|
-
{project.name}
|
|
1630
|
-
</span>
|
|
1631
|
-
{!disabled && (
|
|
1632
|
-
<X className="h-2.5 w-2.5 shrink-0" />
|
|
1633
|
-
)}
|
|
1634
|
-
</Badge>
|
|
1635
|
-
))}
|
|
1636
|
-
</div>
|
|
1637
|
-
</div>
|
|
1638
|
-
)}
|
|
1639
|
-
<TaskResourceSearchField
|
|
1640
|
-
value={projectSearchQuery}
|
|
1641
|
-
onChange={setProjectSearchQuery}
|
|
1642
|
-
placeholder={t('common.search_projects')}
|
|
1643
|
-
/>
|
|
1644
|
-
<div
|
|
1645
|
-
className="max-h-60 overflow-y-auto overscroll-contain"
|
|
1646
|
-
onWheel={(e) => e.stopPropagation()}
|
|
1647
|
-
>
|
|
1648
|
-
<div className="p-1">
|
|
1649
|
-
{projectSearchQuery &&
|
|
1650
|
-
unselectedTaskProjects.length > 0 &&
|
|
1651
|
-
filteredUnselectedProjects.length === 0 ? (
|
|
1652
|
-
<div className="px-2 py-4 text-center text-muted-foreground text-xs">
|
|
1653
|
-
{t('common.no_projects_found')}
|
|
1654
|
-
</div>
|
|
1655
|
-
) : (
|
|
1656
|
-
filteredUnselectedProjects.map((project) => (
|
|
1657
|
-
<button
|
|
1658
|
-
key={project.id}
|
|
1659
|
-
type="button"
|
|
1660
|
-
onClick={() => onProjectToggle(project)}
|
|
1661
|
-
className="flex w-full items-center gap-2 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-muted"
|
|
1662
|
-
>
|
|
1663
|
-
<Box className="h-4 w-4 text-dynamic-sky" />
|
|
1664
|
-
<span className="wrap-break-word flex-1 whitespace-normal">
|
|
1665
|
-
{project.name}
|
|
1666
|
-
</span>
|
|
1667
|
-
</button>
|
|
1668
|
-
))
|
|
1669
|
-
)}
|
|
1670
|
-
</div>
|
|
1671
|
-
</div>
|
|
1672
|
-
<div className="border-t p-2">
|
|
1673
|
-
<Button
|
|
1674
|
-
size="sm"
|
|
1675
|
-
variant="ghost"
|
|
1676
|
-
onClick={() => {
|
|
1677
|
-
setPopoverOpen('projects', false);
|
|
1678
|
-
onShowNewProjectDialog();
|
|
1679
|
-
}}
|
|
1680
|
-
className="h-8 w-full justify-start"
|
|
1681
|
-
>
|
|
1682
|
-
<Plus className="mr-1.5 h-3.5 w-3.5" />
|
|
1683
|
-
{t('ws-task-boards.dialog.create_new_project')}
|
|
1684
|
-
</Button>
|
|
1685
|
-
</div>
|
|
1686
|
-
</>
|
|
1687
|
-
)}
|
|
1688
|
-
</PopoverContent>
|
|
1689
|
-
</Popover>
|
|
1690
|
-
)}
|
|
1691
|
-
|
|
1692
|
-
{/* Assignees Badge */}
|
|
1693
|
-
{canUseBoardAssignees && (
|
|
1694
|
-
<Popover
|
|
1695
|
-
open={isPopoverOpen('assignees')}
|
|
1696
|
-
onOpenChange={(open) => {
|
|
1697
|
-
setPopoverOpen('assignees', open);
|
|
1698
|
-
if (!open) setAssigneeSearchQuery('');
|
|
1699
|
-
}}
|
|
1700
|
-
>
|
|
1701
|
-
<TaskPropertyPopoverTrigger
|
|
1702
|
-
compact={isCompact}
|
|
1703
|
-
label={
|
|
1704
|
-
selectedAssignees.length === 0
|
|
1705
|
-
? t('common.assignees')
|
|
1706
|
-
: selectedAssignees.length === 1
|
|
1707
|
-
? selectedAssignees[0]?.display_name ||
|
|
1708
|
-
t('ws-task-boards.dialog.unknown_user')
|
|
1709
|
-
: t('common.n_assignees', {
|
|
1710
|
-
count: selectedAssignees.length,
|
|
1711
|
-
})
|
|
1712
|
-
}
|
|
1713
|
-
popoverId="assignees"
|
|
1714
|
-
>
|
|
1715
|
-
<button
|
|
1716
|
-
type="button"
|
|
1717
|
-
disabled={disabled}
|
|
1718
|
-
aria-label={t('common.assignees')}
|
|
1719
|
-
className={cn(
|
|
1720
|
-
triggerBaseClass,
|
|
1721
|
-
selectedAssignees.length > 0
|
|
1722
|
-
? 'border-dynamic-cyan/30 bg-dynamic-cyan/15 text-dynamic-cyan hover:border-dynamic-cyan/50 hover:bg-dynamic-cyan/20'
|
|
1723
|
-
: 'border-border bg-background text-muted-foreground hover:border-primary/30 hover:bg-muted hover:text-foreground',
|
|
1724
|
-
disabled && 'cursor-not-allowed opacity-50'
|
|
1725
|
-
)}
|
|
1726
|
-
>
|
|
1727
|
-
<Users className="h-3.5 w-3.5" />
|
|
1728
|
-
<span className={compactLabelClass}>
|
|
1729
|
-
{selectedAssignees.length === 0
|
|
1730
|
-
? t('common.assignees')
|
|
1731
|
-
: selectedAssignees.length === 1
|
|
1732
|
-
? selectedAssignees[0]?.display_name ||
|
|
1733
|
-
t('ws-task-boards.dialog.unknown_user')
|
|
1734
|
-
: t('common.n_assignees', {
|
|
1735
|
-
count: selectedAssignees.length,
|
|
1736
|
-
})}
|
|
1737
|
-
</span>
|
|
1738
|
-
</button>
|
|
1739
|
-
</TaskPropertyPopoverTrigger>
|
|
1740
|
-
<PopoverContent
|
|
1741
|
-
align="start"
|
|
1742
|
-
className="w-72 p-0"
|
|
1743
|
-
{...propertyPopoverContentProps}
|
|
1744
|
-
>
|
|
1745
|
-
{workspaceMembers.length === 0 ? (
|
|
1746
|
-
<div className="p-4 text-center text-muted-foreground text-sm">
|
|
1747
|
-
{t('ws-task-boards.dialog.no_members_found')}
|
|
1748
|
-
</div>
|
|
1749
|
-
) : (
|
|
1750
|
-
<>
|
|
1751
|
-
{selectedAssignees.length > 0 && (
|
|
1752
|
-
<div className="border-b p-2">
|
|
1753
|
-
<div className="flex flex-wrap gap-1.5">
|
|
1754
|
-
{selectedAssignees.map((assignee, index) => (
|
|
1755
|
-
<Badge
|
|
1756
|
-
key={
|
|
1757
|
-
assignee.id ||
|
|
1758
|
-
assignee.user_id ||
|
|
1759
|
-
`assignee-${index}`
|
|
1760
|
-
}
|
|
1761
|
-
variant="secondary"
|
|
1762
|
-
className={cn(
|
|
1763
|
-
'h-6 cursor-pointer gap-1.5 px-2 text-xs transition-opacity hover:opacity-80',
|
|
1764
|
-
disabled && 'pointer-events-none'
|
|
1765
|
-
)}
|
|
1766
|
-
onClick={() =>
|
|
1767
|
-
!disabled && onAssigneeToggle(assignee)
|
|
1768
|
-
}
|
|
1769
|
-
>
|
|
1770
|
-
<UserAvatar user={assignee} size="xs" />
|
|
1771
|
-
{assignee.display_name ||
|
|
1772
|
-
t('ws-task-boards.dialog.unknown_user')}
|
|
1773
|
-
{!disabled && <X className="h-2.5 w-2.5" />}
|
|
1774
|
-
</Badge>
|
|
1775
|
-
))}
|
|
1776
|
-
</div>
|
|
1777
|
-
</div>
|
|
1778
|
-
)}
|
|
1779
|
-
<TaskResourceSearchField
|
|
1780
|
-
value={assigneeSearchQuery}
|
|
1781
|
-
onChange={setAssigneeSearchQuery}
|
|
1782
|
-
placeholder={t('common.search_members')}
|
|
1783
|
-
/>
|
|
1784
|
-
<div
|
|
1785
|
-
className="max-h-60 overflow-y-auto overscroll-contain"
|
|
1786
|
-
onWheel={(e) => e.stopPropagation()}
|
|
1787
|
-
>
|
|
1788
|
-
<div className="p-1">
|
|
1789
|
-
{assigneeSearchQuery &&
|
|
1790
|
-
unselectedWorkspaceMembers.length > 0 &&
|
|
1791
|
-
filteredUnselectedMembers.length === 0 ? (
|
|
1792
|
-
<div className="px-2 py-4 text-center text-muted-foreground text-xs">
|
|
1793
|
-
{t('common.no_members_found')}
|
|
1794
|
-
</div>
|
|
1795
|
-
) : (
|
|
1796
|
-
filteredUnselectedMembers.map((member, index) => (
|
|
1797
|
-
<button
|
|
1798
|
-
key={
|
|
1799
|
-
member.user_id ||
|
|
1800
|
-
member.id ||
|
|
1801
|
-
`member-${index}`
|
|
1802
|
-
}
|
|
1803
|
-
type="button"
|
|
1804
|
-
onClick={() => onAssigneeToggle(member)}
|
|
1805
|
-
className="flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-left text-sm transition-colors hover:bg-muted"
|
|
1806
|
-
>
|
|
1807
|
-
<UserAvatar
|
|
1808
|
-
user={member}
|
|
1809
|
-
size="sm"
|
|
1810
|
-
className="shrink-0 border"
|
|
1811
|
-
/>
|
|
1812
|
-
<span className="flex-1">
|
|
1813
|
-
{member.display_name ||
|
|
1814
|
-
t('ws-task-boards.dialog.unknown_user')}
|
|
1815
|
-
</span>
|
|
1816
|
-
<Plus className="h-4 w-4 shrink-0" />
|
|
1817
|
-
</button>
|
|
1818
|
-
))
|
|
1819
|
-
)}
|
|
1820
|
-
</div>
|
|
1821
|
-
</div>
|
|
1822
|
-
</>
|
|
1823
|
-
)}
|
|
1824
|
-
</PopoverContent>
|
|
1825
|
-
</Popover>
|
|
1826
|
-
)}
|
|
1827
|
-
|
|
1828
|
-
{/* Scheduling Badge — not available for drafts */}
|
|
1829
|
-
{!isDraftMode && (
|
|
1830
|
-
<Popover
|
|
1831
|
-
open={isPopoverOpen('scheduling')}
|
|
1832
|
-
onOpenChange={(open) => setPopoverOpen('scheduling', open)}
|
|
1833
|
-
>
|
|
1834
|
-
<TaskPropertyPopoverTrigger
|
|
1835
|
-
compact={isCompact}
|
|
1836
|
-
label={
|
|
1837
|
-
totalMinutes > 0
|
|
1838
|
-
? formatDuration(totalMinutes, t)
|
|
1839
|
-
: t('ws-task-boards.dialog.schedule')
|
|
1840
|
-
}
|
|
1841
|
-
popoverId="scheduling"
|
|
1842
|
-
>
|
|
1843
|
-
<button
|
|
1844
|
-
type="button"
|
|
1845
|
-
disabled={disabled}
|
|
1846
|
-
aria-label={t('ws-task-boards.dialog.schedule')}
|
|
1847
|
-
className={cn(
|
|
1848
|
-
triggerBaseClass,
|
|
1849
|
-
hasUnsavedSchedulingChanges
|
|
1850
|
-
? 'border-dynamic-yellow/50 border-dashed bg-dynamic-yellow/10 text-dynamic-yellow hover:border-dynamic-yellow/70 hover:bg-dynamic-yellow/15'
|
|
1851
|
-
: totalDuration
|
|
1852
|
-
? 'border-dynamic-teal/30 bg-dynamic-teal/15 text-dynamic-teal hover:border-dynamic-teal/50 hover:bg-dynamic-teal/20'
|
|
1853
|
-
: 'border-border bg-background text-muted-foreground hover:border-primary/30 hover:bg-muted hover:text-foreground',
|
|
1854
|
-
disabled && 'cursor-not-allowed opacity-50'
|
|
1855
|
-
)}
|
|
1856
|
-
>
|
|
1857
|
-
{hasUnsavedSchedulingChanges ? (
|
|
1858
|
-
<AlertCircle className="h-3.5 w-3.5" />
|
|
1859
|
-
) : (
|
|
1860
|
-
<CalendarClock className="h-3.5 w-3.5" />
|
|
1861
|
-
)}
|
|
1862
|
-
<span className={compactLabelClass}>
|
|
1863
|
-
{totalMinutes > 0
|
|
1864
|
-
? formatDuration(totalMinutes, t)
|
|
1865
|
-
: t('ws-task-boards.dialog.schedule')}
|
|
1866
|
-
</span>
|
|
1867
|
-
{!isCompact && !disabled && hasUnsavedSchedulingChanges && (
|
|
1868
|
-
<span className="text-[10px] opacity-75">
|
|
1869
|
-
{t('ws-task-boards.dialog.unsaved')}
|
|
1870
|
-
</span>
|
|
1871
|
-
)}
|
|
1872
|
-
</button>
|
|
1873
|
-
</TaskPropertyPopoverTrigger>
|
|
1874
|
-
<PopoverContent
|
|
1875
|
-
align="start"
|
|
1876
|
-
className="w-72 p-0"
|
|
1877
|
-
{...propertyPopoverContentProps}
|
|
1878
|
-
>
|
|
1879
|
-
<div className="rounded-lg p-3">
|
|
1880
|
-
<div className="space-y-3">
|
|
1881
|
-
{/* Duration */}
|
|
1882
|
-
<div className="space-y-2">
|
|
1883
|
-
<Label className="flex items-center gap-1.5 font-normal text-muted-foreground text-xs">
|
|
1884
|
-
<Clock className="h-3.5 w-3.5" />
|
|
1885
|
-
{t('ws-task-boards.dialog.estimated_duration')}
|
|
1886
|
-
<span className="text-dynamic-red">*</span>
|
|
1887
|
-
</Label>
|
|
1888
|
-
<div className="flex items-center gap-3">
|
|
1889
|
-
<DurationInput
|
|
1890
|
-
value={durationHours}
|
|
1891
|
-
onChange={handleDurationHoursChange}
|
|
1892
|
-
min={0}
|
|
1893
|
-
max={999}
|
|
1894
|
-
disabled={isLoading}
|
|
1895
|
-
label={t('ws-task-boards.dialog.h')}
|
|
1896
|
-
/>
|
|
1897
|
-
<DurationInput
|
|
1898
|
-
value={durationMinutes}
|
|
1899
|
-
onChange={handleDurationMinutesChange}
|
|
1900
|
-
min={0}
|
|
1901
|
-
max={45}
|
|
1902
|
-
step={15}
|
|
1903
|
-
disabled={isLoading}
|
|
1904
|
-
label={t('ws-task-boards.dialog.m')}
|
|
1905
|
-
allowRollover={true}
|
|
1906
|
-
canDecrement={
|
|
1907
|
-
durationHours > 0 || durationMinutes > 0
|
|
1908
|
-
}
|
|
1909
|
-
/>
|
|
1910
|
-
</div>
|
|
1911
|
-
</div>
|
|
1912
|
-
|
|
1913
|
-
{/* Splittable */}
|
|
1914
|
-
<div className="flex items-center justify-between">
|
|
1915
|
-
<Label
|
|
1916
|
-
htmlFor="splittable"
|
|
1917
|
-
className="flex cursor-pointer items-center gap-1.5 font-normal text-muted-foreground text-xs"
|
|
1918
|
-
>
|
|
1919
|
-
<Scissors className="h-3.5 w-3.5" />
|
|
1920
|
-
{t('ws-task-boards.dialog.splittable')}
|
|
1921
|
-
</Label>
|
|
1922
|
-
<Switch
|
|
1923
|
-
id="splittable"
|
|
1924
|
-
checked={isSplittable}
|
|
1925
|
-
onCheckedChange={handleSplittableChange}
|
|
1926
|
-
disabled={isLoading}
|
|
1927
|
-
/>
|
|
1928
|
-
</div>
|
|
1929
|
-
|
|
1930
|
-
{/* Min/Max Split Duration */}
|
|
1931
|
-
{isSplittable && (
|
|
1932
|
-
<div className="grid grid-cols-2 gap-3">
|
|
1933
|
-
<div className="space-y-1.5">
|
|
1934
|
-
<Label className="font-normal text-muted-foreground text-xs">
|
|
1935
|
-
{t('ws-task-boards.dialog.min_split')}
|
|
1936
|
-
</Label>
|
|
1937
|
-
<DurationInput
|
|
1938
|
-
value={minSplitDurationMinutes ?? 30}
|
|
1939
|
-
onChange={(value) =>
|
|
1940
|
-
onMinSplitDurationChange(value)
|
|
1941
|
-
}
|
|
1942
|
-
min={15}
|
|
1943
|
-
max={maxSplitDurationMinutes ?? 480}
|
|
1944
|
-
step={15}
|
|
1945
|
-
disabled={isLoading}
|
|
1946
|
-
label={t('ws-task-boards.dialog.min')}
|
|
1947
|
-
/>
|
|
1948
|
-
</div>
|
|
1949
|
-
<div className="space-y-1.5">
|
|
1950
|
-
<Label className="font-normal text-muted-foreground text-xs">
|
|
1951
|
-
{t('ws-task-boards.dialog.max_split')}
|
|
1952
|
-
</Label>
|
|
1953
|
-
<DurationInput
|
|
1954
|
-
value={maxSplitDurationMinutes ?? 120}
|
|
1955
|
-
onChange={(value) =>
|
|
1956
|
-
onMaxSplitDurationChange(value)
|
|
1957
|
-
}
|
|
1958
|
-
min={minSplitDurationMinutes ?? 15}
|
|
1959
|
-
max={480}
|
|
1960
|
-
step={15}
|
|
1961
|
-
disabled={isLoading}
|
|
1962
|
-
label={t('ws-task-boards.dialog.min')}
|
|
1963
|
-
/>
|
|
1964
|
-
</div>
|
|
1965
|
-
</div>
|
|
1966
|
-
)}
|
|
1967
|
-
|
|
1968
|
-
{/* Calendar Hours Type */}
|
|
1969
|
-
<div className="space-y-1.5">
|
|
1970
|
-
<Label className="flex items-center gap-1.5 font-normal text-muted-foreground text-xs">
|
|
1971
|
-
<Briefcase className="h-3.5 w-3.5" />
|
|
1972
|
-
{t('ws-task-boards.dialog.hour_type')}
|
|
1973
|
-
<span className="text-dynamic-red">*</span>
|
|
1974
|
-
</Label>
|
|
1975
|
-
<div
|
|
1976
|
-
className={cn(
|
|
1977
|
-
'inline-flex rounded-md border p-0.5',
|
|
1978
|
-
!isCreateMode &&
|
|
1979
|
-
hasUnsavedSchedulingChanges &&
|
|
1980
|
-
!calendarHours
|
|
1981
|
-
? 'border-dynamic-red/50 bg-dynamic-red/5'
|
|
1982
|
-
: 'border-border'
|
|
1983
|
-
)}
|
|
1984
|
-
>
|
|
1985
|
-
{getCalendarHoursOptions(t).map((option) => {
|
|
1986
|
-
const Icon = option.icon;
|
|
1987
|
-
const isSelected = calendarHours === option.value;
|
|
1988
|
-
return (
|
|
1989
|
-
<button
|
|
1990
|
-
key={option.value}
|
|
1991
|
-
type="button"
|
|
1992
|
-
onClick={() =>
|
|
1993
|
-
onCalendarHoursChange(option.value)
|
|
1994
|
-
}
|
|
1995
|
-
className={cn(
|
|
1996
|
-
'flex items-center gap-1.5 rounded px-2.5 py-1 text-xs transition-colors',
|
|
1997
|
-
isSelected
|
|
1998
|
-
? 'bg-primary text-primary-foreground'
|
|
1999
|
-
: 'text-muted-foreground hover:bg-muted hover:text-foreground'
|
|
2000
|
-
)}
|
|
2001
|
-
title={option.label}
|
|
2002
|
-
>
|
|
2003
|
-
<Icon className="h-3.5 w-3.5" />
|
|
2004
|
-
<span className="hidden sm:inline">
|
|
2005
|
-
{option.label.split(' ')[0]}
|
|
2006
|
-
</span>
|
|
2007
|
-
</button>
|
|
2008
|
-
);
|
|
2009
|
-
})}
|
|
2010
|
-
</div>
|
|
2011
|
-
</div>
|
|
2012
|
-
|
|
2013
|
-
{/* Auto-schedule */}
|
|
2014
|
-
<div className="flex items-center justify-between">
|
|
2015
|
-
<Label
|
|
2016
|
-
htmlFor="auto-schedule"
|
|
2017
|
-
className="flex cursor-pointer items-center gap-1.5 font-normal text-muted-foreground text-xs"
|
|
2018
|
-
>
|
|
2019
|
-
<Zap className="h-3.5 w-3.5" />
|
|
2020
|
-
{t('ws-task-boards.dialog.auto_schedule')}
|
|
2021
|
-
</Label>
|
|
2022
|
-
<Switch
|
|
2023
|
-
id="auto-schedule"
|
|
2024
|
-
checked={autoSchedule}
|
|
2025
|
-
onCheckedChange={onAutoScheduleChange}
|
|
2026
|
-
disabled={isLoading}
|
|
2027
|
-
/>
|
|
2028
|
-
</div>
|
|
2029
|
-
|
|
2030
|
-
{/* Scheduled Events Progress & List */}
|
|
2031
|
-
{!isCreateMode && totalMinutes > 0 && (
|
|
2032
|
-
<div className="space-y-2 border-t pt-2">
|
|
2033
|
-
{/* Progress */}
|
|
2034
|
-
{(() => {
|
|
2035
|
-
const scheduledMinutes =
|
|
2036
|
-
scheduledEvents?.reduce(
|
|
2037
|
-
(sum, e) => sum + (e.scheduled_minutes || 0),
|
|
2038
|
-
0
|
|
2039
|
-
) ?? 0;
|
|
2040
|
-
const progress =
|
|
2041
|
-
totalMinutes > 0
|
|
2042
|
-
? (scheduledMinutes / totalMinutes) * 100
|
|
2043
|
-
: 0;
|
|
2044
|
-
const isFullyScheduled = progress >= 100;
|
|
2045
|
-
|
|
2046
|
-
// Check if any events are scheduled past the deadline
|
|
2047
|
-
const eventsAfterDeadline =
|
|
2048
|
-
endDate && scheduledEvents
|
|
2049
|
-
? scheduledEvents.filter(
|
|
2050
|
-
(e) => new Date(e.start_at) > endDate
|
|
2051
|
-
)
|
|
2052
|
-
: [];
|
|
2053
|
-
const hasEventsAfterDeadline =
|
|
2054
|
-
eventsAfterDeadline.length > 0;
|
|
2055
|
-
|
|
2056
|
-
return (
|
|
2057
|
-
<>
|
|
2058
|
-
<div className="space-y-1">
|
|
2059
|
-
<div className="flex items-center justify-between text-xs">
|
|
2060
|
-
<span className="text-muted-foreground">
|
|
2061
|
-
{scheduledEvents &&
|
|
2062
|
-
scheduledEvents.length > 0
|
|
2063
|
-
? t(
|
|
2064
|
-
'ws-task-boards.dialog.events_scheduled',
|
|
2065
|
-
{
|
|
2066
|
-
count: scheduledEvents.length,
|
|
2067
|
-
}
|
|
2068
|
-
)
|
|
2069
|
-
: t(
|
|
2070
|
-
'ws-task-boards.dialog.not_scheduled'
|
|
2071
|
-
)}
|
|
2072
|
-
</span>
|
|
2073
|
-
<span
|
|
2074
|
-
className={cn(
|
|
2075
|
-
'font-medium',
|
|
2076
|
-
isFullyScheduled
|
|
2077
|
-
? 'text-dynamic-green'
|
|
2078
|
-
: 'text-foreground'
|
|
2079
|
-
)}
|
|
2080
|
-
>
|
|
2081
|
-
{formatDuration(scheduledMinutes, t)} /{' '}
|
|
2082
|
-
{formatDuration(totalMinutes, t)}
|
|
2083
|
-
</span>
|
|
2084
|
-
</div>
|
|
2085
|
-
<Progress
|
|
2086
|
-
value={Math.min(progress, 100)}
|
|
2087
|
-
className={cn(
|
|
2088
|
-
'h-1.5',
|
|
2089
|
-
isFullyScheduled &&
|
|
2090
|
-
'[&>div]:bg-dynamic-green'
|
|
2091
|
-
)}
|
|
2092
|
-
/>
|
|
2093
|
-
</div>
|
|
2094
|
-
|
|
2095
|
-
{/* Warning: Events scheduled after deadline */}
|
|
2096
|
-
{hasEventsAfterDeadline && (
|
|
2097
|
-
<div className="flex items-center gap-2 rounded-md border border-dynamic-orange/30 bg-dynamic-orange/10 px-2.5 py-1.5 text-xs">
|
|
2098
|
-
<AlertTriangle className="h-3.5 w-3.5 shrink-0 text-dynamic-orange" />
|
|
2099
|
-
<span className="text-dynamic-orange">
|
|
2100
|
-
{eventsAfterDeadline.length === 1
|
|
2101
|
-
? t(
|
|
2102
|
-
'ws-task-boards.dialog.event_after_deadline_singular'
|
|
2103
|
-
)
|
|
2104
|
-
: t(
|
|
2105
|
-
'ws-task-boards.dialog.event_after_deadline_plural',
|
|
2106
|
-
{
|
|
2107
|
-
count: eventsAfterDeadline.length,
|
|
2108
|
-
}
|
|
2109
|
-
)}
|
|
2110
|
-
</span>
|
|
2111
|
-
</div>
|
|
2112
|
-
)}
|
|
2113
|
-
|
|
2114
|
-
{/* Compact Events List */}
|
|
2115
|
-
{scheduledEvents &&
|
|
2116
|
-
scheduledEvents.length > 0 && (
|
|
2117
|
-
<div className="flex flex-wrap gap-1">
|
|
2118
|
-
{scheduledEvents.map((event) => {
|
|
2119
|
-
const isAfterDeadline =
|
|
2120
|
-
endDate &&
|
|
2121
|
-
new Date(event.start_at) > endDate;
|
|
2122
|
-
return (
|
|
2123
|
-
<div
|
|
2124
|
-
key={event.id}
|
|
2125
|
-
className={cn(
|
|
2126
|
-
'inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px]',
|
|
2127
|
-
event.completed
|
|
2128
|
-
? 'bg-dynamic-green/10 text-dynamic-green'
|
|
2129
|
-
: isAfterDeadline
|
|
2130
|
-
? 'bg-dynamic-orange/10 text-dynamic-orange'
|
|
2131
|
-
: 'bg-muted text-muted-foreground'
|
|
2132
|
-
)}
|
|
2133
|
-
title={`${dayjs(event.start_at).format('MMM D, h:mm A')} - ${formatDuration(event.scheduled_minutes, t)}${isAfterDeadline ? ` (${t('ws-task-boards.dialog.after_deadline', { defaultValue: 'after deadline' })})` : ''}`}
|
|
2134
|
-
>
|
|
2135
|
-
{event.completed ? (
|
|
2136
|
-
<CheckCircle className="h-2.5 w-2.5" />
|
|
2137
|
-
) : isAfterDeadline ? (
|
|
2138
|
-
<AlertTriangle className="h-2.5 w-2.5" />
|
|
2139
|
-
) : (
|
|
2140
|
-
<Calendar className="h-2.5 w-2.5" />
|
|
2141
|
-
)}
|
|
2142
|
-
<span>
|
|
2143
|
-
{dayjs(event.start_at).format(
|
|
2144
|
-
'M/D h:mma'
|
|
2145
|
-
)}
|
|
2146
|
-
</span>
|
|
2147
|
-
</div>
|
|
2148
|
-
);
|
|
2149
|
-
})}
|
|
2150
|
-
</div>
|
|
2151
|
-
)}
|
|
2152
|
-
</>
|
|
2153
|
-
);
|
|
2154
|
-
})()}
|
|
2155
|
-
</div>
|
|
2156
|
-
)}
|
|
2157
|
-
|
|
2158
|
-
{/* Action Buttons */}
|
|
2159
|
-
{!isCreateMode && (
|
|
2160
|
-
<div className="flex items-center gap-2 border-t pt-2">
|
|
2161
|
-
<Button
|
|
2162
|
-
size="sm"
|
|
2163
|
-
variant="outline"
|
|
2164
|
-
onClick={handleSaveSchedulingSettings}
|
|
2165
|
-
disabled={!canSaveScheduling}
|
|
2166
|
-
className="flex-1"
|
|
2167
|
-
>
|
|
2168
|
-
{schedulingSaving ? (
|
|
2169
|
-
<Loader2 className="h-3.5 w-3.5 animate-spin" />
|
|
2170
|
-
) : (
|
|
2171
|
-
<>
|
|
2172
|
-
<Save className="mr-1.5 h-3.5 w-3.5" />
|
|
2173
|
-
{t('common.save')}
|
|
2174
|
-
</>
|
|
2175
|
-
)}
|
|
2176
|
-
</Button>
|
|
2177
|
-
{(durationHours > 0 || durationMinutes > 0) && (
|
|
2178
|
-
<Button
|
|
2179
|
-
size="sm"
|
|
2180
|
-
variant="ghost"
|
|
2181
|
-
onClick={handleClearSchedulingSettings}
|
|
2182
|
-
disabled={schedulingSaving}
|
|
2183
|
-
className="px-2 text-muted-foreground hover:text-dynamic-red"
|
|
2184
|
-
>
|
|
2185
|
-
<X className="h-3.5 w-3.5" />
|
|
2186
|
-
</Button>
|
|
2187
|
-
)}
|
|
2188
|
-
</div>
|
|
2189
|
-
)}
|
|
2190
|
-
|
|
2191
|
-
{/* Clear Duration (create mode only) */}
|
|
2192
|
-
{isCreateMode &&
|
|
2193
|
-
totalDuration !== null &&
|
|
2194
|
-
totalDuration > 0 && (
|
|
2195
|
-
<ClearMenuItem
|
|
2196
|
-
label={t('ws-task-boards.dialog.clear_duration')}
|
|
2197
|
-
onClick={() => {
|
|
2198
|
-
onTotalDurationChange(null);
|
|
2199
|
-
setPopoverOpen('scheduling', false);
|
|
2200
|
-
}}
|
|
2201
|
-
/>
|
|
2202
|
-
)}
|
|
2203
|
-
</div>
|
|
2204
|
-
</div>
|
|
2205
|
-
</PopoverContent>
|
|
2206
|
-
</Popover>
|
|
2207
|
-
)}
|
|
2208
|
-
</div>
|
|
2209
|
-
</div>
|
|
2210
|
-
)}
|
|
2211
|
-
</div>
|
|
2212
|
-
);
|
|
2213
|
-
}
|