sdlc-hub/web/src/modules/jira/agile/AgileCard.tsx
Andrey Epifancev caf6ed43ae Веб: страница «Спринт» с колонками доски (#108)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 20:11:52 +04:00

28 lines
1.3 KiB
TypeScript

import type { MouseEvent } from "react";
import type { AgileIssue } from "../api/types.ts";
import { IssueLink, useOpenIssue } from "../issues/IssueLink.tsx";
import { fmtSp } from "./model.ts";
import { TypeIcon } from "./TypeIcon.tsx";
// карточка задачи в колонке доски; щелчок (не по ссылке и не при выделении текста) открывает карточку задачи поверх страницы
export function AgileCard({ issue }: { issue: AgileIssue }) {
const open = useOpenIssue();
const click = (e: MouseEvent) => {
if ((e.target as HTMLElement).closest("a")) return;
const sel = window.getSelection();
if (sel && !sel.isCollapsed && sel.containsNode(e.currentTarget, true)) return;
open(issue.key);
};
return (
<li className={"agile-card" + (issue.done ? " is-done" : "")} onClick={click}>
<span className="agile-card__summary">{issue.summary ?? "—"}</span>
<span className="agile-card__foot">
<TypeIcon type={issue.issue_type} />
<IssueLink issueKey={issue.key} className="agile-row__key" />
<span className="agile-card__assignee">{issue.assignee ?? "—"}</span>
<span className="agile-row__sp">{fmtSp(issue.story_points)}</span>
</span>
</li>
);
}