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:
@@ -406,6 +406,28 @@ async def update_task(
|
||||
update_data = task_data.model_dump(exclude_unset=True)
|
||||
custom_values_data = update_data.pop("custom_values", None)
|
||||
|
||||
# Track old assignee for workload cache invalidation
|
||||
old_assignee_id = task.assignee_id
|
||||
|
||||
# Validate assignee_id if provided
|
||||
if "assignee_id" in update_data and update_data["assignee_id"]:
|
||||
assignee = db.query(User).filter(User.id == update_data["assignee_id"]).first()
|
||||
if not assignee:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail="Assignee not found",
|
||||
)
|
||||
|
||||
# Validate status_id if provided
|
||||
if "status_id" in update_data and update_data["status_id"]:
|
||||
from app.models.task_status import TaskStatus
|
||||
task_status = db.query(TaskStatus).filter(TaskStatus.id == update_data["status_id"]).first()
|
||||
if not task_status:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_404_NOT_FOUND,
|
||||
detail="Status not found",
|
||||
)
|
||||
|
||||
# Get the proposed start_date and due_date for validation
|
||||
new_start_date = update_data.get("start_date", task.start_date)
|
||||
new_due_date = update_data.get("due_date", task.due_date)
|
||||
@@ -486,6 +508,15 @@ async def update_task(
|
||||
if "original_estimate" in update_data and task.assignee_id:
|
||||
invalidate_user_workload_cache(task.assignee_id)
|
||||
|
||||
# Invalidate workload cache if assignee changed
|
||||
if "assignee_id" in update_data:
|
||||
# Invalidate old assignee's cache
|
||||
if old_assignee_id and old_assignee_id != task.assignee_id:
|
||||
invalidate_user_workload_cache(old_assignee_id)
|
||||
# Invalidate new assignee's cache
|
||||
if task.assignee_id:
|
||||
invalidate_user_workload_cache(task.assignee_id)
|
||||
|
||||
# Publish real-time event
|
||||
try:
|
||||
await publish_task_event(
|
||||
|
||||
Reference in New Issue
Block a user