@tuturuuu/ui 0.17.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 +20 -0
- package/biome.json +1 -1
- package/package.json +76 -118
- 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/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/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 -185
- 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 -922
- 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 -382
- 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,2889 +0,0 @@
|
|
|
1
|
-
import { useSortable } from '@dnd-kit/sortable';
|
|
2
|
-
import { CSS } from '@dnd-kit/utilities';
|
|
3
|
-
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
4
|
-
import {
|
|
5
|
-
AlertCircle,
|
|
6
|
-
Archive,
|
|
7
|
-
ArrowUpCircle,
|
|
8
|
-
Ban,
|
|
9
|
-
Box,
|
|
10
|
-
Calendar,
|
|
11
|
-
CheckCircle2,
|
|
12
|
-
CircleSlash,
|
|
13
|
-
Clock,
|
|
14
|
-
Copy,
|
|
15
|
-
ExternalLink,
|
|
16
|
-
FileText,
|
|
17
|
-
Image as ImageIcon,
|
|
18
|
-
Link2,
|
|
19
|
-
ListChecks,
|
|
20
|
-
ListTodo,
|
|
21
|
-
ListTree,
|
|
22
|
-
Loader2,
|
|
23
|
-
MoreHorizontal,
|
|
24
|
-
MoveRight,
|
|
25
|
-
Play,
|
|
26
|
-
Share2,
|
|
27
|
-
SquareCenterlineDashedVertical,
|
|
28
|
-
Timer,
|
|
29
|
-
Trash2,
|
|
30
|
-
} from '@tuturuuu/icons';
|
|
31
|
-
import {
|
|
32
|
-
getWorkspaceTask,
|
|
33
|
-
listWorkspaceTaskBoardViewableMembers,
|
|
34
|
-
listWorkspaceTaskLists,
|
|
35
|
-
listWorkspaceTaskProjects,
|
|
36
|
-
listWorkspaceTaskProjectsByIds,
|
|
37
|
-
removeCurrentUserTaskPersonalPlacement,
|
|
38
|
-
} from '@tuturuuu/internal-api/tasks';
|
|
39
|
-
import type { SupportedColor } from '@tuturuuu/types/primitives/SupportedColors';
|
|
40
|
-
import type { Task } from '@tuturuuu/types/primitives/Task';
|
|
41
|
-
import type { TaskList } from '@tuturuuu/types/primitives/TaskList';
|
|
42
|
-
import { Badge } from '@tuturuuu/ui/badge';
|
|
43
|
-
import { Button } from '@tuturuuu/ui/button';
|
|
44
|
-
import { Card } from '@tuturuuu/ui/card';
|
|
45
|
-
import {
|
|
46
|
-
DropdownMenu,
|
|
47
|
-
DropdownMenuContent,
|
|
48
|
-
DropdownMenuItem,
|
|
49
|
-
DropdownMenuSeparator,
|
|
50
|
-
DropdownMenuTrigger,
|
|
51
|
-
} from '@tuturuuu/ui/dropdown-menu';
|
|
52
|
-
import { useCalendarPreferences } from '@tuturuuu/ui/hooks/use-calendar-preferences';
|
|
53
|
-
import { useTaskActions } from '@tuturuuu/ui/hooks/use-task-actions';
|
|
54
|
-
import { useUserBooleanConfig } from '@tuturuuu/ui/hooks/use-user-config';
|
|
55
|
-
import {
|
|
56
|
-
useWorkspaceMembers,
|
|
57
|
-
type WorkspaceMember,
|
|
58
|
-
} from '@tuturuuu/ui/hooks/use-workspace-members';
|
|
59
|
-
import {
|
|
60
|
-
HoverCard,
|
|
61
|
-
HoverCardContent,
|
|
62
|
-
HoverCardTrigger,
|
|
63
|
-
} from '@tuturuuu/ui/hover-card';
|
|
64
|
-
import { toast } from '@tuturuuu/ui/sonner';
|
|
65
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from '@tuturuuu/ui/tooltip';
|
|
66
|
-
import { cn } from '@tuturuuu/utils/format';
|
|
67
|
-
import {
|
|
68
|
-
createTask,
|
|
69
|
-
getPersonalExternalStagingListId,
|
|
70
|
-
getTicketIdentifier,
|
|
71
|
-
useBoardConfig,
|
|
72
|
-
useWorkspaceLabels,
|
|
73
|
-
} from '@tuturuuu/utils/task-helper';
|
|
74
|
-
import { isTaskBoardResolvedStatus } from '@tuturuuu/utils/task-list-status';
|
|
75
|
-
import { getDescriptionMetadata } from '@tuturuuu/utils/text-helper';
|
|
76
|
-
import { getTimeFormatPattern } from '@tuturuuu/utils/time-helper';
|
|
77
|
-
import { format, formatDistance } from 'date-fns';
|
|
78
|
-
import { enUS, vi } from 'date-fns/locale';
|
|
79
|
-
import Link from 'next/link';
|
|
80
|
-
import { useParams } from 'next/navigation';
|
|
81
|
-
import { useLocale, useTranslations } from 'next-intl';
|
|
82
|
-
import React, {
|
|
83
|
-
useCallback,
|
|
84
|
-
useEffect,
|
|
85
|
-
useMemo,
|
|
86
|
-
useRef,
|
|
87
|
-
useState,
|
|
88
|
-
} from 'react';
|
|
89
|
-
import { isPersonalExternalOverlayTask } from '../../../../../../lib/task-personal-external';
|
|
90
|
-
import {
|
|
91
|
-
enqueueTaskCardRelationshipRequest,
|
|
92
|
-
useTaskCardRelationships,
|
|
93
|
-
} from '../../../hooks/useTaskCardRelationships';
|
|
94
|
-
import { useTaskDialog } from '../../../hooks/useTaskDialog';
|
|
95
|
-
import { useTaskDialogState } from '../../../hooks/useTaskDialogState';
|
|
96
|
-
import { useTaskLabelManagement } from '../../../hooks/useTaskLabelManagement';
|
|
97
|
-
import { useTaskProjectManagement } from '../../../hooks/useTaskProjectManagement';
|
|
98
|
-
import { useTaskDialogContext } from '../../../providers/task-dialog-provider';
|
|
99
|
-
import { AssigneeSelect } from '../../../shared/assignee-select';
|
|
100
|
-
import { useBoardBroadcast } from '../../../shared/board-broadcast-context';
|
|
101
|
-
import { CreateListDialog } from '../../../shared/create-list-dialog';
|
|
102
|
-
import { formatRelationshipTaskIdentifier } from '../../../shared/relationship-task-identifier';
|
|
103
|
-
import {
|
|
104
|
-
shouldShowTaskDueDate,
|
|
105
|
-
shouldShowTaskStartDate,
|
|
106
|
-
TASKS_SHOW_REVIEW_DUE_DATES_CONFIG_ID,
|
|
107
|
-
} from '../../../shared/task-due-date-visibility';
|
|
108
|
-
import { TaskEstimationDisplay } from '../../../shared/task-estimation-display';
|
|
109
|
-
import { TaskLabelsDisplay } from '../../../shared/task-labels-display';
|
|
110
|
-
import { TaskShareDialog } from '../../../shared/task-share-dialog';
|
|
111
|
-
import { TaskViewerAvatarsComponent } from '../../../shared/user-presence-avatars';
|
|
112
|
-
import { useTasksHref } from '../../../tasks-route-context';
|
|
113
|
-
import {
|
|
114
|
-
getCardColorClasses as getCardColorClassesUtil,
|
|
115
|
-
getListTextColorClass,
|
|
116
|
-
getTicketBadgeColorClasses,
|
|
117
|
-
} from '../../../utils/taskColorUtils';
|
|
118
|
-
import {
|
|
119
|
-
DESTINATION_TONE_COLORS,
|
|
120
|
-
getRandomNewLabelColor,
|
|
121
|
-
} from '../../../utils/taskConstants';
|
|
122
|
-
import { formatSmartDate } from '../../../utils/taskDateUtils';
|
|
123
|
-
import { getPriorityIndicator } from '../../../utils/taskPriorityUtils';
|
|
124
|
-
import { sortByDisplayName } from '../board-text-utils';
|
|
125
|
-
import { invalidateKanbanDeadlineTasks } from '../kanban/data/kanban-deadline-query';
|
|
126
|
-
import {
|
|
127
|
-
TaskAssigneesMenu,
|
|
128
|
-
TaskBlockingMenu,
|
|
129
|
-
TaskDueDateMenu,
|
|
130
|
-
TaskEstimationMenu,
|
|
131
|
-
TaskLabelsMenu,
|
|
132
|
-
TaskMoveMenu,
|
|
133
|
-
TaskParentMenu,
|
|
134
|
-
TaskPriorityMenu,
|
|
135
|
-
TaskProjectsMenu,
|
|
136
|
-
TaskRelatedMenu,
|
|
137
|
-
TaskSchedulingMenu,
|
|
138
|
-
} from '../menus';
|
|
139
|
-
import { TaskActions } from '../task-actions';
|
|
140
|
-
import { TaskCustomDateDialog } from '../task-dialogs/TaskCustomDateDialog';
|
|
141
|
-
import { TaskDeleteDialog } from '../task-dialogs/TaskDeleteDialog';
|
|
142
|
-
import { TaskNewLabelDialog } from '../task-dialogs/TaskNewLabelDialog';
|
|
143
|
-
import { TaskNewProjectDialog } from '../task-dialogs/TaskNewProjectDialog';
|
|
144
|
-
import { getTaskCardParentBadgeState } from '../task-parent-badge-state';
|
|
145
|
-
import { TaskCardCheckbox } from './TaskCardCheckbox';
|
|
146
|
-
import { shouldRenderTaskCardQuickArchive } from './task-card-archive-visibility';
|
|
147
|
-
import {
|
|
148
|
-
getTaskCardSelectionCheckboxToneClasses,
|
|
149
|
-
TASK_CARD_OVERDUE_CHECKBOX_TONE_CLASSES,
|
|
150
|
-
} from './task-card-checkbox-style';
|
|
151
|
-
import { areTaskCardPropsEqual } from './task-card-comparator';
|
|
152
|
-
import { shouldRenderTaskCardCompletionCheckbox } from './task-card-completion-checkbox-visibility';
|
|
153
|
-
import { TaskCardIdentifierRow } from './task-card-identifier-row';
|
|
154
|
-
import { mergeTaskCardLabelOptions } from './task-card-label-options';
|
|
155
|
-
import {
|
|
156
|
-
getTaskCardHydratingOpenOptions,
|
|
157
|
-
isExternalTaskSnapshot,
|
|
158
|
-
} from './task-card-open-options';
|
|
159
|
-
import { getTaskCardResourceContext } from './task-card-resource-context';
|
|
160
|
-
import { getTaskCardVisibilityState } from './task-card-visibility';
|
|
161
|
-
import { TaskSchedulingBadge } from './task-scheduling-badge';
|
|
162
|
-
|
|
163
|
-
export type TaskCardAssigneeMemberSource =
|
|
164
|
-
| 'workspace'
|
|
165
|
-
| 'board'
|
|
166
|
-
| 'workspace-and-board';
|
|
167
|
-
|
|
168
|
-
export interface TaskCardProps {
|
|
169
|
-
task: Task;
|
|
170
|
-
boardId: string;
|
|
171
|
-
workspaceId?: string;
|
|
172
|
-
taskList?: TaskList;
|
|
173
|
-
isOverlay?: boolean;
|
|
174
|
-
onUpdate: () => void;
|
|
175
|
-
availableLists?: TaskList[]; // Optional: pass from parent to avoid redundant API calls
|
|
176
|
-
isSelected?: boolean;
|
|
177
|
-
isMultiSelectMode?: boolean;
|
|
178
|
-
isPersonalWorkspace?: boolean;
|
|
179
|
-
canUseBoardAssignees?: boolean;
|
|
180
|
-
assigneeMemberSource?: TaskCardAssigneeMemberSource;
|
|
181
|
-
onSelect?: (taskId: string, event: React.MouseEvent) => void;
|
|
182
|
-
onClearSelection?: () => void;
|
|
183
|
-
dragDisabled?: boolean;
|
|
184
|
-
sortableId?: string;
|
|
185
|
-
suppressSortableTransform?: boolean;
|
|
186
|
-
optimisticUpdateInProgress?: Set<string>;
|
|
187
|
-
selectedTasks?: Set<string>; // For bulk operations
|
|
188
|
-
bulkUpdateCustomDueDate?: (date: Date | null) => Promise<void>; // From useBulkOperations
|
|
189
|
-
deadlineContext?: 'overdue' | 'upcoming';
|
|
190
|
-
deadlineNow?: number;
|
|
191
|
-
readOnly?: boolean;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function ReadOnlyTaskCard({ task, taskList }: TaskCardProps) {
|
|
195
|
-
const t = useTranslations('common');
|
|
196
|
-
const publicBoardT = useTranslations('ws-task-boards.public');
|
|
197
|
-
const priorityT = useTranslations('ws-task-boards.dialog.priority');
|
|
198
|
-
const locale = useLocale();
|
|
199
|
-
const dateLocale = locale === 'vi' ? vi : enUS;
|
|
200
|
-
const ticketPrefix = (task as Task & { ticket_prefix?: string | null })
|
|
201
|
-
.ticket_prefix;
|
|
202
|
-
const ticketIdentifier =
|
|
203
|
-
typeof task.display_number === 'number' && task.display_number > 0
|
|
204
|
-
? getTicketIdentifier(ticketPrefix, task.display_number)
|
|
205
|
-
: null;
|
|
206
|
-
const dueDate = task.end_date
|
|
207
|
-
? format(new Date(task.end_date), 'MMM d, yyyy', { locale: dateLocale })
|
|
208
|
-
: null;
|
|
209
|
-
|
|
210
|
-
return (
|
|
211
|
-
<Card
|
|
212
|
-
className={cn(
|
|
213
|
-
'relative overflow-hidden rounded-lg border border-l-4 bg-background p-3 shadow-xs',
|
|
214
|
-
getCardColorClassesUtil(taskList, task.priority),
|
|
215
|
-
task.closed_at && 'opacity-60 saturate-50'
|
|
216
|
-
)}
|
|
217
|
-
data-task-card-id={task.id}
|
|
218
|
-
data-task-read-only="true"
|
|
219
|
-
>
|
|
220
|
-
<TaskCardIdentifierRow
|
|
221
|
-
externalSourceLabel=""
|
|
222
|
-
isMultiSelectMode={false}
|
|
223
|
-
isPersonalExternalTask={false}
|
|
224
|
-
isSelected={false}
|
|
225
|
-
selectTaskLabel={t('select_task', { name: task.name })}
|
|
226
|
-
taskListStatus={taskList?.status}
|
|
227
|
-
ticketBadgeClassName={getTicketBadgeColorClasses(
|
|
228
|
-
taskList,
|
|
229
|
-
task.priority
|
|
230
|
-
)}
|
|
231
|
-
ticketIdentifier={ticketIdentifier}
|
|
232
|
-
ticketTitle={ticketIdentifier ?? ''}
|
|
233
|
-
/>
|
|
234
|
-
|
|
235
|
-
<div className="space-y-2">
|
|
236
|
-
<h3
|
|
237
|
-
className={cn(
|
|
238
|
-
'line-clamp-2 break-words font-medium text-sm leading-5',
|
|
239
|
-
(task.completed_at || task.closed_at) &&
|
|
240
|
-
'text-muted-foreground line-through'
|
|
241
|
-
)}
|
|
242
|
-
>
|
|
243
|
-
{task.name}
|
|
244
|
-
</h3>
|
|
245
|
-
|
|
246
|
-
<div className="flex flex-wrap items-center gap-1.5">
|
|
247
|
-
{task.priority && (
|
|
248
|
-
<Badge variant="outline" className="h-5 px-1.5 font-normal text-xs">
|
|
249
|
-
{priorityT(task.priority)}
|
|
250
|
-
</Badge>
|
|
251
|
-
)}
|
|
252
|
-
{dueDate && (
|
|
253
|
-
<Badge
|
|
254
|
-
variant="secondary"
|
|
255
|
-
className="h-5 gap-1 px-1.5 font-normal text-xs"
|
|
256
|
-
>
|
|
257
|
-
<Calendar className="h-3 w-3" />
|
|
258
|
-
{dueDate}
|
|
259
|
-
</Badge>
|
|
260
|
-
)}
|
|
261
|
-
{typeof task.estimation_points === 'number' && (
|
|
262
|
-
<Badge variant="outline" className="h-5 px-1.5 font-normal text-xs">
|
|
263
|
-
{publicBoardT('points', { count: task.estimation_points })}
|
|
264
|
-
</Badge>
|
|
265
|
-
)}
|
|
266
|
-
</div>
|
|
267
|
-
|
|
268
|
-
{(task.labels?.length ||
|
|
269
|
-
task.projects?.length ||
|
|
270
|
-
task.assignees?.length) && (
|
|
271
|
-
<div className="flex flex-wrap items-center gap-1.5">
|
|
272
|
-
{task.labels?.map((label) => (
|
|
273
|
-
<Badge
|
|
274
|
-
key={label.id}
|
|
275
|
-
variant="outline"
|
|
276
|
-
className="h-5 gap-1 px-1.5 font-normal text-xs"
|
|
277
|
-
>
|
|
278
|
-
<span
|
|
279
|
-
aria-hidden="true"
|
|
280
|
-
className="h-2 w-2 rounded-full"
|
|
281
|
-
style={{ backgroundColor: label.color }}
|
|
282
|
-
/>
|
|
283
|
-
{label.name}
|
|
284
|
-
</Badge>
|
|
285
|
-
))}
|
|
286
|
-
{task.projects?.map((project) => (
|
|
287
|
-
<Badge
|
|
288
|
-
key={project.id}
|
|
289
|
-
variant="outline"
|
|
290
|
-
className="h-5 gap-1 px-1.5 font-normal text-xs"
|
|
291
|
-
>
|
|
292
|
-
<Box className="h-3 w-3" />
|
|
293
|
-
{project.name}
|
|
294
|
-
</Badge>
|
|
295
|
-
))}
|
|
296
|
-
{task.assignees?.map((assignee) => (
|
|
297
|
-
<Badge
|
|
298
|
-
key={assignee.id}
|
|
299
|
-
variant="secondary"
|
|
300
|
-
className="h-5 px-1.5 font-normal text-xs"
|
|
301
|
-
>
|
|
302
|
-
{assignee.display_name ||
|
|
303
|
-
(assignee.handle ? `@${assignee.handle}` : t('assignee'))}
|
|
304
|
-
</Badge>
|
|
305
|
-
))}
|
|
306
|
-
</div>
|
|
307
|
-
)}
|
|
308
|
-
</div>
|
|
309
|
-
</Card>
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
// Memoized full TaskCard
|
|
314
|
-
function TaskCardInner({
|
|
315
|
-
task,
|
|
316
|
-
boardId,
|
|
317
|
-
workspaceId,
|
|
318
|
-
taskList,
|
|
319
|
-
isOverlay,
|
|
320
|
-
onUpdate,
|
|
321
|
-
availableLists: propAvailableLists,
|
|
322
|
-
isSelected = false,
|
|
323
|
-
isMultiSelectMode = false,
|
|
324
|
-
isPersonalWorkspace = false,
|
|
325
|
-
canUseBoardAssignees,
|
|
326
|
-
assigneeMemberSource,
|
|
327
|
-
onSelect,
|
|
328
|
-
onClearSelection,
|
|
329
|
-
dragDisabled: dragDisabledProp = false,
|
|
330
|
-
sortableId: sortableIdProp,
|
|
331
|
-
suppressSortableTransform = false,
|
|
332
|
-
optimisticUpdateInProgress,
|
|
333
|
-
selectedTasks,
|
|
334
|
-
bulkUpdateCustomDueDate,
|
|
335
|
-
deadlineContext,
|
|
336
|
-
deadlineNow,
|
|
337
|
-
}: TaskCardProps) {
|
|
338
|
-
const { wsId: rawWsId } = useParams();
|
|
339
|
-
const wsId = Array.isArray(rawWsId) ? rawWsId[0] : rawWsId;
|
|
340
|
-
const queryClient = useQueryClient();
|
|
341
|
-
const broadcast = useBoardBroadcast();
|
|
342
|
-
const t = useTranslations('common');
|
|
343
|
-
const tTasks = useTranslations('ws-tasks');
|
|
344
|
-
const taskBoardT = useTranslations();
|
|
345
|
-
const tasksHref = useTasksHref();
|
|
346
|
-
const locale = useLocale();
|
|
347
|
-
const dateLocale = locale === 'vi' ? vi : enUS;
|
|
348
|
-
const { weekStartsOn, timeFormat } = useCalendarPreferences();
|
|
349
|
-
const { value: showReviewDueDates } = useUserBooleanConfig(
|
|
350
|
-
TASKS_SHOW_REVIEW_DUE_DATES_CONFIG_ID,
|
|
351
|
-
false
|
|
352
|
-
);
|
|
353
|
-
const timePattern = getTimeFormatPattern(timeFormat);
|
|
354
|
-
|
|
355
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
356
|
-
const [menuOpen, setMenuOpen] = useState(false);
|
|
357
|
-
const [isCreateListDialogOpen, setIsCreateListDialogOpen] = useState(false);
|
|
358
|
-
const [menuGuardUntil, setMenuGuardUntil] = useState(0);
|
|
359
|
-
const [shareDialogOpen, setShareDialogOpen] = useState(false);
|
|
360
|
-
const [isInViewport, setIsInViewport] = useState(false);
|
|
361
|
-
const [relationshipMenusOpen, setRelationshipMenusOpen] = useState({
|
|
362
|
-
parent: false,
|
|
363
|
-
dependencies: false,
|
|
364
|
-
related: false,
|
|
365
|
-
});
|
|
366
|
-
const isAnyRelationshipMenuOpen =
|
|
367
|
-
relationshipMenusOpen.parent ||
|
|
368
|
-
relationshipMenusOpen.dependencies ||
|
|
369
|
-
relationshipMenusOpen.related;
|
|
370
|
-
const cardElementRef = useRef<HTMLDivElement | null>(null);
|
|
371
|
-
|
|
372
|
-
// Use extracted dialog state management hook
|
|
373
|
-
const { state: dialogState, actions: dialogActions } = useTaskDialogState();
|
|
374
|
-
const { createSubtask } = useTaskDialogContext();
|
|
375
|
-
|
|
376
|
-
// Use centralized task dialog
|
|
377
|
-
const { openTask, openTaskById } = useTaskDialog();
|
|
378
|
-
|
|
379
|
-
// Guarded select handler for Radix DropdownMenuItem to avoid immediate action on context open
|
|
380
|
-
const handleMenuItemSelect = useCallback(
|
|
381
|
-
(e: Event, action: () => void) => {
|
|
382
|
-
if (Date.now() < menuGuardUntil) {
|
|
383
|
-
// Keep menu open by preventing default close
|
|
384
|
-
if (e && typeof (e as any).preventDefault === 'function') {
|
|
385
|
-
(e as any).preventDefault();
|
|
386
|
-
}
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
action();
|
|
390
|
-
},
|
|
391
|
-
[menuGuardUntil]
|
|
392
|
-
);
|
|
393
|
-
|
|
394
|
-
// Use React Query hooks for shared data (cached across all task cards)
|
|
395
|
-
const workspaceContextWsId = workspaceId ?? wsId;
|
|
396
|
-
const { data: boardConfig } = useBoardConfig(boardId, workspaceContextWsId);
|
|
397
|
-
const pageWorkspaceId = workspaceId ?? boardConfig?.ws_id ?? wsId;
|
|
398
|
-
const {
|
|
399
|
-
boardViewableMembersBoardId,
|
|
400
|
-
boardViewableMembersWorkspaceId,
|
|
401
|
-
effectiveWorkspaceId,
|
|
402
|
-
initialAvailableLists,
|
|
403
|
-
isSourceWorkspaceTask,
|
|
404
|
-
taskBoardId,
|
|
405
|
-
} = getTaskCardResourceContext({
|
|
406
|
-
boardId,
|
|
407
|
-
pageWorkspaceId,
|
|
408
|
-
propAvailableLists,
|
|
409
|
-
task,
|
|
410
|
-
});
|
|
411
|
-
const taskProjectIds = useMemo(
|
|
412
|
-
() => task.projects?.map((project) => project.id).filter(Boolean) ?? [],
|
|
413
|
-
[task.projects]
|
|
414
|
-
);
|
|
415
|
-
const taskShareWsId = effectiveWorkspaceId;
|
|
416
|
-
const { data: workspaceLabels = [], isLoading: labelsLoading } =
|
|
417
|
-
useWorkspaceLabels(effectiveWorkspaceId);
|
|
418
|
-
|
|
419
|
-
// Local state for UI interactions
|
|
420
|
-
const [estimationSaving, setEstimationSaving] = useState(false);
|
|
421
|
-
|
|
422
|
-
// Use extracted label management hook
|
|
423
|
-
const {
|
|
424
|
-
toggleTaskLabel,
|
|
425
|
-
createNewLabel,
|
|
426
|
-
newLabelName,
|
|
427
|
-
setNewLabelName,
|
|
428
|
-
newLabelColor,
|
|
429
|
-
setNewLabelColor,
|
|
430
|
-
creatingLabel,
|
|
431
|
-
} = useTaskLabelManagement({
|
|
432
|
-
task,
|
|
433
|
-
boardId,
|
|
434
|
-
workspaceLabels,
|
|
435
|
-
workspaceId: effectiveWorkspaceId,
|
|
436
|
-
selectedTasks,
|
|
437
|
-
isMultiSelectMode,
|
|
438
|
-
onClearSelection,
|
|
439
|
-
labelCacheWorkspaceIds: [
|
|
440
|
-
effectiveWorkspaceId,
|
|
441
|
-
workspaceContextWsId,
|
|
442
|
-
wsId,
|
|
443
|
-
task.source_workspace_id ?? undefined,
|
|
444
|
-
],
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
const openNewLabelDialog = () => {
|
|
448
|
-
setNewLabelColor((previousColor) => getRandomNewLabelColor(previousColor));
|
|
449
|
-
dialogActions.openNewLabelDialog();
|
|
450
|
-
};
|
|
451
|
-
|
|
452
|
-
// Fetch workspace projects
|
|
453
|
-
const { data: workspaceProjects = [], isLoading: projectsLoading } = useQuery(
|
|
454
|
-
{
|
|
455
|
-
queryKey: [
|
|
456
|
-
'task_projects',
|
|
457
|
-
effectiveWorkspaceId,
|
|
458
|
-
isSourceWorkspaceTask ? taskProjectIds.join(',') : 'all',
|
|
459
|
-
],
|
|
460
|
-
queryFn: async () => {
|
|
461
|
-
if (!effectiveWorkspaceId) return [];
|
|
462
|
-
if (isSourceWorkspaceTask) {
|
|
463
|
-
return listWorkspaceTaskProjectsByIds(
|
|
464
|
-
effectiveWorkspaceId,
|
|
465
|
-
taskProjectIds
|
|
466
|
-
);
|
|
467
|
-
}
|
|
468
|
-
return listWorkspaceTaskProjects(effectiveWorkspaceId);
|
|
469
|
-
},
|
|
470
|
-
enabled:
|
|
471
|
-
!!effectiveWorkspaceId &&
|
|
472
|
-
(!isSourceWorkspaceTask || taskProjectIds.length > 0),
|
|
473
|
-
staleTime: 5 * 60 * 1000, // 5 minutes - projects rarely change
|
|
474
|
-
}
|
|
475
|
-
);
|
|
476
|
-
|
|
477
|
-
// Use extracted project management hook
|
|
478
|
-
const {
|
|
479
|
-
toggleTaskProject,
|
|
480
|
-
newProjectName,
|
|
481
|
-
setNewProjectName,
|
|
482
|
-
creatingProject,
|
|
483
|
-
createNewProject,
|
|
484
|
-
} = useTaskProjectManagement({
|
|
485
|
-
task,
|
|
486
|
-
boardId,
|
|
487
|
-
workspaceProjects,
|
|
488
|
-
workspaceId: effectiveWorkspaceId,
|
|
489
|
-
selectedTasks,
|
|
490
|
-
isMultiSelectMode,
|
|
491
|
-
onClearSelection,
|
|
492
|
-
});
|
|
493
|
-
const shouldUseBoardAssignees = canUseBoardAssignees ?? !isPersonalWorkspace;
|
|
494
|
-
const effectiveAssigneeMemberSource =
|
|
495
|
-
assigneeMemberSource ?? (isPersonalWorkspace ? 'board' : 'workspace');
|
|
496
|
-
const shouldLoadWorkspaceMembers =
|
|
497
|
-
shouldUseBoardAssignees && effectiveAssigneeMemberSource !== 'board';
|
|
498
|
-
const shouldLoadBoardViewableMembers =
|
|
499
|
-
shouldUseBoardAssignees && effectiveAssigneeMemberSource !== 'workspace';
|
|
500
|
-
|
|
501
|
-
// Fetch workspace members
|
|
502
|
-
const normalMembersQuery = useWorkspaceMembers(effectiveWorkspaceId, {
|
|
503
|
-
enabled: !!effectiveWorkspaceId && shouldLoadWorkspaceMembers,
|
|
504
|
-
});
|
|
505
|
-
const boardViewableMembersQuery = useQuery({
|
|
506
|
-
queryKey: [
|
|
507
|
-
'task-board-viewable-members',
|
|
508
|
-
boardViewableMembersWorkspaceId,
|
|
509
|
-
boardViewableMembersBoardId,
|
|
510
|
-
],
|
|
511
|
-
queryFn: async (): Promise<WorkspaceMember[]> => {
|
|
512
|
-
if (!boardViewableMembersWorkspaceId || !boardViewableMembersBoardId) {
|
|
513
|
-
return [];
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
const payload = await listWorkspaceTaskBoardViewableMembers(
|
|
517
|
-
boardViewableMembersWorkspaceId,
|
|
518
|
-
boardViewableMembersBoardId
|
|
519
|
-
);
|
|
520
|
-
const members = Array.isArray(payload?.members) ? payload.members : [];
|
|
521
|
-
|
|
522
|
-
return members.map((member) => ({
|
|
523
|
-
id: member.user_id,
|
|
524
|
-
user_id: member.user_id,
|
|
525
|
-
workspace_id: boardViewableMembersWorkspaceId,
|
|
526
|
-
display_name: member.display_name ?? member.email ?? member.user_id,
|
|
527
|
-
email: member.email ?? undefined,
|
|
528
|
-
avatar_url: member.avatar_url ?? undefined,
|
|
529
|
-
}));
|
|
530
|
-
},
|
|
531
|
-
enabled:
|
|
532
|
-
!!boardViewableMembersWorkspaceId &&
|
|
533
|
-
!!boardViewableMembersBoardId &&
|
|
534
|
-
shouldLoadBoardViewableMembers,
|
|
535
|
-
staleTime: 5 * 60 * 1000,
|
|
536
|
-
});
|
|
537
|
-
const normalWorkspaceMembers = normalMembersQuery.data ?? [];
|
|
538
|
-
const boardViewableMembers = boardViewableMembersQuery.data ?? [];
|
|
539
|
-
const workspaceMembers = useMemo(() => {
|
|
540
|
-
const seen = new Set<string>();
|
|
541
|
-
const merged: WorkspaceMember[] = [];
|
|
542
|
-
|
|
543
|
-
for (const member of [...normalWorkspaceMembers, ...boardViewableMembers]) {
|
|
544
|
-
const memberId = member.user_id ?? member.id;
|
|
545
|
-
if (!memberId || seen.has(memberId)) continue;
|
|
546
|
-
seen.add(memberId);
|
|
547
|
-
merged.push(member);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
return merged;
|
|
551
|
-
}, [boardViewableMembers, normalWorkspaceMembers]);
|
|
552
|
-
const membersLoading =
|
|
553
|
-
normalMembersQuery.isLoading || boardViewableMembersQuery.isLoading;
|
|
554
|
-
|
|
555
|
-
const relationshipSummary =
|
|
556
|
-
task.relationship_summary ??
|
|
557
|
-
({
|
|
558
|
-
parent_task_id: null,
|
|
559
|
-
parent_task: null,
|
|
560
|
-
child_count: 0,
|
|
561
|
-
completed_child_count: 0,
|
|
562
|
-
blocked_by_count: 0,
|
|
563
|
-
blocking_count: 0,
|
|
564
|
-
related_count: 0,
|
|
565
|
-
} as const);
|
|
566
|
-
const shouldLoadRelationshipPreview =
|
|
567
|
-
isInViewport &&
|
|
568
|
-
(isAnyRelationshipMenuOpen || relationshipSummary.blocked_by_count > 0);
|
|
569
|
-
|
|
570
|
-
// Use task relationships hook for managing parent/child/blocking/related tasks
|
|
571
|
-
const {
|
|
572
|
-
parentTask,
|
|
573
|
-
childTasks,
|
|
574
|
-
blocking: blockingTasks,
|
|
575
|
-
blockedBy: blockedByTasks,
|
|
576
|
-
relatedTasks,
|
|
577
|
-
setParentTask,
|
|
578
|
-
removeParentTask,
|
|
579
|
-
addBlockingTask,
|
|
580
|
-
removeBlockingTask,
|
|
581
|
-
addBlockedByTask,
|
|
582
|
-
removeBlockedByTask,
|
|
583
|
-
addRelatedTask,
|
|
584
|
-
removeRelatedTask,
|
|
585
|
-
isSaving: relationshipSaving,
|
|
586
|
-
savingTaskId: relationshipSavingTaskId,
|
|
587
|
-
hasLoadedRelationships,
|
|
588
|
-
} = useTaskCardRelationships({
|
|
589
|
-
taskId: task.id,
|
|
590
|
-
boardId,
|
|
591
|
-
wsId: effectiveWorkspaceId,
|
|
592
|
-
enabled: shouldLoadRelationshipPreview,
|
|
593
|
-
});
|
|
594
|
-
|
|
595
|
-
const summaryParentTaskId = relationshipSummary.parent_task_id;
|
|
596
|
-
const summaryParentTask = relationshipSummary.parent_task ?? null;
|
|
597
|
-
const { data: cachedBoardParentTask } = useQuery({
|
|
598
|
-
queryKey: ['tasks', boardId],
|
|
599
|
-
queryFn: async () => [] as Task[],
|
|
600
|
-
enabled: false,
|
|
601
|
-
select: (tasks: Task[]) => {
|
|
602
|
-
if (!summaryParentTaskId) {
|
|
603
|
-
return null;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
const match = tasks.find(
|
|
607
|
-
(candidate) => candidate.id === summaryParentTaskId
|
|
608
|
-
);
|
|
609
|
-
if (!match) {
|
|
610
|
-
return null;
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
return {
|
|
614
|
-
id: match.id,
|
|
615
|
-
name: match.name,
|
|
616
|
-
display_number: match.display_number,
|
|
617
|
-
ticket_prefix:
|
|
618
|
-
'ticket_prefix' in match && typeof match.ticket_prefix === 'string'
|
|
619
|
-
? match.ticket_prefix
|
|
620
|
-
: (boardConfig?.ticket_prefix ?? null),
|
|
621
|
-
};
|
|
622
|
-
},
|
|
623
|
-
});
|
|
624
|
-
const shouldHydrateParentTask =
|
|
625
|
-
isInViewport &&
|
|
626
|
-
!!effectiveWorkspaceId &&
|
|
627
|
-
!!summaryParentTaskId &&
|
|
628
|
-
!summaryParentTask &&
|
|
629
|
-
!cachedBoardParentTask &&
|
|
630
|
-
(!parentTask || parentTask.id !== summaryParentTaskId);
|
|
631
|
-
const { data: hydratedParentTask } = useQuery({
|
|
632
|
-
queryKey: [
|
|
633
|
-
'task-parent-summary',
|
|
634
|
-
effectiveWorkspaceId,
|
|
635
|
-
summaryParentTaskId ?? 'none',
|
|
636
|
-
],
|
|
637
|
-
queryFn: async () => {
|
|
638
|
-
if (!effectiveWorkspaceId || !summaryParentTaskId) {
|
|
639
|
-
return null;
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
const response = await enqueueTaskCardRelationshipRequest(() =>
|
|
643
|
-
getWorkspaceTask(effectiveWorkspaceId, summaryParentTaskId)
|
|
644
|
-
);
|
|
645
|
-
const fetchedTask = response.task;
|
|
646
|
-
|
|
647
|
-
return {
|
|
648
|
-
id: fetchedTask.id,
|
|
649
|
-
name: fetchedTask.name,
|
|
650
|
-
display_number: fetchedTask.display_number,
|
|
651
|
-
ticket_prefix:
|
|
652
|
-
'ticket_prefix' in fetchedTask &&
|
|
653
|
-
typeof fetchedTask.ticket_prefix === 'string'
|
|
654
|
-
? fetchedTask.ticket_prefix
|
|
655
|
-
: fetchedTask.board_id === boardId
|
|
656
|
-
? (boardConfig?.ticket_prefix ?? null)
|
|
657
|
-
: null,
|
|
658
|
-
};
|
|
659
|
-
},
|
|
660
|
-
enabled: shouldHydrateParentTask,
|
|
661
|
-
staleTime: 5 * 60 * 1000,
|
|
662
|
-
});
|
|
663
|
-
const [resolvedParentTask, setResolvedParentTask] = useState(
|
|
664
|
-
summaryParentTask ?? parentTask
|
|
665
|
-
);
|
|
666
|
-
|
|
667
|
-
useEffect(() => {
|
|
668
|
-
if (parentTask?.id && parentTask.id === summaryParentTaskId) {
|
|
669
|
-
setResolvedParentTask(parentTask);
|
|
670
|
-
return;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
if (summaryParentTask?.id && summaryParentTask.id === summaryParentTaskId) {
|
|
674
|
-
setResolvedParentTask(summaryParentTask);
|
|
675
|
-
return;
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
if (
|
|
679
|
-
cachedBoardParentTask?.id &&
|
|
680
|
-
cachedBoardParentTask.id === summaryParentTaskId
|
|
681
|
-
) {
|
|
682
|
-
setResolvedParentTask(cachedBoardParentTask);
|
|
683
|
-
return;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
if (
|
|
687
|
-
hydratedParentTask?.id &&
|
|
688
|
-
hydratedParentTask.id === summaryParentTaskId
|
|
689
|
-
) {
|
|
690
|
-
setResolvedParentTask(hydratedParentTask);
|
|
691
|
-
return;
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
if (!summaryParentTaskId) {
|
|
695
|
-
setResolvedParentTask(null);
|
|
696
|
-
}
|
|
697
|
-
}, [
|
|
698
|
-
cachedBoardParentTask,
|
|
699
|
-
hydratedParentTask,
|
|
700
|
-
parentTask,
|
|
701
|
-
summaryParentTask,
|
|
702
|
-
summaryParentTaskId,
|
|
703
|
-
]);
|
|
704
|
-
|
|
705
|
-
const { hasParentRelationship, parentBadgeTask } =
|
|
706
|
-
getTaskCardParentBadgeState({
|
|
707
|
-
summaryParentTaskId,
|
|
708
|
-
summaryParentTask,
|
|
709
|
-
parentTask,
|
|
710
|
-
resolvedParentTask,
|
|
711
|
-
hasLoadedRelationships,
|
|
712
|
-
});
|
|
713
|
-
const childTaskCount = hasLoadedRelationships
|
|
714
|
-
? childTasks.length
|
|
715
|
-
: relationshipSummary.child_count;
|
|
716
|
-
const completedChildTaskCount = hasLoadedRelationships
|
|
717
|
-
? childTasks.filter((childTask) => childTask.completed).length
|
|
718
|
-
: (relationshipSummary.completed_child_count ?? 0);
|
|
719
|
-
const blockedByCount = hasLoadedRelationships
|
|
720
|
-
? blockedByTasks.length
|
|
721
|
-
: relationshipSummary.blocked_by_count;
|
|
722
|
-
const blockingCount = hasLoadedRelationships
|
|
723
|
-
? blockingTasks.length
|
|
724
|
-
: relationshipSummary.blocking_count;
|
|
725
|
-
const relatedTaskCount = hasLoadedRelationships
|
|
726
|
-
? relatedTasks.length
|
|
727
|
-
: relationshipSummary.related_count;
|
|
728
|
-
const parentBadgeIdentifier = parentBadgeTask
|
|
729
|
-
? formatRelationshipTaskIdentifier(parentBadgeTask)
|
|
730
|
-
: null;
|
|
731
|
-
const blockedByPreviewTasks = useMemo(() => {
|
|
732
|
-
if (!hasLoadedRelationships) {
|
|
733
|
-
return [];
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
return [...blockedByTasks]
|
|
737
|
-
.sort((left, right) => {
|
|
738
|
-
const leftCompleted = left.completed ? 1 : 0;
|
|
739
|
-
const rightCompleted = right.completed ? 1 : 0;
|
|
740
|
-
if (leftCompleted !== rightCompleted) {
|
|
741
|
-
return leftCompleted - rightCompleted;
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
return left.name.localeCompare(right.name);
|
|
745
|
-
})
|
|
746
|
-
.slice(0, 1);
|
|
747
|
-
}, [blockedByTasks, hasLoadedRelationships]);
|
|
748
|
-
const primaryBlockedByTask = blockedByPreviewTasks[0] ?? null;
|
|
749
|
-
const primaryBlockedByTaskIdentifier = primaryBlockedByTask
|
|
750
|
-
? formatRelationshipTaskIdentifier(primaryBlockedByTask)
|
|
751
|
-
: null;
|
|
752
|
-
const blockedByOverflowCount = Math.max(
|
|
753
|
-
0,
|
|
754
|
-
blockedByCount - blockedByPreviewTasks.length
|
|
755
|
-
);
|
|
756
|
-
const showBlockedByCallout =
|
|
757
|
-
blockedByCount > 0 && !(task.closed_at || task.completed_at);
|
|
758
|
-
|
|
759
|
-
// Fetch available task lists using React Query (same key as other components)
|
|
760
|
-
const { data: availableLists = [] } = useQuery({
|
|
761
|
-
queryKey: ['task_lists', taskBoardId],
|
|
762
|
-
queryFn: async () => {
|
|
763
|
-
if (!effectiveWorkspaceId || !taskBoardId) {
|
|
764
|
-
return [];
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
const { lists } = await listWorkspaceTaskLists(
|
|
768
|
-
effectiveWorkspaceId,
|
|
769
|
-
taskBoardId,
|
|
770
|
-
typeof window !== 'undefined'
|
|
771
|
-
? { baseUrl: window.location.origin }
|
|
772
|
-
: undefined
|
|
773
|
-
);
|
|
774
|
-
|
|
775
|
-
return lists.filter((list) => !list.deleted) as TaskList[];
|
|
776
|
-
},
|
|
777
|
-
enabled: !initialAvailableLists && !!effectiveWorkspaceId && !!taskBoardId,
|
|
778
|
-
initialData: initialAvailableLists,
|
|
779
|
-
staleTime: 60 * 1000, // 1 minute - lists change less frequently
|
|
780
|
-
});
|
|
781
|
-
|
|
782
|
-
// Find the first list with 'done' or 'closed' status
|
|
783
|
-
const getTargetCompletionList = () => {
|
|
784
|
-
const doneList = availableLists.find(
|
|
785
|
-
(list) => list.status === 'done' && !list.deleted
|
|
786
|
-
);
|
|
787
|
-
const closedList = availableLists.find(
|
|
788
|
-
(list) => list.status === 'closed' && !list.deleted
|
|
789
|
-
);
|
|
790
|
-
return doneList || closedList || null;
|
|
791
|
-
};
|
|
792
|
-
|
|
793
|
-
const duplicateTaskMutation = useMutation({
|
|
794
|
-
mutationFn: async (tasksToDuplicate: Task[]) => {
|
|
795
|
-
if (!effectiveWorkspaceId) {
|
|
796
|
-
throw new Error('Workspace ID is required to duplicate tasks');
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
const duplicatedTasks: Task[] = [];
|
|
800
|
-
|
|
801
|
-
for (const sourceTask of tasksToDuplicate) {
|
|
802
|
-
const taskData: Parameters<typeof createTask>[2] = {
|
|
803
|
-
name: sourceTask.name.trim(),
|
|
804
|
-
description: sourceTask.description,
|
|
805
|
-
priority: sourceTask.priority,
|
|
806
|
-
start_date: sourceTask.start_date,
|
|
807
|
-
end_date: sourceTask.end_date,
|
|
808
|
-
estimation_points: sourceTask.estimation_points ?? null,
|
|
809
|
-
label_ids: sourceTask.labels?.map((label) => label.id) ?? [],
|
|
810
|
-
assignee_ids:
|
|
811
|
-
sourceTask.assignees?.map((assignee) => assignee.id) ?? [],
|
|
812
|
-
project_ids: sourceTask.projects?.map((project) => project.id) ?? [],
|
|
813
|
-
};
|
|
814
|
-
|
|
815
|
-
const newTask = await createTask(
|
|
816
|
-
effectiveWorkspaceId,
|
|
817
|
-
sourceTask.list_id,
|
|
818
|
-
taskData
|
|
819
|
-
);
|
|
820
|
-
|
|
821
|
-
duplicatedTasks.push({
|
|
822
|
-
...newTask,
|
|
823
|
-
assignees: sourceTask.assignees,
|
|
824
|
-
labels: sourceTask.labels,
|
|
825
|
-
projects: sourceTask.projects,
|
|
826
|
-
});
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
return duplicatedTasks;
|
|
830
|
-
},
|
|
831
|
-
onSuccess: (duplicatedTasks) => {
|
|
832
|
-
const localMutationAt = Date.now();
|
|
833
|
-
const locallyDuplicatedTasks = duplicatedTasks.map(
|
|
834
|
-
(duplicatedTask) =>
|
|
835
|
-
({
|
|
836
|
-
...(duplicatedTask as Task & { _localMutationAt?: number }),
|
|
837
|
-
_localMutationAt: localMutationAt,
|
|
838
|
-
}) as Task
|
|
839
|
-
);
|
|
840
|
-
|
|
841
|
-
queryClient.setQueryData(
|
|
842
|
-
['tasks', boardId],
|
|
843
|
-
(old: Task[] | undefined) => {
|
|
844
|
-
if (!old) return locallyDuplicatedTasks;
|
|
845
|
-
const newTasks = locallyDuplicatedTasks.filter(
|
|
846
|
-
(newTask) => !old.some((task) => task.id === newTask.id)
|
|
847
|
-
);
|
|
848
|
-
return [...old, ...newTasks];
|
|
849
|
-
}
|
|
850
|
-
);
|
|
851
|
-
|
|
852
|
-
for (const duplicatedTask of locallyDuplicatedTasks) {
|
|
853
|
-
broadcast?.('task:upsert', { task: duplicatedTask });
|
|
854
|
-
if (
|
|
855
|
-
(duplicatedTask.assignees && duplicatedTask.assignees.length > 0) ||
|
|
856
|
-
(duplicatedTask.labels && duplicatedTask.labels.length > 0) ||
|
|
857
|
-
(duplicatedTask.projects && duplicatedTask.projects.length > 0)
|
|
858
|
-
) {
|
|
859
|
-
broadcast?.('task:relations-changed', {
|
|
860
|
-
taskId: duplicatedTask.id,
|
|
861
|
-
});
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
toast.success(
|
|
866
|
-
t('tasks_duplicated_successfully', { count: duplicatedTasks.length })
|
|
867
|
-
);
|
|
868
|
-
},
|
|
869
|
-
onError: (error) => {
|
|
870
|
-
console.error('Error duplicating task(s):', error);
|
|
871
|
-
toast.error(
|
|
872
|
-
error instanceof Error ? error.message : t('please_try_again_later')
|
|
873
|
-
);
|
|
874
|
-
},
|
|
875
|
-
onSettled: () => {
|
|
876
|
-
setIsLoading(false);
|
|
877
|
-
},
|
|
878
|
-
});
|
|
879
|
-
|
|
880
|
-
// Find specifically the closed list
|
|
881
|
-
const getTargetClosedList = () => {
|
|
882
|
-
return (
|
|
883
|
-
availableLists.find(
|
|
884
|
-
(list) => list.status === 'closed' && !list.deleted
|
|
885
|
-
) || null
|
|
886
|
-
);
|
|
887
|
-
};
|
|
888
|
-
|
|
889
|
-
const targetCompletionList = getTargetCompletionList();
|
|
890
|
-
const targetClosedList = getTargetClosedList();
|
|
891
|
-
const canMoveToCompletion =
|
|
892
|
-
targetCompletionList && targetCompletionList.id !== task.list_id;
|
|
893
|
-
const canMoveToClose =
|
|
894
|
-
targetClosedList && targetClosedList.id !== task.list_id;
|
|
895
|
-
const isDocumentList = taskList?.status === 'documents';
|
|
896
|
-
const canQuickArchive = shouldRenderTaskCardQuickArchive({
|
|
897
|
-
hasTargetClosedList: Boolean(canMoveToClose),
|
|
898
|
-
isOverlay: Boolean(isOverlay),
|
|
899
|
-
taskListStatus: taskList?.status,
|
|
900
|
-
});
|
|
901
|
-
const canShowCloseAction =
|
|
902
|
-
Boolean(canMoveToClose) &&
|
|
903
|
-
(isDocumentList || targetClosedList?.id !== targetCompletionList?.id);
|
|
904
|
-
const quickArchiveToneClass = taskList?.color
|
|
905
|
-
? DESTINATION_TONE_COLORS[taskList.color]
|
|
906
|
-
: DESTINATION_TONE_COLORS.GRAY;
|
|
907
|
-
|
|
908
|
-
// Check if task is optimistically added (pending realtime confirmation)
|
|
909
|
-
const isOptimistic = '_isOptimistic' in task && task._isOptimistic === true;
|
|
910
|
-
const isPersonalExternalTask = isExternalTaskSnapshot(task);
|
|
911
|
-
const isPersonalExternalOverlay = isPersonalExternalOverlayTask(task);
|
|
912
|
-
const sourceBoardUrl =
|
|
913
|
-
task.source_workspace_id && task.source_board_id
|
|
914
|
-
? `/${task.source_workspace_id}${tasksHref(`/boards/${task.source_board_id}`)}`
|
|
915
|
-
: null;
|
|
916
|
-
const taskTicketPrefix =
|
|
917
|
-
'ticket_prefix' in task && typeof task.ticket_prefix === 'string'
|
|
918
|
-
? task.ticket_prefix
|
|
919
|
-
: null;
|
|
920
|
-
const taskTicketIdentifier = getTicketIdentifier(
|
|
921
|
-
isPersonalExternalTask ? taskTicketPrefix : boardConfig?.ticket_prefix,
|
|
922
|
-
task.display_number
|
|
923
|
-
);
|
|
924
|
-
const externalSourceLabel =
|
|
925
|
-
task.source_workspace_name ??
|
|
926
|
-
task.source_board_name ??
|
|
927
|
-
tTasks('external_task');
|
|
928
|
-
|
|
929
|
-
const dragDisabled =
|
|
930
|
-
dragDisabledProp ||
|
|
931
|
-
dialogState.editDialogOpen ||
|
|
932
|
-
dialogState.deleteDialogOpen ||
|
|
933
|
-
dialogState.customDateDialogOpen ||
|
|
934
|
-
dialogState.newLabelDialogOpen ||
|
|
935
|
-
dialogState.newProjectDialogOpen ||
|
|
936
|
-
menuOpen ||
|
|
937
|
-
isOptimistic; // Disable drag for optimistic tasks until confirmed
|
|
938
|
-
|
|
939
|
-
const sortableDisabled = dragDisabled || isOverlay;
|
|
940
|
-
const sortableId = isOverlay
|
|
941
|
-
? `${task.id}:drag-overlay`
|
|
942
|
-
: (sortableIdProp ?? task.id);
|
|
943
|
-
const {
|
|
944
|
-
setNodeRef,
|
|
945
|
-
attributes,
|
|
946
|
-
listeners,
|
|
947
|
-
transform,
|
|
948
|
-
transition,
|
|
949
|
-
isDragging,
|
|
950
|
-
} = useSortable({
|
|
951
|
-
id: sortableId,
|
|
952
|
-
data: {
|
|
953
|
-
type: 'Task',
|
|
954
|
-
task: {
|
|
955
|
-
...task,
|
|
956
|
-
list_id: String(task.list_id),
|
|
957
|
-
},
|
|
958
|
-
},
|
|
959
|
-
disabled: sortableDisabled,
|
|
960
|
-
});
|
|
961
|
-
|
|
962
|
-
const cardVisibilityState = getTaskCardVisibilityState({
|
|
963
|
-
isDragging,
|
|
964
|
-
optimisticUpdateInProgress:
|
|
965
|
-
optimisticUpdateInProgress?.has(task.id) ?? false,
|
|
966
|
-
});
|
|
967
|
-
|
|
968
|
-
const setCardRefs = useCallback(
|
|
969
|
-
(node: HTMLDivElement | null) => {
|
|
970
|
-
cardElementRef.current = node;
|
|
971
|
-
setNodeRef(node);
|
|
972
|
-
},
|
|
973
|
-
[setNodeRef]
|
|
974
|
-
);
|
|
975
|
-
|
|
976
|
-
useEffect(() => {
|
|
977
|
-
const node = cardElementRef.current;
|
|
978
|
-
if (!node) return;
|
|
979
|
-
|
|
980
|
-
if (typeof IntersectionObserver === 'undefined') {
|
|
981
|
-
setIsInViewport(true);
|
|
982
|
-
return;
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
const observer = new IntersectionObserver(
|
|
986
|
-
([entry]) => {
|
|
987
|
-
if (!entry) {
|
|
988
|
-
return;
|
|
989
|
-
}
|
|
990
|
-
setIsInViewport(entry.isIntersecting);
|
|
991
|
-
},
|
|
992
|
-
{
|
|
993
|
-
rootMargin: '220px 0px',
|
|
994
|
-
threshold: 0.05,
|
|
995
|
-
}
|
|
996
|
-
);
|
|
997
|
-
|
|
998
|
-
observer.observe(node);
|
|
999
|
-
return () => observer.disconnect();
|
|
1000
|
-
}, []);
|
|
1001
|
-
|
|
1002
|
-
const style: React.CSSProperties = {
|
|
1003
|
-
transform:
|
|
1004
|
-
isOverlay || isDragging || suppressSortableTransform
|
|
1005
|
-
? 'translate3d(0, 0, 0)'
|
|
1006
|
-
: CSS.Transform.toString(transform),
|
|
1007
|
-
transition: isOverlay || suppressSortableTransform ? 'none' : transition,
|
|
1008
|
-
height: 'var(--task-height)',
|
|
1009
|
-
background: isOverlay || isDragging ? 'var(--card)' : undefined,
|
|
1010
|
-
// Show reduced opacity for optimistic tasks (pending realtime confirmation)
|
|
1011
|
-
opacity: isOverlay ? 1 : isOptimistic ? 0.6 : undefined,
|
|
1012
|
-
};
|
|
1013
|
-
|
|
1014
|
-
const now = useMemo(() => new Date(deadlineNow ?? Date.now()), [deadlineNow]);
|
|
1015
|
-
const shouldRenderDueDate = shouldShowTaskDueDate({
|
|
1016
|
-
completedAt: task.completed_at,
|
|
1017
|
-
closedAt: task.closed_at,
|
|
1018
|
-
dueDate: task.end_date,
|
|
1019
|
-
listStatus: taskList?.status,
|
|
1020
|
-
showReviewDueDates,
|
|
1021
|
-
});
|
|
1022
|
-
const shouldRenderStartDate = shouldShowTaskStartDate({
|
|
1023
|
-
completedAt: task.completed_at,
|
|
1024
|
-
closedAt: task.closed_at,
|
|
1025
|
-
listStatus: taskList?.status,
|
|
1026
|
-
startDate: task.start_date,
|
|
1027
|
-
});
|
|
1028
|
-
const isOverdue = Boolean(
|
|
1029
|
-
shouldRenderDueDate && task.end_date && new Date(task.end_date) < now
|
|
1030
|
-
);
|
|
1031
|
-
const isResolvedListStatus = isTaskBoardResolvedStatus(taskList?.status);
|
|
1032
|
-
const startDate = task.start_date ? new Date(task.start_date) : null;
|
|
1033
|
-
const endDate = task.end_date ? new Date(task.end_date) : null;
|
|
1034
|
-
const upcomingDeadlineCountdown =
|
|
1035
|
-
deadlineContext === 'upcoming' && endDate
|
|
1036
|
-
? formatDistance(endDate, now, {
|
|
1037
|
-
addSuffix: true,
|
|
1038
|
-
locale: dateLocale,
|
|
1039
|
-
})
|
|
1040
|
-
: null;
|
|
1041
|
-
const upcomingDeadlineExactDate = endDate
|
|
1042
|
-
? format(endDate, `MMM dd '${t('at')}' ${timePattern}`, {
|
|
1043
|
-
locale: dateLocale,
|
|
1044
|
-
})
|
|
1045
|
-
: null;
|
|
1046
|
-
const selectionCheckboxClassName = cn(
|
|
1047
|
-
getTaskCardSelectionCheckboxToneClasses(taskList?.color as SupportedColor),
|
|
1048
|
-
isOverdue &&
|
|
1049
|
-
!task.closed_at &&
|
|
1050
|
-
!isResolvedListStatus &&
|
|
1051
|
-
TASK_CARD_OVERDUE_CHECKBOX_TONE_CLASSES
|
|
1052
|
-
);
|
|
1053
|
-
|
|
1054
|
-
// Memoize description metadata to prevent unnecessary recalculations
|
|
1055
|
-
// This is important because descriptionMeta is used in taskBadges dependency array
|
|
1056
|
-
const descriptionMeta = useMemo(
|
|
1057
|
-
() => getDescriptionMetadata(task.description),
|
|
1058
|
-
[task.description]
|
|
1059
|
-
);
|
|
1060
|
-
|
|
1061
|
-
// Helper function to get card color classes
|
|
1062
|
-
const getCardColorClasses = () =>
|
|
1063
|
-
getCardColorClassesUtil(taskList, task.priority);
|
|
1064
|
-
|
|
1065
|
-
// Use the extracted task actions hook
|
|
1066
|
-
const {
|
|
1067
|
-
handleArchiveToggle,
|
|
1068
|
-
handleMoveToCompletion,
|
|
1069
|
-
handleMoveToClose,
|
|
1070
|
-
handleDelete,
|
|
1071
|
-
handleMoveToList,
|
|
1072
|
-
handleDueDateChange,
|
|
1073
|
-
handlePriorityChange,
|
|
1074
|
-
updateEstimationPoints,
|
|
1075
|
-
handleCustomDateChange,
|
|
1076
|
-
handleToggleAssignee,
|
|
1077
|
-
} = useTaskActions({
|
|
1078
|
-
task,
|
|
1079
|
-
boardId,
|
|
1080
|
-
workspaceId: effectiveWorkspaceId,
|
|
1081
|
-
targetCompletionList,
|
|
1082
|
-
targetClosedList,
|
|
1083
|
-
availableLists,
|
|
1084
|
-
onUpdate,
|
|
1085
|
-
setIsLoading,
|
|
1086
|
-
setMenuOpen,
|
|
1087
|
-
setCustomDateDialogOpen: (open: boolean) =>
|
|
1088
|
-
open
|
|
1089
|
-
? dialogActions.openCustomDateDialog()
|
|
1090
|
-
: dialogActions.closeCustomDateDialog(),
|
|
1091
|
-
setDeleteDialogOpen: (open: boolean) =>
|
|
1092
|
-
open
|
|
1093
|
-
? dialogActions.openDeleteDialog()
|
|
1094
|
-
: dialogActions.closeDeleteDialog(),
|
|
1095
|
-
setEstimationSaving,
|
|
1096
|
-
selectedTasks,
|
|
1097
|
-
isMultiSelectMode,
|
|
1098
|
-
onClearSelection,
|
|
1099
|
-
bulkUpdateCustomDueDate,
|
|
1100
|
-
});
|
|
1101
|
-
|
|
1102
|
-
const onToggleAssignee = useCallback(
|
|
1103
|
-
(assigneeId: string) => handleToggleAssignee(assigneeId),
|
|
1104
|
-
[handleToggleAssignee]
|
|
1105
|
-
);
|
|
1106
|
-
|
|
1107
|
-
const quickArchiveButton = canQuickArchive ? (
|
|
1108
|
-
<Tooltip>
|
|
1109
|
-
<TooltipTrigger asChild>
|
|
1110
|
-
<button
|
|
1111
|
-
type="button"
|
|
1112
|
-
aria-label={t('archive')}
|
|
1113
|
-
disabled={isLoading}
|
|
1114
|
-
onPointerDown={(e) => {
|
|
1115
|
-
e.stopPropagation();
|
|
1116
|
-
}}
|
|
1117
|
-
onClick={(e) => {
|
|
1118
|
-
e.preventDefault();
|
|
1119
|
-
e.stopPropagation();
|
|
1120
|
-
void handleMoveToClose();
|
|
1121
|
-
}}
|
|
1122
|
-
className={cn(
|
|
1123
|
-
'flex h-5 w-5 flex-none items-center justify-center rounded-sm border border-transparent transition-all duration-200',
|
|
1124
|
-
quickArchiveToneClass,
|
|
1125
|
-
'hover:scale-110 hover:ring-2 hover:brightness-110',
|
|
1126
|
-
'focus-visible:outline-none focus-visible:ring-2',
|
|
1127
|
-
'disabled:cursor-not-allowed disabled:opacity-60'
|
|
1128
|
-
)}
|
|
1129
|
-
>
|
|
1130
|
-
{isLoading ? (
|
|
1131
|
-
<Loader2 className="h-3.5 w-3.5 animate-spin" />
|
|
1132
|
-
) : (
|
|
1133
|
-
<Archive className="h-3.5 w-3.5" />
|
|
1134
|
-
)}
|
|
1135
|
-
</button>
|
|
1136
|
-
</TooltipTrigger>
|
|
1137
|
-
<TooltipContent side="top" className="text-xs">
|
|
1138
|
-
{t('archive')}
|
|
1139
|
-
</TooltipContent>
|
|
1140
|
-
</Tooltip>
|
|
1141
|
-
) : null;
|
|
1142
|
-
|
|
1143
|
-
// Memoize drag handle for performance
|
|
1144
|
-
// Removed explicit drag handle – entire card is now draggable for better UX.
|
|
1145
|
-
// Keep attributes/listeners to spread onto root interactive area.
|
|
1146
|
-
|
|
1147
|
-
const openExternalTask = useCallback(() => {
|
|
1148
|
-
void openTaskById(
|
|
1149
|
-
task.id,
|
|
1150
|
-
getTaskCardHydratingOpenOptions({
|
|
1151
|
-
task,
|
|
1152
|
-
boardId,
|
|
1153
|
-
availableLists,
|
|
1154
|
-
canUseBoardAssignees: task.source_workspace_id
|
|
1155
|
-
? true
|
|
1156
|
-
: shouldUseBoardAssignees,
|
|
1157
|
-
assigneeMemberSource: task.source_workspace_id
|
|
1158
|
-
? 'board'
|
|
1159
|
-
: effectiveAssigneeMemberSource,
|
|
1160
|
-
effectiveWorkspaceId,
|
|
1161
|
-
isPersonalWorkspace,
|
|
1162
|
-
})
|
|
1163
|
-
);
|
|
1164
|
-
}, [
|
|
1165
|
-
task,
|
|
1166
|
-
boardId,
|
|
1167
|
-
availableLists,
|
|
1168
|
-
shouldUseBoardAssignees,
|
|
1169
|
-
effectiveAssigneeMemberSource,
|
|
1170
|
-
effectiveWorkspaceId,
|
|
1171
|
-
isPersonalWorkspace,
|
|
1172
|
-
openTaskById,
|
|
1173
|
-
]);
|
|
1174
|
-
|
|
1175
|
-
const handleCardClick = useCallback(
|
|
1176
|
-
(e: React.MouseEvent) => {
|
|
1177
|
-
// Check if only Shift is held (without CMD/Ctrl) for multiselect
|
|
1178
|
-
const isShiftOnlyHeld =
|
|
1179
|
-
e.shiftKey && !e.metaKey && !e.ctrlKey && !e.altKey;
|
|
1180
|
-
|
|
1181
|
-
// Handle multi-select functionality only when Shift is held alone
|
|
1182
|
-
if (isMultiSelectMode || isShiftOnlyHeld) {
|
|
1183
|
-
onSelect?.(task.id, e);
|
|
1184
|
-
} else if (
|
|
1185
|
-
!isDragging &&
|
|
1186
|
-
!dialogState.editDialogOpen &&
|
|
1187
|
-
!dialogState.isClosingDialog &&
|
|
1188
|
-
!menuOpen &&
|
|
1189
|
-
!dialogState.deleteDialogOpen &&
|
|
1190
|
-
!dialogState.customDateDialogOpen &&
|
|
1191
|
-
!dialogState.newLabelDialogOpen &&
|
|
1192
|
-
!dialogState.newProjectDialogOpen
|
|
1193
|
-
) {
|
|
1194
|
-
// Only open edit dialog if not in multi-select mode, not dragging, and no other dialogs are open
|
|
1195
|
-
if (isPersonalExternalTask) {
|
|
1196
|
-
openExternalTask();
|
|
1197
|
-
return;
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1200
|
-
openTask(task, boardId, availableLists, false, {
|
|
1201
|
-
taskWsId: effectiveWorkspaceId,
|
|
1202
|
-
taskWorkspacePersonal: isPersonalWorkspace,
|
|
1203
|
-
canUseBoardAssignees: shouldUseBoardAssignees,
|
|
1204
|
-
assigneeMemberSource: effectiveAssigneeMemberSource,
|
|
1205
|
-
});
|
|
1206
|
-
}
|
|
1207
|
-
},
|
|
1208
|
-
[
|
|
1209
|
-
task,
|
|
1210
|
-
boardId,
|
|
1211
|
-
effectiveWorkspaceId,
|
|
1212
|
-
effectiveAssigneeMemberSource,
|
|
1213
|
-
isPersonalWorkspace,
|
|
1214
|
-
shouldUseBoardAssignees,
|
|
1215
|
-
isPersonalExternalTask,
|
|
1216
|
-
isMultiSelectMode,
|
|
1217
|
-
availableLists,
|
|
1218
|
-
isDragging,
|
|
1219
|
-
menuOpen,
|
|
1220
|
-
dialogState,
|
|
1221
|
-
onSelect,
|
|
1222
|
-
openTask,
|
|
1223
|
-
openExternalTask,
|
|
1224
|
-
]
|
|
1225
|
-
);
|
|
1226
|
-
|
|
1227
|
-
// Refs for measuring badge widths
|
|
1228
|
-
const containerRef = useRef<HTMLDivElement>(null);
|
|
1229
|
-
const badgeRefs = useRef<Map<string, HTMLDivElement>>(new Map());
|
|
1230
|
-
const descriptionMetaRef = useRef<HTMLDivElement>(null);
|
|
1231
|
-
const [visibleBadgeCount, setVisibleBadgeCount] = useState(0);
|
|
1232
|
-
|
|
1233
|
-
const handleDuplicateTask = async () => {
|
|
1234
|
-
setIsLoading(true);
|
|
1235
|
-
setMenuOpen(false);
|
|
1236
|
-
|
|
1237
|
-
// Check if we're in multi-select mode and have multiple tasks selected
|
|
1238
|
-
const shouldBulkDuplicate =
|
|
1239
|
-
isMultiSelectMode &&
|
|
1240
|
-
selectedTasks &&
|
|
1241
|
-
selectedTasks.size > 1 &&
|
|
1242
|
-
selectedTasks.has(task.id);
|
|
1243
|
-
|
|
1244
|
-
// Get all tasks data from cache for bulk operations
|
|
1245
|
-
const allTasks =
|
|
1246
|
-
(queryClient.getQueryData<Task[]>(['tasks', boardId]) as Task[]) || [];
|
|
1247
|
-
const tasksToDuplicate = shouldBulkDuplicate
|
|
1248
|
-
? allTasks.filter((t) => selectedTasks?.has(t.id))
|
|
1249
|
-
: [task];
|
|
1250
|
-
|
|
1251
|
-
try {
|
|
1252
|
-
await duplicateTaskMutation.mutateAsync(tasksToDuplicate);
|
|
1253
|
-
} catch {
|
|
1254
|
-
// Error handling is centralized in the mutation callbacks.
|
|
1255
|
-
}
|
|
1256
|
-
};
|
|
1257
|
-
|
|
1258
|
-
const handleAddSubtask = () => {
|
|
1259
|
-
setMenuOpen(false);
|
|
1260
|
-
// Open subtask creation dialog - the relationship will be created when the user saves
|
|
1261
|
-
createSubtask(
|
|
1262
|
-
task.id,
|
|
1263
|
-
task.name,
|
|
1264
|
-
taskBoardId,
|
|
1265
|
-
task.list_id,
|
|
1266
|
-
availableLists
|
|
1267
|
-
);
|
|
1268
|
-
};
|
|
1269
|
-
|
|
1270
|
-
const handleMoveToExternalStaging = async () => {
|
|
1271
|
-
if (!task.personal_board_id) return;
|
|
1272
|
-
|
|
1273
|
-
setIsLoading(true);
|
|
1274
|
-
setMenuOpen(false);
|
|
1275
|
-
|
|
1276
|
-
try {
|
|
1277
|
-
await removeCurrentUserTaskPersonalPlacement(task.id);
|
|
1278
|
-
|
|
1279
|
-
const localMutationAt = Date.now();
|
|
1280
|
-
queryClient.setQueryData(['tasks', boardId], (old: Task[] | undefined) =>
|
|
1281
|
-
old?.map((candidate) =>
|
|
1282
|
-
candidate.id === task.id
|
|
1283
|
-
? {
|
|
1284
|
-
...candidate,
|
|
1285
|
-
list_id: getPersonalExternalStagingListId(
|
|
1286
|
-
task.personal_board_id ?? boardId
|
|
1287
|
-
),
|
|
1288
|
-
sort_key: null,
|
|
1289
|
-
personal_list_id: null,
|
|
1290
|
-
personal_sort_key: null,
|
|
1291
|
-
personal_placed_at: null,
|
|
1292
|
-
is_personal_external: true,
|
|
1293
|
-
is_personal_external_default: true,
|
|
1294
|
-
_localMutationAt: localMutationAt,
|
|
1295
|
-
}
|
|
1296
|
-
: candidate
|
|
1297
|
-
)
|
|
1298
|
-
);
|
|
1299
|
-
|
|
1300
|
-
void invalidateKanbanDeadlineTasks(queryClient, boardId);
|
|
1301
|
-
toast.success(tTasks('moved_to_external_tasks'));
|
|
1302
|
-
} catch (error) {
|
|
1303
|
-
console.error('Failed to move task to external staging:', error);
|
|
1304
|
-
toast.error(tTasks('failed_update_personal_placement'));
|
|
1305
|
-
} finally {
|
|
1306
|
-
setIsLoading(false);
|
|
1307
|
-
}
|
|
1308
|
-
};
|
|
1309
|
-
|
|
1310
|
-
const handleRemoveFromPersonalBoard = async () => {
|
|
1311
|
-
setIsLoading(true);
|
|
1312
|
-
setMenuOpen(false);
|
|
1313
|
-
|
|
1314
|
-
try {
|
|
1315
|
-
await removeCurrentUserTaskPersonalPlacement(task.id);
|
|
1316
|
-
|
|
1317
|
-
queryClient.setQueryData(['tasks', boardId], (old: Task[] | undefined) =>
|
|
1318
|
-
old?.filter((candidate) => candidate.id !== task.id)
|
|
1319
|
-
);
|
|
1320
|
-
|
|
1321
|
-
void invalidateKanbanDeadlineTasks(queryClient, boardId);
|
|
1322
|
-
toast.success(tTasks('removed_from_personal_board'));
|
|
1323
|
-
} catch (error) {
|
|
1324
|
-
console.error('Failed to remove task from personal board:', error);
|
|
1325
|
-
toast.error(tTasks('failed_update_personal_placement'));
|
|
1326
|
-
} finally {
|
|
1327
|
-
setIsLoading(false);
|
|
1328
|
-
}
|
|
1329
|
-
};
|
|
1330
|
-
|
|
1331
|
-
const taskBadges = useMemo(() => {
|
|
1332
|
-
// Collect all badges into an array for overflow handling
|
|
1333
|
-
const badges: { id: string; element: React.ReactNode }[] = [];
|
|
1334
|
-
|
|
1335
|
-
// Priority badge
|
|
1336
|
-
if (task.priority) {
|
|
1337
|
-
badges.push({
|
|
1338
|
-
id: 'priority',
|
|
1339
|
-
element: (
|
|
1340
|
-
<div
|
|
1341
|
-
key="priority"
|
|
1342
|
-
className="flex-none overflow-hidden"
|
|
1343
|
-
ref={(el) => {
|
|
1344
|
-
if (el) badgeRefs.current.set('priority', el);
|
|
1345
|
-
}}
|
|
1346
|
-
>
|
|
1347
|
-
{getPriorityIndicator(task.priority)}
|
|
1348
|
-
</div>
|
|
1349
|
-
),
|
|
1350
|
-
});
|
|
1351
|
-
}
|
|
1352
|
-
|
|
1353
|
-
// Sub-tasks counter badge (checked / total, excludes indeterminate)
|
|
1354
|
-
if (descriptionMeta.totalCheckboxes > 0) {
|
|
1355
|
-
const allChecked =
|
|
1356
|
-
descriptionMeta.checkedCheckboxes === descriptionMeta.totalCheckboxes;
|
|
1357
|
-
badges.push({
|
|
1358
|
-
id: 'subtasks',
|
|
1359
|
-
element: (
|
|
1360
|
-
<Badge
|
|
1361
|
-
key="subtasks"
|
|
1362
|
-
variant="secondary"
|
|
1363
|
-
className={cn(
|
|
1364
|
-
'border font-medium text-[10px]',
|
|
1365
|
-
allChecked
|
|
1366
|
-
? 'border-dynamic-green/30 bg-dynamic-green/15 text-dynamic-green'
|
|
1367
|
-
: 'border-dynamic-gray/30 bg-dynamic-gray/10 text-dynamic-gray'
|
|
1368
|
-
)}
|
|
1369
|
-
title={t('n_subtasks_completed', {
|
|
1370
|
-
checked: descriptionMeta.checkedCheckboxes,
|
|
1371
|
-
total: descriptionMeta.totalCheckboxes,
|
|
1372
|
-
})}
|
|
1373
|
-
ref={(el) => {
|
|
1374
|
-
if (el) badgeRefs.current.set('subtasks', el as any);
|
|
1375
|
-
}}
|
|
1376
|
-
>
|
|
1377
|
-
{allChecked ? (
|
|
1378
|
-
<ListChecks className="h-3 w-3" />
|
|
1379
|
-
) : (
|
|
1380
|
-
<ListTodo className="h-3 w-3" />
|
|
1381
|
-
)}
|
|
1382
|
-
{descriptionMeta.checkedCheckboxes}/
|
|
1383
|
-
{descriptionMeta.totalCheckboxes}
|
|
1384
|
-
</Badge>
|
|
1385
|
-
),
|
|
1386
|
-
});
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
// Indeterminate (abandoned) sub-tasks badge
|
|
1390
|
-
if (descriptionMeta.indeterminateCheckboxes > 0) {
|
|
1391
|
-
badges.push({
|
|
1392
|
-
id: 'indeterminate-subtasks',
|
|
1393
|
-
element: (
|
|
1394
|
-
<Badge
|
|
1395
|
-
key="indeterminate-subtasks"
|
|
1396
|
-
variant="secondary"
|
|
1397
|
-
className="border border-dynamic-orange/30 bg-dynamic-orange/15 font-medium text-[10px] text-dynamic-orange"
|
|
1398
|
-
title={t('n_subtasks_abandoned', {
|
|
1399
|
-
count: descriptionMeta.indeterminateCheckboxes,
|
|
1400
|
-
})}
|
|
1401
|
-
ref={(el) => {
|
|
1402
|
-
if (el)
|
|
1403
|
-
badgeRefs.current.set('indeterminate-subtasks', el as any);
|
|
1404
|
-
}}
|
|
1405
|
-
>
|
|
1406
|
-
<SquareCenterlineDashedVertical className="h-3 w-3" />
|
|
1407
|
-
{descriptionMeta.indeterminateCheckboxes}
|
|
1408
|
-
</Badge>
|
|
1409
|
-
),
|
|
1410
|
-
});
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
// Project indicator badge
|
|
1414
|
-
if (task.projects && task.projects.length > 0) {
|
|
1415
|
-
badges.push({
|
|
1416
|
-
id: 'projects',
|
|
1417
|
-
element: (
|
|
1418
|
-
<div
|
|
1419
|
-
key="projects"
|
|
1420
|
-
className="min-w-0 shrink-0"
|
|
1421
|
-
ref={(el) => {
|
|
1422
|
-
if (el) badgeRefs.current.set('projects', el);
|
|
1423
|
-
}}
|
|
1424
|
-
>
|
|
1425
|
-
<Badge
|
|
1426
|
-
variant="secondary"
|
|
1427
|
-
className={cn(
|
|
1428
|
-
'h-5 border px-2 text-[10px]',
|
|
1429
|
-
'border-dynamic-sky/30 bg-dynamic-sky/10 text-dynamic-sky'
|
|
1430
|
-
)}
|
|
1431
|
-
>
|
|
1432
|
-
<Box className="h-2.5 w-2.5" />
|
|
1433
|
-
{task.projects.length === 1
|
|
1434
|
-
? task.projects[0]?.name
|
|
1435
|
-
: t('n_projects', { count: task.projects.length })}
|
|
1436
|
-
</Badge>
|
|
1437
|
-
</div>
|
|
1438
|
-
),
|
|
1439
|
-
});
|
|
1440
|
-
}
|
|
1441
|
-
|
|
1442
|
-
// Estimation Points badge
|
|
1443
|
-
if (task.estimation_points != null) {
|
|
1444
|
-
badges.push({
|
|
1445
|
-
id: 'estimation',
|
|
1446
|
-
element: (
|
|
1447
|
-
<div
|
|
1448
|
-
key="estimation"
|
|
1449
|
-
className="min-w-0 shrink-0"
|
|
1450
|
-
ref={(el) => {
|
|
1451
|
-
if (el) badgeRefs.current.set('estimation', el);
|
|
1452
|
-
}}
|
|
1453
|
-
>
|
|
1454
|
-
<TaskEstimationDisplay
|
|
1455
|
-
points={task.estimation_points}
|
|
1456
|
-
size="sm"
|
|
1457
|
-
estimationType={boardConfig?.estimation_type}
|
|
1458
|
-
showIcon
|
|
1459
|
-
/>
|
|
1460
|
-
</div>
|
|
1461
|
-
),
|
|
1462
|
-
});
|
|
1463
|
-
}
|
|
1464
|
-
|
|
1465
|
-
if ((task.total_duration ?? 0) > 0) {
|
|
1466
|
-
badges.push({
|
|
1467
|
-
id: 'duration',
|
|
1468
|
-
element: (
|
|
1469
|
-
<TaskSchedulingBadge
|
|
1470
|
-
key="duration"
|
|
1471
|
-
autoSchedule={task.auto_schedule}
|
|
1472
|
-
calendarHours={task.calendar_hours}
|
|
1473
|
-
isSplittable={task.is_splittable}
|
|
1474
|
-
labels={{
|
|
1475
|
-
autoSchedule: taskBoardT('ws-task-boards.dialog.auto_schedule'),
|
|
1476
|
-
estimatedDuration: taskBoardT(
|
|
1477
|
-
'ws-task-boards.dialog.estimated_duration'
|
|
1478
|
-
),
|
|
1479
|
-
meetingHours: taskBoardT('ws-task-boards.dialog.meeting_hours'),
|
|
1480
|
-
personalHours: taskBoardT('ws-task-boards.dialog.personal_hours'),
|
|
1481
|
-
splittable: taskBoardT('ws-task-boards.dialog.splittable'),
|
|
1482
|
-
workHours: taskBoardT('ws-task-boards.dialog.work_hours'),
|
|
1483
|
-
}}
|
|
1484
|
-
maxSplitDurationMinutes={task.max_split_duration_minutes}
|
|
1485
|
-
minSplitDurationMinutes={task.min_split_duration_minutes}
|
|
1486
|
-
onElement={(element) => {
|
|
1487
|
-
if (element) badgeRefs.current.set('duration', element as any);
|
|
1488
|
-
}}
|
|
1489
|
-
totalDuration={task.total_duration}
|
|
1490
|
-
/>
|
|
1491
|
-
),
|
|
1492
|
-
});
|
|
1493
|
-
}
|
|
1494
|
-
|
|
1495
|
-
// Labels badge
|
|
1496
|
-
if (task.labels && task.labels.length > 0) {
|
|
1497
|
-
badges.push({
|
|
1498
|
-
id: 'labels',
|
|
1499
|
-
element: (
|
|
1500
|
-
<div
|
|
1501
|
-
key="labels"
|
|
1502
|
-
className="flex min-w-0 shrink-0 flex-wrap gap-1"
|
|
1503
|
-
ref={(el) => {
|
|
1504
|
-
if (el) badgeRefs.current.set('labels', el);
|
|
1505
|
-
}}
|
|
1506
|
-
>
|
|
1507
|
-
<TaskLabelsDisplay
|
|
1508
|
-
labels={sortByDisplayName(task.labels)}
|
|
1509
|
-
size="sm"
|
|
1510
|
-
hiddenLabelsLabel={t('hidden_labels')}
|
|
1511
|
-
/>
|
|
1512
|
-
</div>
|
|
1513
|
-
),
|
|
1514
|
-
});
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
// Parent task indicator badge
|
|
1518
|
-
if (hasParentRelationship) {
|
|
1519
|
-
badges.push({
|
|
1520
|
-
id: 'parent',
|
|
1521
|
-
element: (
|
|
1522
|
-
<Badge
|
|
1523
|
-
key="parent"
|
|
1524
|
-
variant="secondary"
|
|
1525
|
-
className="flex h-6 max-w-full shrink-0 items-center gap-1.5 overflow-hidden rounded-full border border-dynamic-purple/35 bg-dynamic-purple/10 px-2.5 text-[10px] text-dynamic-purple"
|
|
1526
|
-
title={
|
|
1527
|
-
parentBadgeTask
|
|
1528
|
-
? parentBadgeIdentifier
|
|
1529
|
-
? `${parentBadgeIdentifier} · ${parentBadgeTask.name}`
|
|
1530
|
-
: t('subtask_of', { name: parentBadgeTask.name })
|
|
1531
|
-
: undefined
|
|
1532
|
-
}
|
|
1533
|
-
ref={(el) => {
|
|
1534
|
-
if (el) badgeRefs.current.set('parent', el as any);
|
|
1535
|
-
}}
|
|
1536
|
-
>
|
|
1537
|
-
<ArrowUpCircle className="h-2.5 w-2.5" />
|
|
1538
|
-
{parentBadgeIdentifier && (
|
|
1539
|
-
<span className="rounded-full bg-dynamic-purple/12 px-1.5 py-0.5 font-mono text-[9px] leading-none">
|
|
1540
|
-
{parentBadgeIdentifier}
|
|
1541
|
-
</span>
|
|
1542
|
-
)}
|
|
1543
|
-
<span className="truncate">
|
|
1544
|
-
{parentBadgeTask?.name ||
|
|
1545
|
-
parentBadgeIdentifier ||
|
|
1546
|
-
t('parent_task')}
|
|
1547
|
-
</span>
|
|
1548
|
-
</Badge>
|
|
1549
|
-
),
|
|
1550
|
-
});
|
|
1551
|
-
}
|
|
1552
|
-
|
|
1553
|
-
// Child tasks (sub-tasks) count badge
|
|
1554
|
-
if (childTaskCount > 0) {
|
|
1555
|
-
badges.push({
|
|
1556
|
-
id: 'children',
|
|
1557
|
-
element: (
|
|
1558
|
-
<Badge
|
|
1559
|
-
key="children"
|
|
1560
|
-
variant="secondary"
|
|
1561
|
-
className={cn(
|
|
1562
|
-
'h-5 shrink-0 border px-2 text-[10px]',
|
|
1563
|
-
completedChildTaskCount === childTaskCount
|
|
1564
|
-
? 'border-dynamic-green/30 bg-dynamic-green/10 text-dynamic-green'
|
|
1565
|
-
: 'border-dynamic-gray/30 bg-dynamic-gray/10 text-dynamic-gray'
|
|
1566
|
-
)}
|
|
1567
|
-
title={t('n_subtasks_completed', {
|
|
1568
|
-
checked: completedChildTaskCount,
|
|
1569
|
-
total: childTaskCount,
|
|
1570
|
-
})}
|
|
1571
|
-
ref={(el) => {
|
|
1572
|
-
if (el) badgeRefs.current.set('children', el as any);
|
|
1573
|
-
}}
|
|
1574
|
-
>
|
|
1575
|
-
<ListTree className="h-2.5 w-2.5" />
|
|
1576
|
-
{completedChildTaskCount}/{childTaskCount}
|
|
1577
|
-
</Badge>
|
|
1578
|
-
),
|
|
1579
|
-
});
|
|
1580
|
-
}
|
|
1581
|
-
|
|
1582
|
-
// Blocking indicator badge (this task blocks others)
|
|
1583
|
-
if (blockingCount > 0) {
|
|
1584
|
-
badges.push({
|
|
1585
|
-
id: 'blocking',
|
|
1586
|
-
element: (
|
|
1587
|
-
<Badge
|
|
1588
|
-
key="blocking"
|
|
1589
|
-
variant="secondary"
|
|
1590
|
-
className="h-5 shrink-0 border border-dynamic-orange/30 bg-dynamic-orange/10 px-2 text-[10px] text-dynamic-orange"
|
|
1591
|
-
title={t('blocking_n_tasks', { count: blockingCount })}
|
|
1592
|
-
ref={(el) => {
|
|
1593
|
-
if (el) badgeRefs.current.set('blocking', el as any);
|
|
1594
|
-
}}
|
|
1595
|
-
>
|
|
1596
|
-
<Ban className="h-2.5 w-2.5" />
|
|
1597
|
-
{blockingCount}
|
|
1598
|
-
</Badge>
|
|
1599
|
-
),
|
|
1600
|
-
});
|
|
1601
|
-
}
|
|
1602
|
-
|
|
1603
|
-
// Related tasks indicator badge
|
|
1604
|
-
if (relatedTaskCount > 0) {
|
|
1605
|
-
badges.push({
|
|
1606
|
-
id: 'related',
|
|
1607
|
-
element: (
|
|
1608
|
-
<Badge
|
|
1609
|
-
key="related"
|
|
1610
|
-
variant="secondary"
|
|
1611
|
-
className="h-5 shrink-0 border border-dynamic-blue/30 bg-dynamic-blue/10 px-2 text-[10px] text-dynamic-blue"
|
|
1612
|
-
title={t('n_related_tasks', { count: relatedTaskCount })}
|
|
1613
|
-
ref={(el) => {
|
|
1614
|
-
if (el) badgeRefs.current.set('related', el as any);
|
|
1615
|
-
}}
|
|
1616
|
-
>
|
|
1617
|
-
<Link2 className="h-2.5 w-2.5" />
|
|
1618
|
-
{relatedTaskCount}
|
|
1619
|
-
</Badge>
|
|
1620
|
-
),
|
|
1621
|
-
});
|
|
1622
|
-
}
|
|
1623
|
-
|
|
1624
|
-
return badges;
|
|
1625
|
-
}, [
|
|
1626
|
-
// Only depend on specific task properties that affect badge rendering
|
|
1627
|
-
// to prevent recalculation when unrelated properties (like name) change
|
|
1628
|
-
task.priority,
|
|
1629
|
-
task.projects,
|
|
1630
|
-
task.estimation_points,
|
|
1631
|
-
task.total_duration,
|
|
1632
|
-
task.auto_schedule,
|
|
1633
|
-
task.calendar_hours,
|
|
1634
|
-
task.is_splittable,
|
|
1635
|
-
task.max_split_duration_minutes,
|
|
1636
|
-
task.min_split_duration_minutes,
|
|
1637
|
-
task.labels,
|
|
1638
|
-
boardConfig?.estimation_type,
|
|
1639
|
-
descriptionMeta.totalCheckboxes,
|
|
1640
|
-
descriptionMeta.checkedCheckboxes,
|
|
1641
|
-
descriptionMeta.indeterminateCheckboxes,
|
|
1642
|
-
parentBadgeTask,
|
|
1643
|
-
hasParentRelationship,
|
|
1644
|
-
childTaskCount,
|
|
1645
|
-
completedChildTaskCount,
|
|
1646
|
-
blockingCount,
|
|
1647
|
-
relatedTaskCount,
|
|
1648
|
-
t,
|
|
1649
|
-
taskBoardT,
|
|
1650
|
-
parentBadgeIdentifier,
|
|
1651
|
-
]);
|
|
1652
|
-
|
|
1653
|
-
// Calculate visible badges based on available width
|
|
1654
|
-
useEffect(() => {
|
|
1655
|
-
const container = containerRef.current;
|
|
1656
|
-
if (!container) return;
|
|
1657
|
-
|
|
1658
|
-
const calculateVisibleCount = () => {
|
|
1659
|
-
const containerWidth = container.clientWidth;
|
|
1660
|
-
const gap = 4; // gap-1 = 4px
|
|
1661
|
-
|
|
1662
|
-
// Get description meta width
|
|
1663
|
-
let descriptionMetaWidth = 0;
|
|
1664
|
-
if (descriptionMetaRef.current) {
|
|
1665
|
-
descriptionMetaWidth = descriptionMetaRef.current.offsetWidth + gap;
|
|
1666
|
-
}
|
|
1667
|
-
|
|
1668
|
-
// Calculate total width needed for each badge
|
|
1669
|
-
let totalWidth = descriptionMetaWidth;
|
|
1670
|
-
let count = 0;
|
|
1671
|
-
|
|
1672
|
-
for (let i = 0; i < taskBadges.length; i++) {
|
|
1673
|
-
const badge = taskBadges[i];
|
|
1674
|
-
const badgeElement = badgeRefs.current.get(badge?.id || '');
|
|
1675
|
-
if (!badgeElement) continue;
|
|
1676
|
-
|
|
1677
|
-
const isLastBadge = i === taskBadges.length - 1;
|
|
1678
|
-
const badgeWidth = badgeElement.offsetWidth + (isLastBadge ? 0 : gap);
|
|
1679
|
-
|
|
1680
|
-
const totalNeeded = totalWidth + badgeWidth;
|
|
1681
|
-
|
|
1682
|
-
if (totalNeeded <= containerWidth) {
|
|
1683
|
-
totalWidth += badgeWidth;
|
|
1684
|
-
count++;
|
|
1685
|
-
} else {
|
|
1686
|
-
break;
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
setVisibleBadgeCount(count);
|
|
1691
|
-
};
|
|
1692
|
-
|
|
1693
|
-
// Initial calculation
|
|
1694
|
-
calculateVisibleCount();
|
|
1695
|
-
|
|
1696
|
-
// Re-calculate on container resize
|
|
1697
|
-
const resizeObserver = new ResizeObserver(calculateVisibleCount);
|
|
1698
|
-
resizeObserver.observe(container);
|
|
1699
|
-
|
|
1700
|
-
return () => {
|
|
1701
|
-
resizeObserver.disconnect();
|
|
1702
|
-
};
|
|
1703
|
-
}, [taskBadges]);
|
|
1704
|
-
|
|
1705
|
-
const visibleBadges = taskBadges.slice(0, visibleBadgeCount);
|
|
1706
|
-
const hiddenBadges = taskBadges.slice(visibleBadgeCount);
|
|
1707
|
-
const showBlockedByInlineWithCheckbox =
|
|
1708
|
-
showBlockedByCallout && taskBadges.length === 0;
|
|
1709
|
-
const showBlockedByUnderTitle =
|
|
1710
|
-
showBlockedByCallout && !showBlockedByInlineWithCheckbox;
|
|
1711
|
-
|
|
1712
|
-
// Get all tasks from query to subscribe to cache updates
|
|
1713
|
-
const { data: allTasksFromQuery } = useQuery({
|
|
1714
|
-
queryKey: ['tasks', boardId],
|
|
1715
|
-
queryFn: () => [], // No-op function - we only want to read from cache
|
|
1716
|
-
enabled: false, // Don't fetch, just subscribe to cache
|
|
1717
|
-
});
|
|
1718
|
-
|
|
1719
|
-
// Compute collective attributes for bulk operations
|
|
1720
|
-
const {
|
|
1721
|
-
displayLabels,
|
|
1722
|
-
displayProjects,
|
|
1723
|
-
displayAssignees,
|
|
1724
|
-
displayEstimation,
|
|
1725
|
-
} = useMemo(() => {
|
|
1726
|
-
const shouldUseBulkMode =
|
|
1727
|
-
isMultiSelectMode &&
|
|
1728
|
-
selectedTasks &&
|
|
1729
|
-
selectedTasks.size > 1 &&
|
|
1730
|
-
selectedTasks.has(task.id);
|
|
1731
|
-
|
|
1732
|
-
if (!shouldUseBulkMode) {
|
|
1733
|
-
return {
|
|
1734
|
-
displayLabels: task.labels || [],
|
|
1735
|
-
displayProjects: task.projects || [],
|
|
1736
|
-
displayAssignees: task.assignees || [],
|
|
1737
|
-
displayEstimation: task.estimation_points,
|
|
1738
|
-
};
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
// Get all selected tasks data from query cache
|
|
1742
|
-
const allTasks = (allTasksFromQuery as Task[]) || [];
|
|
1743
|
-
const selectedTasksData = allTasks.filter((t) => selectedTasks?.has(t.id));
|
|
1744
|
-
|
|
1745
|
-
if (selectedTasksData.length === 0) {
|
|
1746
|
-
return {
|
|
1747
|
-
displayLabels: task.labels || [],
|
|
1748
|
-
displayProjects: task.projects || [],
|
|
1749
|
-
displayAssignees: task.assignees || [],
|
|
1750
|
-
displayEstimation: task.estimation_points,
|
|
1751
|
-
};
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1754
|
-
// Find attributes that ALL selected tasks have in common
|
|
1755
|
-
// Start with all unique attributes from all selected tasks
|
|
1756
|
-
const allLabels = new Map<string, any>();
|
|
1757
|
-
const allProjects = new Map<string, any>();
|
|
1758
|
-
const allAssignees = new Map<string, any>();
|
|
1759
|
-
|
|
1760
|
-
selectedTasksData.forEach((t) => {
|
|
1761
|
-
t.labels?.forEach((label) => {
|
|
1762
|
-
allLabels.set(label.id, label);
|
|
1763
|
-
});
|
|
1764
|
-
t.projects?.forEach((project) => {
|
|
1765
|
-
allProjects.set(project.id, project);
|
|
1766
|
-
});
|
|
1767
|
-
t.assignees?.forEach((assignee) => {
|
|
1768
|
-
allAssignees.set(assignee.id, assignee);
|
|
1769
|
-
});
|
|
1770
|
-
});
|
|
1771
|
-
|
|
1772
|
-
// Filter to only those present in ALL selected tasks
|
|
1773
|
-
const commonLabels = Array.from(allLabels.values()).filter((label) =>
|
|
1774
|
-
selectedTasksData.every((t) => t.labels?.some((l) => l.id === label.id))
|
|
1775
|
-
);
|
|
1776
|
-
|
|
1777
|
-
const commonProjects = Array.from(allProjects.values()).filter((project) =>
|
|
1778
|
-
selectedTasksData.every((t) =>
|
|
1779
|
-
t.projects?.some((p) => p.id === project.id)
|
|
1780
|
-
)
|
|
1781
|
-
);
|
|
1782
|
-
|
|
1783
|
-
const commonAssignees = Array.from(allAssignees.values()).filter(
|
|
1784
|
-
(assignee) =>
|
|
1785
|
-
selectedTasksData.every((t) =>
|
|
1786
|
-
t.assignees?.some((a) => a.id === assignee.id)
|
|
1787
|
-
)
|
|
1788
|
-
);
|
|
1789
|
-
|
|
1790
|
-
// Check if ALL selected tasks have the same estimation
|
|
1791
|
-
const firstEstimation = selectedTasksData[0]?.estimation_points;
|
|
1792
|
-
const allSameEstimation = selectedTasksData.every(
|
|
1793
|
-
(t) => t.estimation_points === firstEstimation
|
|
1794
|
-
);
|
|
1795
|
-
const commonEstimation = allSameEstimation ? firstEstimation : undefined;
|
|
1796
|
-
|
|
1797
|
-
return {
|
|
1798
|
-
displayLabels: commonLabels,
|
|
1799
|
-
displayProjects: commonProjects,
|
|
1800
|
-
displayAssignees: commonAssignees,
|
|
1801
|
-
displayEstimation: commonEstimation,
|
|
1802
|
-
};
|
|
1803
|
-
}, [
|
|
1804
|
-
isMultiSelectMode,
|
|
1805
|
-
selectedTasks,
|
|
1806
|
-
task.id,
|
|
1807
|
-
task.labels,
|
|
1808
|
-
task.projects,
|
|
1809
|
-
task.assignees,
|
|
1810
|
-
task.estimation_points,
|
|
1811
|
-
allTasksFromQuery,
|
|
1812
|
-
]);
|
|
1813
|
-
|
|
1814
|
-
const availableLabelsForMenu = useMemo(() => {
|
|
1815
|
-
return mergeTaskCardLabelOptions(workspaceLabels, displayLabels);
|
|
1816
|
-
}, [workspaceLabels, displayLabels]);
|
|
1817
|
-
|
|
1818
|
-
const blockedByCluster = (
|
|
1819
|
-
<div className="relative overflow-hidden rounded-md border border-dynamic-red/16 bg-dynamic-red/[0.045] px-2 py-1.5">
|
|
1820
|
-
<div className="absolute inset-y-1.5 left-1.5 w-0.75 rounded-full bg-dynamic-red/45" />
|
|
1821
|
-
<div className="flex min-w-0 items-center justify-between gap-2 pl-3">
|
|
1822
|
-
<div className="flex min-w-0 items-center gap-1.5">
|
|
1823
|
-
<div className="flex shrink-0 items-center gap-1 font-semibold text-[10px] text-dynamic-red uppercase tracking-[0.12em]">
|
|
1824
|
-
<Ban className="h-3 w-3" />
|
|
1825
|
-
<span>{t('blocked_by')}</span>
|
|
1826
|
-
</div>
|
|
1827
|
-
{!primaryBlockedByTask && (
|
|
1828
|
-
<span className="truncate text-[11px] text-muted-foreground">
|
|
1829
|
-
{t('blocked_by_help')}
|
|
1830
|
-
</span>
|
|
1831
|
-
)}
|
|
1832
|
-
</div>
|
|
1833
|
-
{primaryBlockedByTask && (
|
|
1834
|
-
<div className="flex shrink-0 items-center gap-1">
|
|
1835
|
-
<HoverCard openDelay={120}>
|
|
1836
|
-
<HoverCardTrigger asChild>
|
|
1837
|
-
<button
|
|
1838
|
-
type="button"
|
|
1839
|
-
className={cn(
|
|
1840
|
-
'rounded-md border border-dynamic-red/18 bg-background/90 px-1.5 py-0.5 font-mono text-[9px] text-dynamic-red/85 uppercase transition-colors',
|
|
1841
|
-
'hover:border-dynamic-red/30 hover:bg-background'
|
|
1842
|
-
)}
|
|
1843
|
-
aria-label={t('blocked_by_n_tasks', {
|
|
1844
|
-
count: blockedByCount,
|
|
1845
|
-
})}
|
|
1846
|
-
>
|
|
1847
|
-
{primaryBlockedByTaskIdentifier ?? t('blocked')}
|
|
1848
|
-
</button>
|
|
1849
|
-
</HoverCardTrigger>
|
|
1850
|
-
<HoverCardContent
|
|
1851
|
-
side="top"
|
|
1852
|
-
align="end"
|
|
1853
|
-
className="w-64 border-dynamic-red/20 bg-background/95 p-3 backdrop-blur-sm"
|
|
1854
|
-
>
|
|
1855
|
-
<div className="flex flex-col gap-1">
|
|
1856
|
-
<div className="flex items-center gap-2">
|
|
1857
|
-
<span className="rounded-md border border-dynamic-red/18 bg-dynamic-red/8 px-1.5 py-0.5 font-mono text-[10px] text-dynamic-red uppercase">
|
|
1858
|
-
{primaryBlockedByTaskIdentifier ?? t('blocked')}
|
|
1859
|
-
</span>
|
|
1860
|
-
{primaryBlockedByTask.completed && (
|
|
1861
|
-
<Badge
|
|
1862
|
-
variant="secondary"
|
|
1863
|
-
className="h-5 border-dynamic-green/20 bg-dynamic-green/10 px-1.5 text-[10px] text-dynamic-green"
|
|
1864
|
-
>
|
|
1865
|
-
{t('done')}
|
|
1866
|
-
</Badge>
|
|
1867
|
-
)}
|
|
1868
|
-
</div>
|
|
1869
|
-
<div
|
|
1870
|
-
className={cn(
|
|
1871
|
-
'text-sm leading-snug',
|
|
1872
|
-
primaryBlockedByTask.completed &&
|
|
1873
|
-
'text-muted-foreground line-through'
|
|
1874
|
-
)}
|
|
1875
|
-
>
|
|
1876
|
-
{primaryBlockedByTask.name}
|
|
1877
|
-
</div>
|
|
1878
|
-
{primaryBlockedByTask.board_name && (
|
|
1879
|
-
<div className="text-[11px] text-muted-foreground">
|
|
1880
|
-
{primaryBlockedByTask.board_name}
|
|
1881
|
-
</div>
|
|
1882
|
-
)}
|
|
1883
|
-
</div>
|
|
1884
|
-
</HoverCardContent>
|
|
1885
|
-
</HoverCard>
|
|
1886
|
-
{blockedByOverflowCount > 0 && (
|
|
1887
|
-
<Badge
|
|
1888
|
-
variant="secondary"
|
|
1889
|
-
className="h-5 border-dynamic-red/16 bg-dynamic-red/8 px-1.5 text-[10px] text-dynamic-red/80"
|
|
1890
|
-
>
|
|
1891
|
-
+{blockedByOverflowCount}
|
|
1892
|
-
</Badge>
|
|
1893
|
-
)}
|
|
1894
|
-
</div>
|
|
1895
|
-
)}
|
|
1896
|
-
</div>
|
|
1897
|
-
</div>
|
|
1898
|
-
);
|
|
1899
|
-
|
|
1900
|
-
return (
|
|
1901
|
-
<Card
|
|
1902
|
-
data-id={task.id}
|
|
1903
|
-
data-task-id={task.id}
|
|
1904
|
-
ref={setCardRefs}
|
|
1905
|
-
style={style}
|
|
1906
|
-
onClick={handleCardClick}
|
|
1907
|
-
onContextMenu={(e) => {
|
|
1908
|
-
// If only Shift is held (without CMD/Ctrl), handle as selection
|
|
1909
|
-
if (e.shiftKey && !e.metaKey && !e.ctrlKey && !e.altKey) {
|
|
1910
|
-
e.preventDefault();
|
|
1911
|
-
e.stopPropagation();
|
|
1912
|
-
// Trigger selection
|
|
1913
|
-
onSelect?.(task.id, e as any);
|
|
1914
|
-
return;
|
|
1915
|
-
}
|
|
1916
|
-
|
|
1917
|
-
// Normal right-click behavior - open context menu
|
|
1918
|
-
e.preventDefault();
|
|
1919
|
-
e.stopPropagation();
|
|
1920
|
-
// Open the context menu (actions dropdown) and guard first click briefly
|
|
1921
|
-
setMenuOpen(true);
|
|
1922
|
-
setMenuGuardUntil(Date.now() + 300);
|
|
1923
|
-
}}
|
|
1924
|
-
// Apply sortable listeners/attributes to the full card so the whole surface remains draggable
|
|
1925
|
-
{...(sortableDisabled ? {} : attributes)}
|
|
1926
|
-
{...(sortableDisabled ? {} : listeners)}
|
|
1927
|
-
className={cn(
|
|
1928
|
-
'group relative overflow-hidden rounded-lg border-l-4',
|
|
1929
|
-
cardVisibilityState.hidden && 'pointer-events-none opacity-0',
|
|
1930
|
-
sortableDisabled
|
|
1931
|
-
? 'cursor-default'
|
|
1932
|
-
: 'cursor-grab touch-none select-none active:cursor-grabbing',
|
|
1933
|
-
// Task list or priority-based styling
|
|
1934
|
-
getCardColorClasses(),
|
|
1935
|
-
showBlockedByCallout && 'bg-dynamic-red/[0.03]',
|
|
1936
|
-
cardVisibilityState.pending
|
|
1937
|
-
? 'border-dashed opacity-90'
|
|
1938
|
-
: 'border-solid',
|
|
1939
|
-
(isOverlay || isDragging) &&
|
|
1940
|
-
'bg-card bg-none shadow-lg ring-2 ring-primary/50',
|
|
1941
|
-
// Closed state (closed tasks)
|
|
1942
|
-
(!!task.closed_at || !!task.completed_at) && 'opacity-70 saturate-75',
|
|
1943
|
-
// Overdue state
|
|
1944
|
-
isOverdue &&
|
|
1945
|
-
!isResolvedListStatus &&
|
|
1946
|
-
!(!!task.closed_at || !!task.completed_at) &&
|
|
1947
|
-
'border-dynamic-red/70 bg-dynamic-red/10 ring-1 ring-dynamic-red/20',
|
|
1948
|
-
// Hover state (no transitions)
|
|
1949
|
-
!isDragging && !isSelected && 'hover:ring-1 hover:ring-primary/15',
|
|
1950
|
-
// Selection state - enhanced visual feedback
|
|
1951
|
-
isSelected &&
|
|
1952
|
-
'scale-[1.01] border-l-primary bg-linear-to-r from-primary/10 via-primary/5 to-transparent shadow-lg ring-2 ring-primary/60',
|
|
1953
|
-
// Multi-select mode cursor
|
|
1954
|
-
isMultiSelectMode && 'cursor-pointer'
|
|
1955
|
-
)}
|
|
1956
|
-
>
|
|
1957
|
-
{/* Overdue indicator */}
|
|
1958
|
-
{isOverdue &&
|
|
1959
|
-
!isResolvedListStatus &&
|
|
1960
|
-
!(!!task.closed_at || !!task.completed_at) && (
|
|
1961
|
-
<div className="absolute top-0 right-0 h-0 w-0 border-t-20 border-t-dynamic-red border-l-20 border-l-transparent">
|
|
1962
|
-
<AlertCircle className="absolute -top-4 -right-4.5 h-3 w-3" />
|
|
1963
|
-
</div>
|
|
1964
|
-
)}
|
|
1965
|
-
<div className="p-3">
|
|
1966
|
-
{/* Header */}
|
|
1967
|
-
<div className="flex items-start gap-1">
|
|
1968
|
-
<div className="min-w-0 flex-1">
|
|
1969
|
-
<TaskCardIdentifierRow
|
|
1970
|
-
externalSourceLabel={externalSourceLabel}
|
|
1971
|
-
externalSourceTitle={[
|
|
1972
|
-
task.source_workspace_name,
|
|
1973
|
-
task.source_board_name,
|
|
1974
|
-
task.source_list_name,
|
|
1975
|
-
]
|
|
1976
|
-
.filter(Boolean)
|
|
1977
|
-
.join(' / ')}
|
|
1978
|
-
isMultiSelectMode={isMultiSelectMode}
|
|
1979
|
-
isPersonalExternalTask={isPersonalExternalTask}
|
|
1980
|
-
isSelected={isSelected}
|
|
1981
|
-
onSelect={(event) => onSelect?.(task.id, event)}
|
|
1982
|
-
selectTaskLabel={t('select_task', { name: task.name ?? '' })}
|
|
1983
|
-
selectionCheckboxClassName={selectionCheckboxClassName}
|
|
1984
|
-
taskListStatus={taskList?.status}
|
|
1985
|
-
ticketBadgeClassName={getTicketBadgeColorClasses(
|
|
1986
|
-
taskList,
|
|
1987
|
-
task.priority
|
|
1988
|
-
)}
|
|
1989
|
-
ticketIdentifier={taskTicketIdentifier}
|
|
1990
|
-
ticketTitle={t('ticket_id_label', {
|
|
1991
|
-
id: taskTicketIdentifier,
|
|
1992
|
-
})}
|
|
1993
|
-
/>
|
|
1994
|
-
<div className="mb-1">
|
|
1995
|
-
{/* Task Name */}
|
|
1996
|
-
<button
|
|
1997
|
-
type="button"
|
|
1998
|
-
className={cn(
|
|
1999
|
-
'w-full cursor-pointer text-left font-semibold text-xs leading-tight transition-colors duration-200',
|
|
2000
|
-
'line-clamp-2',
|
|
2001
|
-
task.closed_at || task.completed_at
|
|
2002
|
-
? 'text-muted-foreground line-through'
|
|
2003
|
-
: '-mx-1 -my-0.5 rounded-sm px-1 py-0.5 text-foreground active:bg-muted/50'
|
|
2004
|
-
)}
|
|
2005
|
-
aria-label={t('edit_task_aria', { name: task.name })}
|
|
2006
|
-
title={t('click_to_edit_task')}
|
|
2007
|
-
>
|
|
2008
|
-
{task.name}
|
|
2009
|
-
</button>
|
|
2010
|
-
{showBlockedByUnderTitle && blockedByCluster}
|
|
2011
|
-
</div>
|
|
2012
|
-
</div>
|
|
2013
|
-
{/* Actions menu only */}
|
|
2014
|
-
<div className="flex items-center justify-end gap-1">
|
|
2015
|
-
{/* Main Actions Menu - With integrated date picker */}
|
|
2016
|
-
{!isOverlay && (
|
|
2017
|
-
<DropdownMenu
|
|
2018
|
-
open={menuOpen}
|
|
2019
|
-
onOpenChange={(open) => {
|
|
2020
|
-
setMenuOpen(open);
|
|
2021
|
-
if (!open) {
|
|
2022
|
-
setRelationshipMenusOpen({
|
|
2023
|
-
parent: false,
|
|
2024
|
-
dependencies: false,
|
|
2025
|
-
related: false,
|
|
2026
|
-
});
|
|
2027
|
-
}
|
|
2028
|
-
}}
|
|
2029
|
-
>
|
|
2030
|
-
<DropdownMenuTrigger asChild>
|
|
2031
|
-
<Button
|
|
2032
|
-
variant="ghost"
|
|
2033
|
-
size="xs"
|
|
2034
|
-
className={cn(
|
|
2035
|
-
'h-7 w-7 shrink-0 p-0 transition-all duration-200',
|
|
2036
|
-
'hover:scale-105 hover:bg-muted',
|
|
2037
|
-
menuOpen
|
|
2038
|
-
? 'opacity-100'
|
|
2039
|
-
: 'opacity-0 group-hover:opacity-100',
|
|
2040
|
-
menuOpen && 'bg-muted ring-1 ring-border'
|
|
2041
|
-
)}
|
|
2042
|
-
>
|
|
2043
|
-
<MoreHorizontal className="h-3 w-3" />
|
|
2044
|
-
</Button>
|
|
2045
|
-
</DropdownMenuTrigger>
|
|
2046
|
-
<DropdownMenuContent
|
|
2047
|
-
align="end"
|
|
2048
|
-
className="w-56"
|
|
2049
|
-
sideOffset={5}
|
|
2050
|
-
onClick={(e) => {
|
|
2051
|
-
e.stopPropagation(); // Prevent triggering task card click
|
|
2052
|
-
}}
|
|
2053
|
-
>
|
|
2054
|
-
{!isDocumentList && (
|
|
2055
|
-
<DropdownMenuItem
|
|
2056
|
-
className="cursor-pointer"
|
|
2057
|
-
disabled={isLoading}
|
|
2058
|
-
>
|
|
2059
|
-
<Link
|
|
2060
|
-
href={`/${wsId}/time-tracker/timer?taskSelect=${task?.id}`}
|
|
2061
|
-
target="_blank"
|
|
2062
|
-
rel="noopener noreferrer"
|
|
2063
|
-
className="flex items-center gap-2"
|
|
2064
|
-
>
|
|
2065
|
-
<Timer className="h-4 w-4 text-dynamic-blue" />
|
|
2066
|
-
{t('start_tracking_time')}
|
|
2067
|
-
</Link>
|
|
2068
|
-
</DropdownMenuItem>
|
|
2069
|
-
)}
|
|
2070
|
-
{!isDocumentList && <DropdownMenuSeparator />}
|
|
2071
|
-
{/* Quick Completion Action */}
|
|
2072
|
-
{!isDocumentList && canMoveToCompletion && (
|
|
2073
|
-
<DropdownMenuItem
|
|
2074
|
-
onSelect={(e) =>
|
|
2075
|
-
handleMenuItemSelect(
|
|
2076
|
-
e as unknown as Event,
|
|
2077
|
-
handleMoveToCompletion
|
|
2078
|
-
)
|
|
2079
|
-
}
|
|
2080
|
-
className="cursor-pointer"
|
|
2081
|
-
disabled={isLoading}
|
|
2082
|
-
>
|
|
2083
|
-
<CheckCircle2 className="h-4 w-4 text-dynamic-green" />
|
|
2084
|
-
{targetCompletionList?.status === 'done'
|
|
2085
|
-
? t('mark_as_done')
|
|
2086
|
-
: t('mark_as_closed')}
|
|
2087
|
-
</DropdownMenuItem>
|
|
2088
|
-
)}
|
|
2089
|
-
|
|
2090
|
-
{/* Mark as Closed Action - Only show if closed list exists and is different from the generic completion */}
|
|
2091
|
-
{canShowCloseAction && (
|
|
2092
|
-
<DropdownMenuItem
|
|
2093
|
-
onSelect={(e) =>
|
|
2094
|
-
handleMenuItemSelect(
|
|
2095
|
-
e as unknown as Event,
|
|
2096
|
-
handleMoveToClose
|
|
2097
|
-
)
|
|
2098
|
-
}
|
|
2099
|
-
className="cursor-pointer"
|
|
2100
|
-
disabled={isLoading}
|
|
2101
|
-
>
|
|
2102
|
-
{isDocumentList ? (
|
|
2103
|
-
<Archive className="h-4 w-4 text-dynamic-purple" />
|
|
2104
|
-
) : (
|
|
2105
|
-
<CircleSlash className="h-4 w-4 text-dynamic-purple" />
|
|
2106
|
-
)}
|
|
2107
|
-
{isDocumentList ? t('archive') : t('mark_as_closed')}
|
|
2108
|
-
</DropdownMenuItem>
|
|
2109
|
-
)}
|
|
2110
|
-
|
|
2111
|
-
{((!isDocumentList && canMoveToCompletion) ||
|
|
2112
|
-
canShowCloseAction) && <DropdownMenuSeparator />}
|
|
2113
|
-
|
|
2114
|
-
{/* Priority Menu */}
|
|
2115
|
-
<TaskPriorityMenu
|
|
2116
|
-
currentPriority={task.priority ?? null}
|
|
2117
|
-
isLoading={isLoading}
|
|
2118
|
-
onPriorityChange={handlePriorityChange}
|
|
2119
|
-
onMenuItemSelect={handleMenuItemSelect}
|
|
2120
|
-
onClose={() => setMenuOpen(false)}
|
|
2121
|
-
translations={{
|
|
2122
|
-
priority: t('priority'),
|
|
2123
|
-
none: t('none'),
|
|
2124
|
-
urgent: t('priority_urgent'),
|
|
2125
|
-
high: t('priority_high'),
|
|
2126
|
-
medium: t('priority_medium'),
|
|
2127
|
-
low: t('priority_low'),
|
|
2128
|
-
}}
|
|
2129
|
-
/>
|
|
2130
|
-
|
|
2131
|
-
{/* Due Date Menu */}
|
|
2132
|
-
<TaskDueDateMenu
|
|
2133
|
-
endDate={task.end_date}
|
|
2134
|
-
isLoading={isLoading}
|
|
2135
|
-
weekStartsOn={weekStartsOn}
|
|
2136
|
-
onDueDateChange={handleDueDateChange}
|
|
2137
|
-
onCustomDateClick={() => {
|
|
2138
|
-
setMenuOpen(false);
|
|
2139
|
-
setTimeout(
|
|
2140
|
-
() => dialogActions.openCustomDateDialog(),
|
|
2141
|
-
100
|
|
2142
|
-
);
|
|
2143
|
-
}}
|
|
2144
|
-
onMenuItemSelect={handleMenuItemSelect}
|
|
2145
|
-
onClose={() => setMenuOpen(false)}
|
|
2146
|
-
translations={{
|
|
2147
|
-
dueDate: t('due_date'),
|
|
2148
|
-
none: t('none'),
|
|
2149
|
-
today: t('today'),
|
|
2150
|
-
tomorrow: t('tomorrow'),
|
|
2151
|
-
yesterday: t('yesterday'),
|
|
2152
|
-
thisWeek: t('this_week'),
|
|
2153
|
-
nextWeek: t('next_week'),
|
|
2154
|
-
customDate: t('custom_date'),
|
|
2155
|
-
removeDueDate: t('remove_due_date'),
|
|
2156
|
-
}}
|
|
2157
|
-
/>
|
|
2158
|
-
|
|
2159
|
-
{/* Scheduling Menu */}
|
|
2160
|
-
{taskList?.status !== 'documents' && (
|
|
2161
|
-
<TaskSchedulingMenu
|
|
2162
|
-
task={task}
|
|
2163
|
-
boardId={boardId}
|
|
2164
|
-
isLoading={isLoading}
|
|
2165
|
-
onUpdate={onUpdate}
|
|
2166
|
-
onClose={() => setMenuOpen(false)}
|
|
2167
|
-
translations={{
|
|
2168
|
-
schedule: taskBoardT('ws-task-boards.dialog.schedule'),
|
|
2169
|
-
estimatedDuration: taskBoardT(
|
|
2170
|
-
'ws-task-boards.dialog.estimated_duration'
|
|
2171
|
-
),
|
|
2172
|
-
h: taskBoardT('ws-task-boards.dialog.h'),
|
|
2173
|
-
m: taskBoardT('ws-task-boards.dialog.m'),
|
|
2174
|
-
splittable: taskBoardT(
|
|
2175
|
-
'ws-task-boards.dialog.splittable'
|
|
2176
|
-
),
|
|
2177
|
-
minSplit: taskBoardT('ws-task-boards.dialog.min_split'),
|
|
2178
|
-
maxSplit: taskBoardT('ws-task-boards.dialog.max_split'),
|
|
2179
|
-
hourType: taskBoardT('ws-task-boards.dialog.hour_type'),
|
|
2180
|
-
workHours: taskBoardT(
|
|
2181
|
-
'ws-task-boards.dialog.work_hours'
|
|
2182
|
-
),
|
|
2183
|
-
meetingHours: taskBoardT(
|
|
2184
|
-
'ws-task-boards.dialog.meeting_hours'
|
|
2185
|
-
),
|
|
2186
|
-
personalHours: taskBoardT(
|
|
2187
|
-
'ws-task-boards.dialog.personal_hours'
|
|
2188
|
-
),
|
|
2189
|
-
autoSchedule: taskBoardT(
|
|
2190
|
-
'ws-task-boards.dialog.auto_schedule'
|
|
2191
|
-
),
|
|
2192
|
-
save: t('save'),
|
|
2193
|
-
clear: t('clear'),
|
|
2194
|
-
saved: t('saved'),
|
|
2195
|
-
error: t('error'),
|
|
2196
|
-
}}
|
|
2197
|
-
/>
|
|
2198
|
-
)}
|
|
2199
|
-
|
|
2200
|
-
{/* Estimation Menu */}
|
|
2201
|
-
{boardConfig?.estimation_type && (
|
|
2202
|
-
<TaskEstimationMenu
|
|
2203
|
-
currentPoints={displayEstimation}
|
|
2204
|
-
estimationType={boardConfig?.estimation_type}
|
|
2205
|
-
extendedEstimation={boardConfig?.extended_estimation}
|
|
2206
|
-
allowZeroEstimates={boardConfig?.allow_zero_estimates}
|
|
2207
|
-
isLoading={estimationSaving}
|
|
2208
|
-
onEstimationChange={updateEstimationPoints}
|
|
2209
|
-
onMenuItemSelect={handleMenuItemSelect}
|
|
2210
|
-
/>
|
|
2211
|
-
)}
|
|
2212
|
-
|
|
2213
|
-
{/* Labels Menu */}
|
|
2214
|
-
<TaskLabelsMenu
|
|
2215
|
-
taskLabels={displayLabels}
|
|
2216
|
-
availableLabels={availableLabelsForMenu}
|
|
2217
|
-
isLoading={labelsLoading}
|
|
2218
|
-
onToggleLabel={toggleTaskLabel}
|
|
2219
|
-
onCreateNewLabel={() => {
|
|
2220
|
-
openNewLabelDialog();
|
|
2221
|
-
setMenuOpen(false);
|
|
2222
|
-
}}
|
|
2223
|
-
onMenuItemSelect={handleMenuItemSelect}
|
|
2224
|
-
translations={{
|
|
2225
|
-
labels: t('labels'),
|
|
2226
|
-
searchLabels: t('search_labels'),
|
|
2227
|
-
loading: t('loading'),
|
|
2228
|
-
noLabelsFound: t('no_labels_found'),
|
|
2229
|
-
noLabelsAvailable: t('no_labels_available'),
|
|
2230
|
-
applied: t('applied'),
|
|
2231
|
-
createNewLabel: t('create_new_label'),
|
|
2232
|
-
}}
|
|
2233
|
-
/>
|
|
2234
|
-
|
|
2235
|
-
{/* Projects Menu */}
|
|
2236
|
-
<TaskProjectsMenu
|
|
2237
|
-
taskProjects={displayProjects}
|
|
2238
|
-
availableProjects={workspaceProjects}
|
|
2239
|
-
isLoading={projectsLoading}
|
|
2240
|
-
onToggleProject={toggleTaskProject}
|
|
2241
|
-
onCreateNewProject={() => {
|
|
2242
|
-
dialogActions.openNewProjectDialog();
|
|
2243
|
-
setMenuOpen(false);
|
|
2244
|
-
}}
|
|
2245
|
-
onMenuItemSelect={handleMenuItemSelect}
|
|
2246
|
-
translations={{
|
|
2247
|
-
projects: t('projects'),
|
|
2248
|
-
searchProjects: t('search_projects'),
|
|
2249
|
-
loading: t('loading'),
|
|
2250
|
-
noProjectsFound: t('no_projects_found'),
|
|
2251
|
-
noProjectsAvailable: t('no_projects_available'),
|
|
2252
|
-
assigned: t('assigned'),
|
|
2253
|
-
createNewProject: t('create_new_project'),
|
|
2254
|
-
}}
|
|
2255
|
-
/>
|
|
2256
|
-
|
|
2257
|
-
<DropdownMenuSeparator />
|
|
2258
|
-
|
|
2259
|
-
{/* Task Relationships Section */}
|
|
2260
|
-
{effectiveWorkspaceId && (
|
|
2261
|
-
<>
|
|
2262
|
-
{/* Parent Task Menu */}
|
|
2263
|
-
<TaskParentMenu
|
|
2264
|
-
wsId={effectiveWorkspaceId}
|
|
2265
|
-
taskId={task.id}
|
|
2266
|
-
parentTask={parentTask}
|
|
2267
|
-
childTaskIds={childTasks.map((t) => t.id)}
|
|
2268
|
-
isSaving={relationshipSaving}
|
|
2269
|
-
onSetParent={setParentTask}
|
|
2270
|
-
onRemoveParent={removeParentTask}
|
|
2271
|
-
onOpenChange={(open) =>
|
|
2272
|
-
setRelationshipMenusOpen((prev) => ({
|
|
2273
|
-
...prev,
|
|
2274
|
-
parent: open,
|
|
2275
|
-
}))
|
|
2276
|
-
}
|
|
2277
|
-
translations={{
|
|
2278
|
-
parent_task: t('parent_task'),
|
|
2279
|
-
search_tasks: t('search_tasks'),
|
|
2280
|
-
error_loading_tasks: t('error'),
|
|
2281
|
-
no_matching_tasks: t('no-results'),
|
|
2282
|
-
no_available_tasks: t('no_tasks'),
|
|
2283
|
-
n_set: '1',
|
|
2284
|
-
}}
|
|
2285
|
-
/>
|
|
2286
|
-
|
|
2287
|
-
{/* Blocking/Blocked By Menu */}
|
|
2288
|
-
<TaskBlockingMenu
|
|
2289
|
-
wsId={effectiveWorkspaceId}
|
|
2290
|
-
taskId={task.id}
|
|
2291
|
-
blockingTasks={blockingTasks}
|
|
2292
|
-
blockedByTasks={blockedByTasks}
|
|
2293
|
-
isSaving={relationshipSaving}
|
|
2294
|
-
savingTaskId={relationshipSavingTaskId}
|
|
2295
|
-
onAddBlocking={addBlockingTask}
|
|
2296
|
-
onRemoveBlocking={removeBlockingTask}
|
|
2297
|
-
onAddBlockedBy={addBlockedByTask}
|
|
2298
|
-
onRemoveBlockedBy={removeBlockedByTask}
|
|
2299
|
-
onOpenChange={(open) =>
|
|
2300
|
-
setRelationshipMenusOpen((prev) => ({
|
|
2301
|
-
...prev,
|
|
2302
|
-
dependencies: open,
|
|
2303
|
-
}))
|
|
2304
|
-
}
|
|
2305
|
-
translations={{
|
|
2306
|
-
dependencies: t('dependencies'),
|
|
2307
|
-
blocks: t('blocks'),
|
|
2308
|
-
blocked_by: t('blocked_by'),
|
|
2309
|
-
search_tasks_to_block: t('search_tasks'),
|
|
2310
|
-
search_blocking_tasks: t('search_tasks'),
|
|
2311
|
-
error_loading_tasks: t('error'),
|
|
2312
|
-
no_matching_tasks: t('no-results'),
|
|
2313
|
-
no_available_tasks: t('no_tasks'),
|
|
2314
|
-
remove_dependency: t('remove'),
|
|
2315
|
-
tasks_that_cannot_start: t('blocks_help'),
|
|
2316
|
-
tasks_that_must_complete: t('blocked_by_help'),
|
|
2317
|
-
}}
|
|
2318
|
-
/>
|
|
2319
|
-
|
|
2320
|
-
{/* Related Tasks Menu */}
|
|
2321
|
-
<TaskRelatedMenu
|
|
2322
|
-
wsId={effectiveWorkspaceId}
|
|
2323
|
-
taskId={task.id}
|
|
2324
|
-
relatedTasks={relatedTasks}
|
|
2325
|
-
isSaving={relationshipSaving}
|
|
2326
|
-
savingTaskId={relationshipSavingTaskId}
|
|
2327
|
-
onAddRelated={addRelatedTask}
|
|
2328
|
-
onRemoveRelated={removeRelatedTask}
|
|
2329
|
-
onOpenChange={(open) =>
|
|
2330
|
-
setRelationshipMenusOpen((prev) => ({
|
|
2331
|
-
...prev,
|
|
2332
|
-
related: open,
|
|
2333
|
-
}))
|
|
2334
|
-
}
|
|
2335
|
-
translations={{
|
|
2336
|
-
related_tasks: t('related_tasks'),
|
|
2337
|
-
currently_related: t('currently_related'),
|
|
2338
|
-
search_tasks_to_link: t('search_tasks'),
|
|
2339
|
-
no_matching_tasks: t('no-results'),
|
|
2340
|
-
no_available_tasks: t('no_tasks'),
|
|
2341
|
-
related_tasks_help: t('related_tasks_help'),
|
|
2342
|
-
}}
|
|
2343
|
-
/>
|
|
2344
|
-
|
|
2345
|
-
<DropdownMenuSeparator />
|
|
2346
|
-
</>
|
|
2347
|
-
)}
|
|
2348
|
-
|
|
2349
|
-
{/* Move Menu */}
|
|
2350
|
-
{availableLists.length > 0 && effectiveWorkspaceId && (
|
|
2351
|
-
<TaskMoveMenu
|
|
2352
|
-
currentListId={task.list_id}
|
|
2353
|
-
availableLists={availableLists}
|
|
2354
|
-
isLoading={isLoading}
|
|
2355
|
-
onMoveToList={handleMoveToList}
|
|
2356
|
-
onMenuItemSelect={handleMenuItemSelect}
|
|
2357
|
-
onRequestOpenCreateDialog={() => {
|
|
2358
|
-
setMenuOpen(false);
|
|
2359
|
-
setIsCreateListDialogOpen(true);
|
|
2360
|
-
}}
|
|
2361
|
-
translations={{
|
|
2362
|
-
move: t('move'),
|
|
2363
|
-
}}
|
|
2364
|
-
/>
|
|
2365
|
-
)}
|
|
2366
|
-
|
|
2367
|
-
{isPersonalExternalOverlay && (
|
|
2368
|
-
<>
|
|
2369
|
-
{task.personal_board_id && task.personal_list_id && (
|
|
2370
|
-
<DropdownMenuItem
|
|
2371
|
-
onSelect={(e) =>
|
|
2372
|
-
handleMenuItemSelect(
|
|
2373
|
-
e as unknown as Event,
|
|
2374
|
-
() => void handleMoveToExternalStaging()
|
|
2375
|
-
)
|
|
2376
|
-
}
|
|
2377
|
-
className="cursor-pointer"
|
|
2378
|
-
disabled={isLoading}
|
|
2379
|
-
>
|
|
2380
|
-
<MoveRight className="h-4 w-4 text-dynamic-cyan" />
|
|
2381
|
-
{tTasks('move_to_external_tasks')}
|
|
2382
|
-
</DropdownMenuItem>
|
|
2383
|
-
)}
|
|
2384
|
-
{sourceBoardUrl && (
|
|
2385
|
-
<DropdownMenuItem asChild>
|
|
2386
|
-
<Link href={sourceBoardUrl}>
|
|
2387
|
-
<ExternalLink className="h-4 w-4 text-foreground" />
|
|
2388
|
-
{tTasks('open_source_board')}
|
|
2389
|
-
</Link>
|
|
2390
|
-
</DropdownMenuItem>
|
|
2391
|
-
)}
|
|
2392
|
-
{!task.is_personal_external_default && (
|
|
2393
|
-
<DropdownMenuItem
|
|
2394
|
-
onSelect={(e) =>
|
|
2395
|
-
handleMenuItemSelect(e as unknown as Event, () => {
|
|
2396
|
-
void handleRemoveFromPersonalBoard();
|
|
2397
|
-
})
|
|
2398
|
-
}
|
|
2399
|
-
className="cursor-pointer text-dynamic-red focus:text-dynamic-red"
|
|
2400
|
-
disabled={isLoading}
|
|
2401
|
-
>
|
|
2402
|
-
<Trash2 className="h-4 w-4" />
|
|
2403
|
-
{tTasks('remove_from_personal_board')}
|
|
2404
|
-
</DropdownMenuItem>
|
|
2405
|
-
)}
|
|
2406
|
-
<DropdownMenuSeparator />
|
|
2407
|
-
</>
|
|
2408
|
-
)}
|
|
2409
|
-
|
|
2410
|
-
{/* Assignee Actions */}
|
|
2411
|
-
{shouldUseBoardAssignees && (
|
|
2412
|
-
<TaskAssigneesMenu
|
|
2413
|
-
taskAssignees={displayAssignees}
|
|
2414
|
-
availableMembers={workspaceMembers}
|
|
2415
|
-
isLoading={membersLoading}
|
|
2416
|
-
onToggleAssignee={onToggleAssignee}
|
|
2417
|
-
onMenuItemSelect={handleMenuItemSelect}
|
|
2418
|
-
translations={{
|
|
2419
|
-
assignees: t('assignees'),
|
|
2420
|
-
searchMembers: t('search_members'),
|
|
2421
|
-
loading: t('loading'),
|
|
2422
|
-
noMembersFound: t('no_members_found'),
|
|
2423
|
-
noMembersAvailable: t('no_members_available'),
|
|
2424
|
-
assigned: t('assigned'),
|
|
2425
|
-
memberNoLongerInWorkspace: t(
|
|
2426
|
-
'member_no_longer_in_workspace'
|
|
2427
|
-
),
|
|
2428
|
-
}}
|
|
2429
|
-
/>
|
|
2430
|
-
)}
|
|
2431
|
-
|
|
2432
|
-
<DropdownMenuSeparator />
|
|
2433
|
-
{taskShareWsId && (
|
|
2434
|
-
<DropdownMenuItem
|
|
2435
|
-
onSelect={(e) =>
|
|
2436
|
-
handleMenuItemSelect(e as unknown as Event, () => {
|
|
2437
|
-
setShareDialogOpen(true);
|
|
2438
|
-
setMenuOpen(false);
|
|
2439
|
-
})
|
|
2440
|
-
}
|
|
2441
|
-
className="cursor-pointer"
|
|
2442
|
-
>
|
|
2443
|
-
<Share2 className="h-4 w-4 text-foreground" />
|
|
2444
|
-
{t('task_sharing.share_task')}
|
|
2445
|
-
</DropdownMenuItem>
|
|
2446
|
-
)}
|
|
2447
|
-
<DropdownMenuItem
|
|
2448
|
-
onSelect={handleDuplicateTask}
|
|
2449
|
-
className="cursor-pointer"
|
|
2450
|
-
>
|
|
2451
|
-
<Copy className="h-4 w-4 text-foreground" />
|
|
2452
|
-
{t('duplicate_task')}
|
|
2453
|
-
</DropdownMenuItem>
|
|
2454
|
-
<DropdownMenuItem
|
|
2455
|
-
onSelect={handleAddSubtask}
|
|
2456
|
-
className="cursor-pointer"
|
|
2457
|
-
>
|
|
2458
|
-
<ListTree className="h-4 w-4 text-foreground" />
|
|
2459
|
-
{t('add_subtask')}
|
|
2460
|
-
</DropdownMenuItem>
|
|
2461
|
-
<DropdownMenuSeparator />
|
|
2462
|
-
{!isPersonalExternalTask && (
|
|
2463
|
-
<DropdownMenuItem
|
|
2464
|
-
onSelect={(e) =>
|
|
2465
|
-
handleMenuItemSelect(e as unknown as Event, () => {
|
|
2466
|
-
dialogActions.openDeleteDialog();
|
|
2467
|
-
setMenuOpen(false);
|
|
2468
|
-
})
|
|
2469
|
-
}
|
|
2470
|
-
className="cursor-pointer"
|
|
2471
|
-
>
|
|
2472
|
-
<Trash2 className="h-4 w-4 text-dynamic-red" />
|
|
2473
|
-
{t('delete_task')}
|
|
2474
|
-
</DropdownMenuItem>
|
|
2475
|
-
)}
|
|
2476
|
-
</DropdownMenuContent>
|
|
2477
|
-
</DropdownMenu>
|
|
2478
|
-
)}
|
|
2479
|
-
</div>
|
|
2480
|
-
{/* Assignee: left, not cut off */}
|
|
2481
|
-
{shouldUseBoardAssignees && (
|
|
2482
|
-
<div className="flex flex-none items-start justify-start">
|
|
2483
|
-
<AssigneeSelect
|
|
2484
|
-
taskId={task.id}
|
|
2485
|
-
assignees={task.assignees}
|
|
2486
|
-
onUpdate={onUpdate}
|
|
2487
|
-
/>
|
|
2488
|
-
</div>
|
|
2489
|
-
)}
|
|
2490
|
-
</div>
|
|
2491
|
-
{/* Dates Section (improved layout & conditional rendering) */}
|
|
2492
|
-
{(shouldRenderStartDate || shouldRenderDueDate) && (
|
|
2493
|
-
<div className="mb-1 space-y-0.5 text-[10px] leading-snug">
|
|
2494
|
-
{/* Show start only if in the future (hide historical start for visual simplicity) */}
|
|
2495
|
-
{shouldRenderStartDate && startDate && startDate > now && (
|
|
2496
|
-
<div className="flex items-center gap-1 text-muted-foreground">
|
|
2497
|
-
<Clock className="h-2.5 w-2.5 shrink-0" />
|
|
2498
|
-
<span className="truncate">
|
|
2499
|
-
{t('starts_at', {
|
|
2500
|
-
date: formatSmartDate(
|
|
2501
|
-
startDate,
|
|
2502
|
-
{
|
|
2503
|
-
today: t('today'),
|
|
2504
|
-
tomorrow: t('tomorrow'),
|
|
2505
|
-
yesterday: t('yesterday'),
|
|
2506
|
-
},
|
|
2507
|
-
dateLocale
|
|
2508
|
-
),
|
|
2509
|
-
})}
|
|
2510
|
-
</span>
|
|
2511
|
-
</div>
|
|
2512
|
-
)}
|
|
2513
|
-
{shouldRenderDueDate && endDate && (
|
|
2514
|
-
<div
|
|
2515
|
-
className={cn(
|
|
2516
|
-
'flex items-center gap-1',
|
|
2517
|
-
isOverdue && !task.closed_at
|
|
2518
|
-
? 'font-medium text-dynamic-red'
|
|
2519
|
-
: 'text-muted-foreground'
|
|
2520
|
-
)}
|
|
2521
|
-
>
|
|
2522
|
-
{upcomingDeadlineCountdown && upcomingDeadlineExactDate ? (
|
|
2523
|
-
<Tooltip>
|
|
2524
|
-
<TooltipTrigger asChild>
|
|
2525
|
-
<span className="inline-flex min-w-0 items-center gap-1 truncate font-medium">
|
|
2526
|
-
<Timer className="h-2.5 w-2.5" />
|
|
2527
|
-
<span className="truncate">
|
|
2528
|
-
{upcomingDeadlineCountdown}
|
|
2529
|
-
</span>
|
|
2530
|
-
</span>
|
|
2531
|
-
</TooltipTrigger>
|
|
2532
|
-
<TooltipContent side="top" className="text-xs">
|
|
2533
|
-
{upcomingDeadlineExactDate}
|
|
2534
|
-
</TooltipContent>
|
|
2535
|
-
</Tooltip>
|
|
2536
|
-
) : (
|
|
2537
|
-
<>
|
|
2538
|
-
<Calendar className="h-2.5 w-2.5 shrink-0" />
|
|
2539
|
-
<span className="truncate">
|
|
2540
|
-
{t('due_at', {
|
|
2541
|
-
date: formatSmartDate(
|
|
2542
|
-
endDate,
|
|
2543
|
-
{
|
|
2544
|
-
today: t('today'),
|
|
2545
|
-
tomorrow: t('tomorrow'),
|
|
2546
|
-
yesterday: t('yesterday'),
|
|
2547
|
-
},
|
|
2548
|
-
dateLocale
|
|
2549
|
-
),
|
|
2550
|
-
})}
|
|
2551
|
-
</span>
|
|
2552
|
-
{isOverdue && !task.closed_at ? (
|
|
2553
|
-
<Badge className="ml-1 h-4 bg-dynamic-red px-1 font-semibold text-[9px] text-white tracking-wide">
|
|
2554
|
-
{t('overdue')}
|
|
2555
|
-
</Badge>
|
|
2556
|
-
) : (
|
|
2557
|
-
<span className="ml-1 hidden text-[10px] text-muted-foreground md:inline">
|
|
2558
|
-
{upcomingDeadlineExactDate}
|
|
2559
|
-
</span>
|
|
2560
|
-
)}
|
|
2561
|
-
</>
|
|
2562
|
-
)}
|
|
2563
|
-
</div>
|
|
2564
|
-
)}
|
|
2565
|
-
</div>
|
|
2566
|
-
)}
|
|
2567
|
-
{taskList?.status === 'done' || taskList?.status === 'closed' ? (
|
|
2568
|
-
/*
|
|
2569
|
-
Completion and Closed Dates Section
|
|
2570
|
-
Show completed_at when in done list, closed_at when in closed list
|
|
2571
|
-
*/
|
|
2572
|
-
<div className="mb-1 flex min-h-5 items-center justify-between gap-2 text-[10px] leading-snug sm:min-h-6">
|
|
2573
|
-
<div className="min-w-0 space-y-0.5">
|
|
2574
|
-
{taskList?.status === 'done' && task.completed_at && (
|
|
2575
|
-
<div
|
|
2576
|
-
className={cn(
|
|
2577
|
-
'flex min-w-0 items-center gap-1',
|
|
2578
|
-
getListTextColorClass(taskList?.color)
|
|
2579
|
-
)}
|
|
2580
|
-
>
|
|
2581
|
-
<CheckCircle2 className="h-2.5 w-2.5 shrink-0" />
|
|
2582
|
-
<span className="truncate">
|
|
2583
|
-
{t('completed')}{' '}
|
|
2584
|
-
{formatDistance(new Date(task.completed_at), now, {
|
|
2585
|
-
addSuffix: true,
|
|
2586
|
-
locale: dateLocale,
|
|
2587
|
-
})}
|
|
2588
|
-
</span>
|
|
2589
|
-
<span className="ml-1 hidden shrink-0 text-[10px] text-muted-foreground md:inline">
|
|
2590
|
-
{format(
|
|
2591
|
-
new Date(task.completed_at),
|
|
2592
|
-
`MMM dd '${t('at')}' ${timePattern}`,
|
|
2593
|
-
{ locale: dateLocale }
|
|
2594
|
-
)}
|
|
2595
|
-
</span>
|
|
2596
|
-
</div>
|
|
2597
|
-
)}
|
|
2598
|
-
{taskList?.status === 'closed' && task.closed_at && (
|
|
2599
|
-
<div
|
|
2600
|
-
className={cn(
|
|
2601
|
-
'flex min-w-0 items-center gap-1',
|
|
2602
|
-
getListTextColorClass(taskList?.color)
|
|
2603
|
-
)}
|
|
2604
|
-
>
|
|
2605
|
-
<CircleSlash className="h-2.5 w-2.5 shrink-0" />
|
|
2606
|
-
<span className="truncate">
|
|
2607
|
-
{t('closed')}{' '}
|
|
2608
|
-
{formatDistance(new Date(task.closed_at), now, {
|
|
2609
|
-
addSuffix: true,
|
|
2610
|
-
locale: dateLocale,
|
|
2611
|
-
})}
|
|
2612
|
-
</span>
|
|
2613
|
-
<span className="ml-1 hidden shrink-0 text-[10px] text-muted-foreground md:inline">
|
|
2614
|
-
{format(
|
|
2615
|
-
new Date(task.closed_at),
|
|
2616
|
-
`MMM dd '${t('at')}' ${timePattern}`,
|
|
2617
|
-
{ locale: dateLocale }
|
|
2618
|
-
)}
|
|
2619
|
-
</span>
|
|
2620
|
-
</div>
|
|
2621
|
-
)}
|
|
2622
|
-
</div>
|
|
2623
|
-
{quickArchiveButton}
|
|
2624
|
-
</div>
|
|
2625
|
-
) : (
|
|
2626
|
-
/*
|
|
2627
|
-
Bottom Row: Three-column layout for assignee, priority, and checkbox, with only one tag visible and +N tooltip for extras.
|
|
2628
|
-
Hide bottom row entirely when in done/closed list
|
|
2629
|
-
*/
|
|
2630
|
-
<div className="flex items-center gap-2">
|
|
2631
|
-
{/* Hidden measurement container - render all badges to measure their width */}
|
|
2632
|
-
<div
|
|
2633
|
-
className="pointer-events-none absolute top-0 -left-2499.75 flex items-center gap-1 opacity-0"
|
|
2634
|
-
aria-hidden="true"
|
|
2635
|
-
>
|
|
2636
|
-
{taskBadges.map((badge) => badge.element)}
|
|
2637
|
-
</div>
|
|
2638
|
-
{/* Visible container - only show badges that fit */}
|
|
2639
|
-
<div
|
|
2640
|
-
ref={containerRef}
|
|
2641
|
-
className="scrollbar-hide flex w-full items-center gap-1 overflow-auto whitespace-nowrap rounded-lg"
|
|
2642
|
-
>
|
|
2643
|
-
{showBlockedByInlineWithCheckbox && (
|
|
2644
|
-
<div className="min-w-0 flex-1">{blockedByCluster}</div>
|
|
2645
|
-
)}
|
|
2646
|
-
{visibleBadges.map((badge) => badge.element)}
|
|
2647
|
-
{visibleBadges.length > 0 && hiddenBadges.length > 0 && (
|
|
2648
|
-
<HoverCard openDelay={200}>
|
|
2649
|
-
<HoverCardTrigger asChild>
|
|
2650
|
-
<Badge
|
|
2651
|
-
variant="secondary"
|
|
2652
|
-
className="cursor-pointer border border-border bg-muted/50 font-medium text-[10px] text-muted-foreground hover:bg-muted"
|
|
2653
|
-
>
|
|
2654
|
-
+{hiddenBadges.length}
|
|
2655
|
-
</Badge>
|
|
2656
|
-
</HoverCardTrigger>
|
|
2657
|
-
<HoverCardContent
|
|
2658
|
-
side="top"
|
|
2659
|
-
align="start"
|
|
2660
|
-
className="flex w-auto max-w-xs flex-col gap-2 p-2"
|
|
2661
|
-
>
|
|
2662
|
-
<div className="text-center font-semibold text-sm">
|
|
2663
|
-
{t('other_properties')}
|
|
2664
|
-
</div>
|
|
2665
|
-
<div className="border" />
|
|
2666
|
-
<div className="flex flex-col gap-2">
|
|
2667
|
-
{hiddenBadges.map((badge) => badge.element)}
|
|
2668
|
-
</div>
|
|
2669
|
-
</HoverCardContent>
|
|
2670
|
-
</HoverCard>
|
|
2671
|
-
)}
|
|
2672
|
-
{/* Description indicators */}
|
|
2673
|
-
{(descriptionMeta.hasText ||
|
|
2674
|
-
descriptionMeta.hasImages ||
|
|
2675
|
-
descriptionMeta.hasVideos ||
|
|
2676
|
-
descriptionMeta.hasLinks) && (
|
|
2677
|
-
<div
|
|
2678
|
-
ref={descriptionMetaRef}
|
|
2679
|
-
className="flex min-w-0 shrink-0 items-center gap-0.5"
|
|
2680
|
-
>
|
|
2681
|
-
{descriptionMeta.hasText && (
|
|
2682
|
-
<div
|
|
2683
|
-
className="flex items-center gap-0.5 rounded bg-dynamic-surface/50 py-0.5"
|
|
2684
|
-
title={t('has_description')}
|
|
2685
|
-
>
|
|
2686
|
-
<FileText className="h-3.5 w-3.5 text-muted-foreground" />
|
|
2687
|
-
</div>
|
|
2688
|
-
)}
|
|
2689
|
-
{descriptionMeta.hasImages && (
|
|
2690
|
-
<div
|
|
2691
|
-
className="flex items-center gap-0.5 rounded bg-dynamic-surface/50 py-0.5"
|
|
2692
|
-
title={t('n_images', {
|
|
2693
|
-
count: descriptionMeta.imageCount,
|
|
2694
|
-
})}
|
|
2695
|
-
>
|
|
2696
|
-
<ImageIcon className="h-3.5 w-3.5 text-muted-foreground" />
|
|
2697
|
-
{descriptionMeta.imageCount > 1 && (
|
|
2698
|
-
<span className="text-[9px] text-muted-foreground">
|
|
2699
|
-
{descriptionMeta.imageCount}
|
|
2700
|
-
</span>
|
|
2701
|
-
)}
|
|
2702
|
-
</div>
|
|
2703
|
-
)}
|
|
2704
|
-
{descriptionMeta.hasVideos && (
|
|
2705
|
-
<div
|
|
2706
|
-
className="flex items-center gap-0.5 rounded bg-dynamic-surface/50 py-0.5"
|
|
2707
|
-
title={t('n_videos', {
|
|
2708
|
-
count: descriptionMeta.videoCount,
|
|
2709
|
-
})}
|
|
2710
|
-
>
|
|
2711
|
-
<Play className="h-3.5 w-3.5 text-muted-foreground" />
|
|
2712
|
-
{descriptionMeta.videoCount > 1 && (
|
|
2713
|
-
<span className="text-[9px] text-muted-foreground">
|
|
2714
|
-
{descriptionMeta.videoCount}
|
|
2715
|
-
</span>
|
|
2716
|
-
)}
|
|
2717
|
-
</div>
|
|
2718
|
-
)}
|
|
2719
|
-
{descriptionMeta.hasLinks && (
|
|
2720
|
-
<div
|
|
2721
|
-
className="flex items-center gap-0.5 rounded bg-dynamic-surface/50 px-1 py-0.5"
|
|
2722
|
-
title={t('n_links', { count: descriptionMeta.linkCount })}
|
|
2723
|
-
>
|
|
2724
|
-
<Link2 className="h-2.5 w-2.5 text-muted-foreground" />
|
|
2725
|
-
{descriptionMeta.linkCount > 1 && (
|
|
2726
|
-
<span className="text-[9px] text-muted-foreground">
|
|
2727
|
-
{descriptionMeta.linkCount}
|
|
2728
|
-
</span>
|
|
2729
|
-
)}
|
|
2730
|
-
</div>
|
|
2731
|
-
)}
|
|
2732
|
-
</div>
|
|
2733
|
-
)}
|
|
2734
|
-
</div>
|
|
2735
|
-
<div className="flex min-h-5 items-center gap-2 sm:min-h-6">
|
|
2736
|
-
{!isPersonalWorkspace && (
|
|
2737
|
-
<TaskViewerAvatarsComponent taskId={task.id} />
|
|
2738
|
-
)}
|
|
2739
|
-
|
|
2740
|
-
{/* Checkbox: hidden for documents lists */}
|
|
2741
|
-
{shouldRenderTaskCardCompletionCheckbox({
|
|
2742
|
-
isMultiSelectMode,
|
|
2743
|
-
taskListStatus: taskList?.status,
|
|
2744
|
-
}) && (
|
|
2745
|
-
<TaskCardCheckbox
|
|
2746
|
-
task={task}
|
|
2747
|
-
taskList={taskList}
|
|
2748
|
-
isLoading={isLoading}
|
|
2749
|
-
onToggle={handleArchiveToggle}
|
|
2750
|
-
/>
|
|
2751
|
-
)}
|
|
2752
|
-
</div>
|
|
2753
|
-
</div>
|
|
2754
|
-
)}
|
|
2755
|
-
</div>
|
|
2756
|
-
<TaskDeleteDialog
|
|
2757
|
-
task={task}
|
|
2758
|
-
open={dialogState.deleteDialogOpen}
|
|
2759
|
-
isLoading={isLoading}
|
|
2760
|
-
onOpenChange={(open) =>
|
|
2761
|
-
open
|
|
2762
|
-
? dialogActions.openDeleteDialog()
|
|
2763
|
-
: dialogActions.closeDeleteDialog()
|
|
2764
|
-
}
|
|
2765
|
-
onConfirm={handleDelete}
|
|
2766
|
-
translations={{
|
|
2767
|
-
delete_task: t('delete_task'),
|
|
2768
|
-
delete_task_confirmation: t('delete_task_confirmation', {
|
|
2769
|
-
name: task.name ?? '',
|
|
2770
|
-
}),
|
|
2771
|
-
cancel: t('cancel'),
|
|
2772
|
-
deleting: t('deleting'),
|
|
2773
|
-
}}
|
|
2774
|
-
/>
|
|
2775
|
-
{effectiveWorkspaceId && (
|
|
2776
|
-
<CreateListDialog
|
|
2777
|
-
open={isCreateListDialogOpen}
|
|
2778
|
-
onOpenChange={setIsCreateListDialogOpen}
|
|
2779
|
-
boardId={taskBoardId}
|
|
2780
|
-
wsId={effectiveWorkspaceId}
|
|
2781
|
-
initialStatus="active"
|
|
2782
|
-
onSuccess={(listId) => {
|
|
2783
|
-
handleMoveToList(listId);
|
|
2784
|
-
}}
|
|
2785
|
-
translations={{
|
|
2786
|
-
listNameAlreadyExists: taskBoardT(
|
|
2787
|
-
'ws-task-boards.layout_settings.list_name_exists'
|
|
2788
|
-
),
|
|
2789
|
-
}}
|
|
2790
|
-
/>
|
|
2791
|
-
)}
|
|
2792
|
-
<TaskNewLabelDialog
|
|
2793
|
-
open={dialogState.newLabelDialogOpen}
|
|
2794
|
-
newLabelName={newLabelName}
|
|
2795
|
-
newLabelColor={newLabelColor}
|
|
2796
|
-
creatingLabel={creatingLabel}
|
|
2797
|
-
onNameChange={setNewLabelName}
|
|
2798
|
-
onColorChange={setNewLabelColor}
|
|
2799
|
-
onOpenChange={(open) =>
|
|
2800
|
-
open ? openNewLabelDialog() : dialogActions.closeNewLabelDialog()
|
|
2801
|
-
}
|
|
2802
|
-
onConfirm={async () => {
|
|
2803
|
-
const result = await createNewLabel();
|
|
2804
|
-
if (result) dialogActions.closeNewLabelDialog();
|
|
2805
|
-
}}
|
|
2806
|
-
translations={{
|
|
2807
|
-
create_new_label: t('create_new_label'),
|
|
2808
|
-
create_new_label_description: t('create_new_label_description'),
|
|
2809
|
-
label_name: t('label_name'),
|
|
2810
|
-
color: t('color'),
|
|
2811
|
-
preview: t('preview'),
|
|
2812
|
-
cancel: t('cancel'),
|
|
2813
|
-
creating: t('creating'),
|
|
2814
|
-
create_label: t('create_label'),
|
|
2815
|
-
randomize_color: t('randomize_color'),
|
|
2816
|
-
}}
|
|
2817
|
-
/>
|
|
2818
|
-
|
|
2819
|
-
<TaskNewProjectDialog
|
|
2820
|
-
open={dialogState.newProjectDialogOpen}
|
|
2821
|
-
newProjectName={newProjectName}
|
|
2822
|
-
creatingProject={creatingProject}
|
|
2823
|
-
onNameChange={setNewProjectName}
|
|
2824
|
-
onOpenChange={(open) =>
|
|
2825
|
-
open
|
|
2826
|
-
? dialogActions.openNewProjectDialog()
|
|
2827
|
-
: dialogActions.closeNewProjectDialog()
|
|
2828
|
-
}
|
|
2829
|
-
onConfirm={async () => {
|
|
2830
|
-
const result = await createNewProject();
|
|
2831
|
-
if (result) dialogActions.closeNewProjectDialog();
|
|
2832
|
-
}}
|
|
2833
|
-
translations={{
|
|
2834
|
-
create_new_project: t('create_new_project'),
|
|
2835
|
-
create_new_project_description: t('create_new_project_description'),
|
|
2836
|
-
project_name: t('project_name'),
|
|
2837
|
-
cancel: t('cancel'),
|
|
2838
|
-
creating: t('creating'),
|
|
2839
|
-
create_project: t('create_project'),
|
|
2840
|
-
}}
|
|
2841
|
-
/>
|
|
2842
|
-
|
|
2843
|
-
<TaskCustomDateDialog
|
|
2844
|
-
open={dialogState.customDateDialogOpen}
|
|
2845
|
-
endDate={task.end_date ?? null}
|
|
2846
|
-
isLoading={isLoading}
|
|
2847
|
-
onOpenChange={(open) =>
|
|
2848
|
-
open
|
|
2849
|
-
? dialogActions.openCustomDateDialog()
|
|
2850
|
-
: dialogActions.closeCustomDateDialog()
|
|
2851
|
-
}
|
|
2852
|
-
onDateChange={handleCustomDateChange}
|
|
2853
|
-
onClear={() => {
|
|
2854
|
-
handleDueDateChange(null);
|
|
2855
|
-
dialogActions.closeCustomDateDialog();
|
|
2856
|
-
}}
|
|
2857
|
-
translations={{
|
|
2858
|
-
set_custom_due_date: t('set_custom_due_date'),
|
|
2859
|
-
custom_due_date_description: t('custom_due_date_description'),
|
|
2860
|
-
cancel: t('cancel'),
|
|
2861
|
-
remove_due_date: t('remove_due_date'),
|
|
2862
|
-
}}
|
|
2863
|
-
/>
|
|
2864
|
-
{taskShareWsId && (
|
|
2865
|
-
<TaskShareDialog
|
|
2866
|
-
open={shareDialogOpen}
|
|
2867
|
-
onOpenChange={setShareDialogOpen}
|
|
2868
|
-
taskId={task.id}
|
|
2869
|
-
taskName={task.name ?? ''}
|
|
2870
|
-
wsId={taskShareWsId}
|
|
2871
|
-
/>
|
|
2872
|
-
)}
|
|
2873
|
-
|
|
2874
|
-
{!isOverlay && !isPersonalExternalTask && (
|
|
2875
|
-
<TaskActions taskId={task.id} boardId={boardId} onUpdate={onUpdate} />
|
|
2876
|
-
)}
|
|
2877
|
-
</Card>
|
|
2878
|
-
);
|
|
2879
|
-
}
|
|
2880
|
-
|
|
2881
|
-
function TaskCardComponent(props: TaskCardProps) {
|
|
2882
|
-
if (props.readOnly) {
|
|
2883
|
-
return <ReadOnlyTaskCard {...props} />;
|
|
2884
|
-
}
|
|
2885
|
-
|
|
2886
|
-
return <TaskCardInner {...props} />;
|
|
2887
|
-
}
|
|
2888
|
-
|
|
2889
|
-
export const TaskCard = React.memo(TaskCardComponent, areTaskCardPropsEqual);
|