feat: implement soft delete, task editing fixes, and UI improvements
Backend: - Add soft delete for spaces and projects (is_active flag) - Add status_id and assignee_id to TaskUpdate schema - Fix task PATCH endpoint to update status and assignee - Add validation for assignee_id and status_id in task updates - Fix health service to count tasks with "Blocked" status as blockers - Filter out deleted spaces/projects from health dashboard - Add workload cache invalidation on assignee changes Frontend: - Add delete confirmation dialogs for spaces and projects - Fix UserSelect to display selected user name (valueName prop) - Fix task detail modal to refresh data after save - Enforce 2-level subtask depth limit in UI - Fix timezone bug in date formatting (use local timezone) - Convert NotificationBell from Tailwind to inline styles - Add i18n translations for health, workload, settings pages - Add parent_task_id to Task interface across components OpenSpec: - Archive add-delete-capability change 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -219,6 +219,64 @@ The system SHALL allow assigning tasks to users during creation and editing.
|
||||
- **THEN** the values are saved with the task
|
||||
- **AND** the task appears on the appropriate date in calendar view
|
||||
|
||||
### Requirement: Space Deletion
|
||||
系統 SHALL 允許空間擁有者刪除空間(軟刪除)。
|
||||
|
||||
#### Scenario: 刪除空白空間
|
||||
- **GIVEN** 使用者是空間的擁有者
|
||||
- **AND** 空間內沒有任何專案
|
||||
- **WHEN** 使用者點擊刪除按鈕並確認
|
||||
- **THEN** 系統將空間標記為已刪除 (is_active = false)
|
||||
- **AND** 空間不再顯示於列表中
|
||||
- **AND** 顯示成功通知
|
||||
|
||||
#### Scenario: 刪除含專案的空間
|
||||
- **GIVEN** 使用者是空間的擁有者
|
||||
- **AND** 空間內包含一個或多個專案
|
||||
- **WHEN** 使用者點擊刪除按鈕
|
||||
- **THEN** 系統顯示警告對話框,說明包含 N 個專案
|
||||
- **AND** 要求使用者輸入空間名稱以確認刪除
|
||||
- **WHEN** 使用者正確輸入名稱並確認
|
||||
- **THEN** 系統將空間標記為已刪除
|
||||
- **AND** 空間內的專案同時被軟刪除
|
||||
- **AND** 顯示成功通知
|
||||
|
||||
#### Scenario: 非擁有者無法刪除空間
|
||||
- **GIVEN** 使用者不是空間的擁有者
|
||||
- **WHEN** 使用者嘗試刪除空間
|
||||
- **THEN** 系統拒絕操作
|
||||
- **AND** 顯示權限不足的錯誤訊息
|
||||
|
||||
### Requirement: Project Deletion
|
||||
系統 SHALL 允許專案擁有者刪除專案(軟刪除),並記錄於稽核日誌。
|
||||
|
||||
#### Scenario: 刪除專案
|
||||
- **GIVEN** 使用者是專案的擁有者
|
||||
- **WHEN** 使用者點擊刪除按鈕
|
||||
- **THEN** 系統顯示確認對話框,說明專案內的任務數量
|
||||
- **WHEN** 使用者確認刪除
|
||||
- **THEN** 系統將專案標記為已刪除 (is_active = false)
|
||||
- **AND** 專案不再顯示於空間的專案列表中
|
||||
- **AND** 系統記錄刪除事件至稽核日誌
|
||||
- **AND** 顯示成功通知
|
||||
|
||||
#### Scenario: 非擁有者無法刪除專案
|
||||
- **GIVEN** 使用者不是專案的擁有者
|
||||
- **WHEN** 使用者嘗試刪除專案
|
||||
- **THEN** 系統拒絕操作
|
||||
- **AND** 顯示權限不足的錯誤訊息
|
||||
|
||||
#### Scenario: 刪除專案的稽核記錄
|
||||
- **GIVEN** 專案擁有者刪除專案
|
||||
- **WHEN** 刪除操作完成
|
||||
- **THEN** 稽核日誌記錄以下資訊:
|
||||
- event_type: "project.delete"
|
||||
- resource_type: "project"
|
||||
- action: DELETE
|
||||
- user_id: 執行刪除的使用者
|
||||
- resource_id: 被刪除的專案 ID
|
||||
- changes: [{ field: "is_active", old_value: true, new_value: false }]
|
||||
|
||||
## Data Model
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user