Files
Aislo/A00_Common/group_workflow.ts
T
eomsangdonandClaude Opus 5.5 a1069f270a feat(529-1): 단계 틀 인자(아이콘 · [<][>] 묶음 · 도움말 이름) · D · E 단계 빈 길 일곱
- createWorkflowLayout icons 인자(없으면 B 일곱 아이콘 그대로)
- [?] [<] [>] 묶음 = B05~B09 · D02~D04 · E02~E05 · 묶음 안에서만 오감 · 설명서 이름 B0N/D0N/E0N
- 서버 설명서 주소 D01~D04 · E01~E05 허용 · 우클릭 막기 · 돋보기 d · e 주소
- ROUTES D01~E05 · PLAN_STEP_ROUTES · STAB_STEP_ROUTES · A00_Common/group_workflow(빈 단계 = 틀 · 좌측 [?] 줄 · 단계 막대)
- 페이지 폴더마다 draft/<폴더>_Route.ts · tsconfig 에 D0* · E0* · 문구 ui_template_locale_de
- 시험: 280-2 대역에 D · E 묶음 · 54-2 D · E 설명서 길

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 19:32:09 +09:00

61 lines
2.4 KiB
TypeScript

/* =============================================================================
* group_workflow.ts
* D 예정노선 · E 안정성평가 단계 묶음(요구 345 · PLAN 529-1) — B05~B09 틀(`createWorkflowLayout`)을
* 단계 목록 · 아이콘 · 주소 인자로 그대로 씀. 빈 단계 = 틀 · 좌측 패널([?] [<] [>]) · 단계 막대만.
* 페이지 길 = 각 폴더 `draft/<폴더>_Route.ts` · 본문이 생기면 그 폴더 페이지로 갈아 끼움.
* ========================================================================== */
import { PLAN_STEP_ROUTES, STAB_STEP_ROUTES, type RoutePath } from "@config/config_frontend";
import { el } from "@ui/ui_template_elements";
import { t, type LocaleKey } from "@ui/ui_template_locale";
import { createWorkflowLayout } from "@ui/ui_template_workflow_layout";
import { navigateTo, type PageRenderer } from "./router";
interface GroupFlow {
routes: readonly RoutePath[];
labels: readonly LocaleKey[];
icons: readonly string[];
}
const FLOWS: readonly GroupFlow[] = [
{
routes: PLAN_STEP_ROUTES,
labels: ["DE_Step_PlanBase", "DE_Step_PlanAnalysis", "DE_Step_PlanConfirm"],
icons: ["📍", "🧭", "✅"],
},
{
routes: STAB_STEP_ROUTES,
labels: ["DE_Step_StabGround", "DE_Step_StabSection", "DE_Step_Stab3D", "DE_Step_StabReport"],
icons: ["🪨", "📐", "🧊", "📄"],
},
];
/** 단계 틀을 세움 — mainContent · leftPanel 이 없으면 빈 단계 안내 · [?] 줄만 */
export function mountGroupStep(
root: HTMLElement,
route: RoutePath,
parts: { mainContent?: HTMLElement; leftPanel?: HTMLElement } = {},
): void {
const flow = FLOWS.find((f) => f.routes.includes(route));
if (!flow) throw new Error(`단계 묶음 밖 주소: ${route}`);
const active = flow.routes.indexOf(route);
const layout = createWorkflowLayout({
title: t(flow.labels[active]),
steps: flow.labels.map((key) => t(key)),
icons: flow.icons,
activeStep: active,
routes: flow.routes,
leftPanel: parts.leftPanel,
mainContent:
parts.mainContent ?? el("p", { className: "app-placeholder", text: t("DE_Step_Empty") }),
onStepClick: (_index, next) => navigateTo(next as RoutePath),
});
root.append(layout.root);
}
/** 빈 단계 페이지(길 선언의 load 가 부름) */
export const groupStepPage =
(route: RoutePath): PageRenderer =>
(root) =>
mountGroupStep(root, route);