fix(web): «Спринт» — эпики остаются карточками, подпись пустого выбора, числа колонок в тесте (#112)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
dea051e7f9
commit
d4d578e10e
@ -224,6 +224,17 @@ describe("«Спринт»", () => {
|
|||||||
await userEvent.click(within(p).getByRole("checkbox", { name: "Скрыть выполненные" }));
|
await userEvent.click(within(p).getByRole("checkbox", { name: "Скрыть выполненные" }));
|
||||||
expect(within(p).queryByText("Тема AURORA-2")).toBeNull();
|
expect(within(p).queryByText("Тема AURORA-2")).toBeNull();
|
||||||
expect(within(p).getByText("Тема AURORA-1")).toBeInTheDocument();
|
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 () => {
|
it("нет активного — «Нет активного спринта» и ссылка «Бэклог»", async () => {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { columnsOf } from "./columns.ts";
|
|||||||
import { assigneeOptions, matches, parseSprintIds, selectableSprints, sprintIssues } from "./filters.ts";
|
import { assigneeOptions, matches, parseSprintIds, selectableSprints, sprintIssues } from "./filters.ts";
|
||||||
import { SprintPicker } from "./SprintPicker.tsx";
|
import { SprintPicker } from "./SprintPicker.tsx";
|
||||||
import { useAgileView } from "./useAgileView.ts";
|
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";
|
import "./agile.css";
|
||||||
|
|
||||||
function SprintHead({ s }: { s: AgileSprint }) {
|
function SprintHead({ s }: { s: AgileSprint }) {
|
||||||
@ -39,7 +39,7 @@ export function SprintPage({ project }: { project: Project }) {
|
|||||||
const selectable = selectableSprints(d.sprints);
|
const selectable = selectableSprints(d.sprints);
|
||||||
const ids = parseSprintIds(params.get("sprint"), d.sprints);
|
const ids = parseSprintIds(params.get("sprint"), d.sprints);
|
||||||
const chosen = selectable.filter((s) => ids.includes(s.id));
|
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 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 });
|
const pick = (next: number[]) => setParams((p) => { const n = new URLSearchParams(p); n.set("sprint", next.join(",")); return n; }, { replace: true });
|
||||||
|
|||||||
@ -6,7 +6,7 @@ export function SprintPicker({ sprints, selected, onChange }: {
|
|||||||
sprints: AgileSprint[]; selected: number[]; onChange(ids: number[]): void;
|
sprints: AgileSprint[]; selected: number[]; onChange(ids: number[]): void;
|
||||||
}) {
|
}) {
|
||||||
const chosen = sprints.filter((s) => selected.includes(s.id));
|
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))));
|
const flip = (id: number, on: boolean) => onChange(sprints.map((s) => s.id).filter((x) => (x === id ? on : selected.includes(x))));
|
||||||
return (
|
return (
|
||||||
<Dropdown className="agile-sprint-picker" button={({ open, toggle }) => (
|
<Dropdown className="agile-sprint-picker" button={({ open, toggle }) => (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user