sdlc-hub/web/src/modules/jira/agile/KanbanPage.tsx
Andrey Epifancev 611ed830c4 Веб: страница «Kanban» (#108)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 20:21:04 +04:00

39 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { Project } from "../../../api/types.ts";
import { PageHeader } from "../../../ui/index.ts";
import { RefreshButton } from "../RefreshButton.tsx";
import { AgileGate } from "./AgileGate.tsx";
import { BoardColumns } from "./BoardColumns.tsx";
import { columnsOf } from "./columns.ts";
import { AgileIssueRow } from "./IssueRow.tsx";
import "./agile.css";
// «Kanban» (spec web-app): колонки доски; при включённом бэклоге Jira первая колонка не рисуется, её задачи — в «Бэклог (N)» (R-18)
export function KanbanPage({ project }: { project: Project }) {
return (
<div data-testid="page-kanban" className="agile agile--wide">
<PageHeader title="Kanban" actions={<RefreshButton />} />
<AgileGate project={project} kind="kanban">
{(d) => {
const withBacklog = d.board?.kanban_backlog === true;
const cols = d.board?.columns ?? null;
// задачи первой колонки уходят в «Бэклог», а не в «Без колонки»
const first = new Set(withBacklog && cols ? cols[0]?.statuses ?? [] : []);
const issues = (d.board_issues ?? []).filter((i) => i.status === null || !first.has(i.status));
const backlog = d.backlog ?? [];
return (
<>
{withBacklog && (
<details className="agile-past">
<summary>{`Бэклог (${backlog.length})`}</summary>
<ul className="agile-list">{backlog.map((i) => <AgileIssueRow key={i.key} issue={i} />)}</ul>
</details>
)}
<BoardColumns columns={columnsOf(withBacklog && cols ? cols.slice(1) : cols, issues)} lastCaption="за 14 дней" />
</>
);
}}
</AgileGate>
</div>
);
}