From 9e24516bd0ab304fa6162fed1a158db1806e63fe Mon Sep 17 00:00:00 2001 From: Markov Date: Sat, 28 Feb 2026 00:28:52 +0100 Subject: [PATCH] Status selector in CreateTaskModal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Buttons: Бэклог, To Do, В работе, Ревью, Готово Default from initialStatus (column where + was clicked) --- src/components/CreateTaskModal.tsx | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/components/CreateTaskModal.tsx b/src/components/CreateTaskModal.tsx index 903dcc4..2f7de8b 100644 --- a/src/components/CreateTaskModal.tsx +++ b/src/components/CreateTaskModal.tsx @@ -3,6 +3,14 @@ import { useState } from "react"; import type { Task } from "@/lib/api"; import { createTask } from "@/lib/api"; +const STATUSES = [ + { key: "backlog", label: "Бэклог" }, + { key: "todo", label: "To Do" }, + { key: "in_progress", label: "В работе" }, + { key: "in_review", label: "Ревью" }, + { key: "done", label: "Готово" }, +]; + const PRIORITIES = [ { key: "low", label: "Low", color: "#737373" }, { key: "medium", label: "Medium", color: "#3b82f6" }, @@ -22,6 +30,7 @@ interface Props { export default function CreateTaskModal({ projectId, initialStatus, parentId, parentKey, onClose, onCreated }: Props) { const [title, setTitle] = useState(""); const [description, setDescription] = useState(""); + const [status, setStatus] = useState(initialStatus); const [priority, setPriority] = useState("medium"); const [saving, setSaving] = useState(false); const [error, setError] = useState(""); @@ -34,7 +43,7 @@ export default function CreateTaskModal({ projectId, initialStatus, parentId, pa const task = await createTask(projectId, { title: title.trim(), description: description.trim() || undefined, - status: initialStatus, + status, priority, parent_id: parentId, }); @@ -81,6 +90,22 @@ export default function CreateTaskModal({ projectId, initialStatus, parentId, pa /> +
+ +
+ {STATUSES.map((s) => ( + + ))} +
+
+