feat(kanban): drag-to-delete trash zone + bulk delete for task cards
Salvages #28125 by @Jpalmer95. Adds: - Drag-to-delete trash zone in the kanban dashboard - Bulk delete endpoint with cascading delete_task cleanup - Frontend updates (drag visual + drop handler) - Confirmation prompt before delete Resolved end-of-file test conflict by appending both halves.
This commit is contained in:
@@ -485,6 +485,33 @@ def test_patch_status_running_rejected(client):
|
||||
assert statuses.get(t["id"]) != "running"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# DELETE /tasks/:id
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def test_delete_task(client):
|
||||
t = client.post("/api/plugins/kanban/tasks", json={"title": "to-delete"}).json()["task"]
|
||||
r = client.delete(f"/api/plugins/kanban/tasks/{t['id']}")
|
||||
assert r.status_code == 200
|
||||
assert r.json()["deleted"] is True
|
||||
assert r.json()["task_id"] == t["id"]
|
||||
|
||||
# Gone from board
|
||||
board = client.get("/api/plugins/kanban/board").json()
|
||||
all_ids = [tt["id"] for col in board["columns"] for tt in col["tasks"]]
|
||||
assert t["id"] not in all_ids
|
||||
|
||||
# Gone from detail
|
||||
r = client.get(f"/api/plugins/kanban/tasks/{t['id']}")
|
||||
assert r.status_code == 404
|
||||
|
||||
|
||||
def test_delete_task_not_found(client):
|
||||
r = client.delete("/api/plugins/kanban/tasks/t_nonexistent")
|
||||
assert r.status_code == 404
|
||||
assert "not found" in r.json()["detail"]
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Comments + Links
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user