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:
beabigegg
2026-01-10 01:32:13 +08:00
parent 2796cbb42d
commit 55f85d0d3c
44 changed files with 1854 additions and 297 deletions

View File

@@ -28,6 +28,7 @@ interface Task {
start_date: string | null
time_estimate: number | null
subtask_count: number
parent_task_id: string | null
custom_values?: CustomValueResponse[]
}
@@ -83,6 +84,7 @@ export default function Tasks() {
description: '',
priority: 'medium',
assignee_id: '',
start_date: '',
due_date: '',
time_estimate: '',
})
@@ -172,6 +174,7 @@ export default function Tasks() {
start_date: (event.data.start_date as string) ?? null,
time_estimate: event.data.time_estimate ?? event.data.original_estimate ?? null,
subtask_count: event.data.subtask_count ?? 0,
parent_task_id: (event.data.parent_task_id as string) ?? null,
}
return [...prev, newTask]
})
@@ -318,8 +321,13 @@ export default function Tasks() {
if (newTask.assignee_id) {
payload.assignee_id = newTask.assignee_id
}
if (newTask.start_date) {
// Convert date string to datetime format for Pydantic
payload.start_date = `${newTask.start_date}T00:00:00`
}
if (newTask.due_date) {
payload.due_date = newTask.due_date
// Convert date string to datetime format for Pydantic
payload.due_date = `${newTask.due_date}T00:00:00`
}
if (newTask.time_estimate) {
payload.original_estimate = Number(newTask.time_estimate)
@@ -347,6 +355,7 @@ export default function Tasks() {
description: '',
priority: 'medium',
assignee_id: '',
start_date: '',
due_date: '',
time_estimate: '',
})
@@ -419,8 +428,22 @@ export default function Tasks() {
setSelectedTask(null)
}
const handleTaskUpdate = () => {
loadData()
const handleTaskUpdate = async () => {
await loadData()
// If a task is selected (modal is open), re-fetch its data to show updated values
if (selectedTask) {
try {
const response = await api.get(`/tasks/${selectedTask.id}`)
const updatedTask = response.data
setSelectedTask({
...updatedTask,
project_id: projectId!,
time_estimate: updatedTask.original_estimate,
})
} catch (err) {
console.error('Failed to refresh selected task:', err)
}
}
}
const handleSubtaskClick = async (subtaskId: string) => {
@@ -742,6 +765,14 @@ export default function Tasks() {
/>
<div style={styles.fieldSpacer} />
<label style={styles.label}>{t('fields.startDate')}</label>
<input
type="date"
value={newTask.start_date}
onChange={(e) => setNewTask({ ...newTask, start_date: e.target.value })}
style={styles.input}
/>
<label style={styles.label}>{t('fields.dueDate')}</label>
<input
type="date"