Add cancelled status for tasks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6e872121eb
commit
bf38532f59
5 changed files with 7 additions and 6 deletions
|
|
@ -223,7 +223,7 @@ def task_show(ctx, id):
|
||||||
@task.command("update")
|
@task.command("update")
|
||||||
@click.argument("task_id")
|
@click.argument("task_id")
|
||||||
@click.option("--status", type=click.Choice(
|
@click.option("--status", type=click.Choice(
|
||||||
["pending", "in_progress", "review", "done", "blocked", "decomposed"]),
|
["pending", "in_progress", "review", "done", "blocked", "decomposed", "cancelled"]),
|
||||||
default=None, help="New status")
|
default=None, help="New status")
|
||||||
@click.option("--priority", type=int, default=None, help="New priority (1-10)")
|
@click.option("--priority", type=int, default=None, help="New priority (1-10)")
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
|
|
|
||||||
|
|
@ -256,9 +256,9 @@ def test_patch_task_status_persisted(client):
|
||||||
assert r.json()["status"] == "blocked"
|
assert r.json()["status"] == "blocked"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("status", ["pending", "in_progress", "review", "done", "blocked"])
|
@pytest.mark.parametrize("status", ["pending", "in_progress", "review", "done", "blocked", "cancelled"])
|
||||||
def test_patch_task_all_valid_statuses(client, status):
|
def test_patch_task_all_valid_statuses(client, status):
|
||||||
"""Все 5 допустимых статусов должны приниматься."""
|
"""Все 6 допустимых статусов должны приниматься."""
|
||||||
r = client.patch("/api/tasks/P1-001", json={"status": status})
|
r = client.patch("/api/tasks/P1-001", json={"status": status})
|
||||||
assert r.status_code == 200
|
assert r.status_code == 200
|
||||||
assert r.json()["status"] == status
|
assert r.json()["status"] == status
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ class TaskPatch(BaseModel):
|
||||||
status: str
|
status: str
|
||||||
|
|
||||||
|
|
||||||
VALID_STATUSES = {"pending", "in_progress", "review", "done", "blocked"}
|
VALID_STATUSES = {"pending", "in_progress", "review", "done", "blocked", "cancelled"}
|
||||||
|
|
||||||
|
|
||||||
@app.patch("/api/tasks/{task_id}")
|
@app.patch("/api/tasks/{task_id}")
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ const filteredDecisions = computed(() => {
|
||||||
function taskStatusColor(s: string) {
|
function taskStatusColor(s: string) {
|
||||||
const m: Record<string, string> = {
|
const m: Record<string, string> = {
|
||||||
pending: 'gray', in_progress: 'blue', review: 'purple',
|
pending: 'gray', in_progress: 'blue', review: 'purple',
|
||||||
done: 'green', blocked: 'red', decomposed: 'yellow',
|
done: 'green', blocked: 'red', decomposed: 'yellow', cancelled: 'gray',
|
||||||
}
|
}
|
||||||
return m[s] || 'gray'
|
return m[s] || 'gray'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ onUnmounted(stopPolling)
|
||||||
function statusColor(s: string) {
|
function statusColor(s: string) {
|
||||||
const m: Record<string, string> = {
|
const m: Record<string, string> = {
|
||||||
pending: 'gray', in_progress: 'blue', review: 'yellow',
|
pending: 'gray', in_progress: 'blue', review: 'yellow',
|
||||||
done: 'green', blocked: 'red', decomposed: 'purple',
|
done: 'green', blocked: 'red', decomposed: 'purple', cancelled: 'gray',
|
||||||
}
|
}
|
||||||
return m[s] || 'gray'
|
return m[s] || 'gray'
|
||||||
}
|
}
|
||||||
|
|
@ -228,6 +228,7 @@ async function changeStatus(newStatus: string) {
|
||||||
<option value="review">review</option>
|
<option value="review">review</option>
|
||||||
<option value="done">done</option>
|
<option value="done">done</option>
|
||||||
<option value="blocked">blocked</option>
|
<option value="blocked">blocked</option>
|
||||||
|
<option value="cancelled">cancelled</option>
|
||||||
</select>
|
</select>
|
||||||
<span v-if="isRunning" class="inline-block w-2 h-2 bg-blue-500 rounded-full animate-pulse"></span>
|
<span v-if="isRunning" class="inline-block w-2 h-2 bg-blue-500 rounded-full animate-pulse"></span>
|
||||||
<span class="text-xs text-gray-600">pri {{ task.priority }}</span>
|
<span class="text-xs text-gray-600">pri {{ task.priority }}</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue