diff --git a/web/src/modules/jira/agile/SprintPage.test.tsx b/web/src/modules/jira/agile/SprintPage.test.tsx index cac26ee..9f8f09a 100644 --- a/web/src/modules/jira/agile/SprintPage.test.tsx +++ b/web/src/modules/jira/agile/SprintPage.test.tsx @@ -224,6 +224,17 @@ describe("«Спринт»", () => { await userEvent.click(within(p).getByRole("checkbox", { name: "Скрыть выполненные" })); expect(within(p).queryByText("Тема AURORA-2")).toBeNull(); expect(within(p).getByText("Тема AURORA-1")).toBeInTheDocument(); + const cols = Array.from(p.querySelectorAll(".agile-col")); + expect(cols.map((c) => c.querySelector(".agile-col__count")!.textContent)).toEqual(["1", "0", "1"]); + }); + + it("эпик на доске спринта — карточка, учитывается в числе колонки", async () => { + hub(agile([s102({ issues: [iss("AURORA-1"), iss("AURORA-E", { issue_type: "Эпик" })] })])); + open("/app/jira/sprint?project=AWPCA"); + const p = await page(); + expect(await within(p).findByText("Тема AURORA-E")).toBeInTheDocument(); + const cols = Array.from(p.querySelectorAll(".agile-col")); + expect(cols[0].querySelector(".agile-col__count")!.textContent).toBe("2"); }); it("нет активного — «Нет активного спринта» и ссылка «Бэклог»", async () => { diff --git a/web/src/modules/jira/agile/SprintPage.tsx b/web/src/modules/jira/agile/SprintPage.tsx index 6858646..0c20af2 100644 --- a/web/src/modules/jira/agile/SprintPage.tsx +++ b/web/src/modules/jira/agile/SprintPage.tsx @@ -10,7 +10,7 @@ import { columnsOf } from "./columns.ts"; import { assigneeOptions, matches, parseSprintIds, selectableSprints, sprintIssues } from "./filters.ts"; import { SprintPicker } from "./SprintPicker.tsx"; import { useAgileView } from "./useAgileView.ts"; -import { daysLeft, fmtRange, fmtSp, isEpic, tasksWord } from "./model.ts"; +import { daysLeft, fmtRange, fmtSp, tasksWord } from "./model.ts"; import "./agile.css"; function SprintHead({ s }: { s: AgileSprint }) { @@ -39,7 +39,7 @@ export function SprintPage({ project }: { project: Project }) { const selectable = selectableSprints(d.sprints); const ids = parseSprintIds(params.get("sprint"), d.sprints); const chosen = selectable.filter((s) => ids.includes(s.id)); - const issues = sprintIssues(chosen).filter((i) => !isEpic(i)); + const issues = sprintIssues(chosen); const shown = issues.filter((i) => matches(i, filter)); // выбор спринтов — в адресе, без новой записи истории const pick = (next: number[]) => setParams((p) => { const n = new URLSearchParams(p); n.set("sprint", next.join(",")); return n; }, { replace: true }); diff --git a/web/src/modules/jira/agile/SprintPicker.tsx b/web/src/modules/jira/agile/SprintPicker.tsx index 87e60b3..fec0ada 100644 --- a/web/src/modules/jira/agile/SprintPicker.tsx +++ b/web/src/modules/jira/agile/SprintPicker.tsx @@ -6,7 +6,7 @@ export function SprintPicker({ sprints, selected, onChange }: { sprints: AgileSprint[]; selected: number[]; onChange(ids: number[]): void; }) { const chosen = sprints.filter((s) => selected.includes(s.id)); - const label = chosen.length === 1 ? chosen[0].name : `Спринты: ${chosen.length}`; + const label = chosen.length === 1 ? chosen[0].name : chosen.length === 0 ? "Спринты" : `Спринты: ${chosen.length}`; const flip = (id: number, on: boolean) => onChange(sprints.map((s) => s.id).filter((x) => (x === id ? on : selected.includes(x)))); return ( (