diff --git a/B09_Estimation/draft/B09_Draft_Print_UI.ts b/B09_Estimation/draft/B09_Draft_Print_UI.ts new file mode 100644 index 000000000..b4c1fc357 --- /dev/null +++ b/B09_Estimation/draft/B09_Draft_Print_UI.ts @@ -0,0 +1,22 @@ +/* ============================================================================= + * B09_Draft_Print_UI.ts + * 인쇄 미리보기 등록 입구(PLAN 302-1 · 초안) — B09 셸이 `import.meta.glob("./draft/*_UI.ts")` 로 불러올 때 + * 좌측 하단 고정 줄(`DRAFT.actions`)에 [인쇄 미리보기] 단추 → #/b09-print(`…_Print_Route`) + * draft 폴더째 지우면 단추 · 길 · 서버 길이 함께 사라짐 + * ========================================================================== */ + +import type { RoutePath } from "@config/config_frontend"; +import { createButton } from "@ui/ui_template_elements"; +import { navigateTo } from "../../A00_Common/router"; +import { DRAFT } from "../B09_Estimation_UI_Tabs"; +import { ROUTE } from "./B09_Draft_Print_Route"; + +DRAFT.actions.push(() => { + const button = createButton({ + label: "인쇄 미리보기", + variant: "ghost", + onClick: () => navigateTo(ROUTE.path as RoutePath), + }); + button.dataset.b09Print = ""; + return button; +}); diff --git a/resources/tester/test_302_1_print_frame.py b/resources/tester/test_302_1_print_frame.py index a4d81b557..d64b69631 100644 --- a/resources/tester/test_302_1_print_frame.py +++ b/resources/tester/test_302_1_print_frame.py @@ -391,3 +391,13 @@ def test_수량_영역_PDF_시트_이름_지도_그림(quantity_bodies): missing = [s["name"] for s in body["sheets"] if s["name"] not in text] assert not missing assert sum(len(p.get_images()) for p in doc) >= 1 # 거리이정표 지도 그림이 들어감 + + +def test_B09_좌측_하단_단추는_초안_입구에서만(): + ui = _text(DRAFT / "B09_Draft_Print_UI.ts") + assert "DRAFT.actions.push(" in ui and "navigateTo(ROUTE.path" in ui + assert 'label: "인쇄 미리보기"' in ui + shell = _text(ROOT / "B09_Estimation/B09_Estimation_UI_Shell.ts") + assert 'import.meta.glob("./draft/*_UI.ts", { eager: true })' in shell + dock = _text(ROOT / "B09_Estimation/B09_Estimation_UI_Dock.ts") + assert "DRAFT.actions.map((make) => make())" in dock and "Print" not in dock