import { Navigate, useLocation, useParams } from "react-router"; import { ProjectGate } from "../../projects/ProjectGate.tsx"; import { IconBoard, IconHistory, IconList } from "../../ui/index.ts"; import type { HubModule } from "../types.ts"; import { BoardPage } from "./board/BoardPage.tsx"; import { FeedPage } from "./feed/FeedPage.tsx"; import { useIssueOverlay } from "./issues/overlay.tsx"; import { IssuesPage } from "./issues/IssuesPage.tsx"; import { jiraStatus } from "./status.ts"; import { Summary } from "./Summary.tsx"; // прежний адрес → новый; keyParam — параметр пути (ключ задачи), который дописывается к новому адресу function LegacyRedirect({ to, keyParam }: { to: string; keyParam?: string }) { const { search } = useLocation(); const params = useParams(); const key = keyParam ? params[keyParam] : undefined; return ; } export const jiraModule: HubModule = { name: "jira", title: "Jira", pages: [ { path: "/jira/board", element: {(p) => } }, { path: "/jira/issues", element: {(p) => } }, { path: "/jira/feed", element: {(p) => } }, // прежние адреса (закладки): перенаправление с сохранением строки запроса, без новой записи истории { path: "/board", element: }, { path: "/issues", element: }, { path: "/issues/:key", element: }, { path: "/feed", element: }, ], nav: [ { to: "/jira/board", label: "Доска связей", icon: }, { to: "/jira/issues", label: "Задачи", icon: , padded: true }, { to: "/jira/feed", label: "Лента", icon: , padded: true, keepSearch: true }, ], status: jiraStatus, Summary, useOverlay: useIssueOverlay, projectFields: [{ name: "board_id", label: "Номер доски Jira", hint: "scrum или kanban определится сам", kind: "int" }], };