From c7144328fa9747ccd32f0d0ee67654cb9c2606bf Mon Sep 17 00:00:00 2001 From: Markov Date: Wed, 25 Feb 2026 00:13:36 +0100 Subject: [PATCH] refactor: UUID-based member refs in API types and components MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Task interface: assignee_id/assignee, reviewer_id/reviewer, watcher_ids - Message interface: author_id/author вместо author_slug - API functions: assignTask использует assignee_id - KanbanBoard: обновлен под новые поля задач - TaskModal: assignee selection по ID вместо slug - ChatPanel: отображение author через relationship --- src/components/ChatPanel.tsx | 2 +- src/components/KanbanBoard.tsx | 6 +++--- src/components/TaskModal.tsx | 10 +++++----- src/lib/api.ts | 15 +++++++++------ 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/components/ChatPanel.tsx b/src/components/ChatPanel.tsx index cf97c58..f4cb4ef 100644 --- a/src/components/ChatPanel.tsx +++ b/src/components/ChatPanel.tsx @@ -125,7 +125,7 @@ export default function ChatPanel({ chatId }: Props) {
{AUTHOR_ICON[msg.author_type] || "👤"} - {msg.author_slug} + {msg.author?.name || msg.author?.slug || "Unknown"} · {new Date(msg.created_at).toLocaleString("ru-RU", { hour: "2-digit", minute: "2-digit" })}
diff --git a/src/components/KanbanBoard.tsx b/src/components/KanbanBoard.tsx index 9f8eae5..bfe151c 100644 --- a/src/components/KanbanBoard.tsx +++ b/src/components/KanbanBoard.tsx @@ -63,7 +63,7 @@ export default function KanbanBoard({ projectId, projectSlug }: Props) { const unsubscribeAssigned = wsClient.on("task.assigned", (data: any) => { if (data.project_id === projectId) { - setTasks((prev) => prev.map((t) => t.id === data.id ? { ...t, assignee_slug: data.assignee_slug, assigned_at: data.assigned_at } : t)); + setTasks((prev) => prev.map((t) => t.id === data.id ? { ...t, assignee_id: data.assignee_id, assignee: data.assignee, assigned_at: data.assigned_at } : t)); } }); @@ -106,8 +106,8 @@ export default function KanbanBoard({ projectId, projectSlug }: Props) { style={{ background: PRIORITY_COLORS[task.priority] || "#737373" }} title={task.priority} /> {prefix}-{task.number} - {task.assignee_slug && ( - → {task.assignee_slug} + {task.assignee && ( + → {task.assignee.slug} )}
{task.title}
diff --git a/src/components/TaskModal.tsx b/src/components/TaskModal.tsx index d97dcf3..c815389 100644 --- a/src/components/TaskModal.tsx +++ b/src/components/TaskModal.tsx @@ -42,7 +42,7 @@ export default function TaskModal({ task, projectId: _projectId, projectSlug: _p const [description, setDescription] = useState(task.description || ""); const [status, setStatus] = useState(task.status); const [priority, setPriority] = useState(task.priority); - const [assigneeSlug, setAssigneeSlug] = useState(task.assignee_slug || ""); + const [assigneeId, setAssigneeId] = useState(task.assignee_id || ""); const [members, setMembers] = useState([]); const [steps, setSteps] = useState(task.steps || []); const [comments, setComments] = useState([]); @@ -307,16 +307,16 @@ export default function TaskModal({ task, projectId: _projectId, projectSlug: _p
Исполнитель