diff --git a/A00_Common/line_stack_machine.ts b/A00_Common/line_stack_machine.ts index f4cf6c2ef..a33d7350f 100644 --- a/A00_Common/line_stack_machine.ts +++ b/A00_Common/line_stack_machine.ts @@ -37,7 +37,6 @@ interface CopyRowData { export interface CopyAnswer { 사본: CopyRowData | null; 지금: CopyRowData | null; - 새값: boolean; } export interface MachineCtx { @@ -233,10 +232,7 @@ export function openMachineWindow(o: MachineWindowOptions): void { // 지금 줄 = 이 단가산출 사본 값(있으면) const copy = c.kind === "now" && ctx.copyRow ? await ctx.copyRow(c.no).catch(() => null) : null; const row = copy?.사본 ?? null; - if (row) { - lines.push(createText(mt("Win_Copy"), "muted")); - if (copy?.새값) lines.push(createText(mt("Win_Newer"), "warning")); - } + if (row) lines.push(createText(mt("Win_Copy"), "muted")); if (k === "mine") { const m = c.mine ?? mines.find((r) => r.원문번호 === c.no); if (m) lines.push(createText(`${mt("Server_Hourly")} ${hourlyText(m.시간당)}`)); diff --git a/D01_PlanRegister/D01_PlanRegister_UI_Page.ts b/D01_PlanRegister/D01_PlanRegister_UI_Page.ts index dad0a66eb..810cae6e4 100644 --- a/D01_PlanRegister/D01_PlanRegister_UI_Page.ts +++ b/D01_PlanRegister/D01_PlanRegister_UI_Page.ts @@ -115,6 +115,9 @@ export function renderD01PlanRegister(root: HTMLElement): void { required: true, }); const name = createInputField({ label: t("DE_Reg_Name"), required: true }); + // 서버 칸 길이(CreatePlanRequest)와 같게 — 넘으면 「HTTP 422」 만 뜸 + region.input.maxLength = 100; + name.input.maxLength = 255; // 이름 = B02 조합기 그대로(손대기 전 = 자동 · 고친 뒤 = 조각만 갈아 끼움) const composer = createNameComposer(); diff --git a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Points.ts b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Points.ts index 18e0b57d1..c490722bc 100644 --- a/D03_PlanAnalysis/D03_PlanAnalysis_UI_Points.ts +++ b/D03_PlanAnalysis/D03_PlanAnalysis_UI_Points.ts @@ -262,6 +262,9 @@ export function createPlanPoints(params: PlanPointsParams): PlanPoints { const sub = row?.querySelector(".ui-list-row__sub"); if (label) label.textContent = name(i); if (sub) sub.textContent = lonLatOf(i) ?? ""; + const drop = row?.querySelector(".ui-list-row__trailing button"); + drop?.setAttribute("title", `${name(i)} 지우기`); + drop?.setAttribute("aria-label", `${name(i)} 지우기`); }); syncEditor?.(); return; diff --git a/D04_PlanConfirm/D04_PlanConfirm_UI_Page.ts b/D04_PlanConfirm/D04_PlanConfirm_UI_Page.ts index 83d97cd86..133c8d82f 100644 --- a/D04_PlanConfirm/D04_PlanConfirm_UI_Page.ts +++ b/D04_PlanConfirm/D04_PlanConfirm_UI_Page.ts @@ -27,7 +27,7 @@ import { import { createBanner } from "@ui/ui_template_banner"; import { createCheckbox } from "@ui/ui_template_checkbox"; import { createPanelCard } from "@ui/ui_template_collapsible"; -import { tableRow, tableShell, type Column } from "@ui/ui_template_table"; +import { emptyRow, tableRow, tableShell, type Column } from "@ui/ui_template_table"; import { t } from "@ui/ui_template_locale"; import { stationLabel } from "../common_util/common_util_station"; import { clearState, readState, writeState } from "../A00_Common/b_page_state"; @@ -291,6 +291,7 @@ export async function renderD04PlanConfirm(root: HTMLElement): Promise { if (row.piece_id) tr.dataset.piece = row.piece_id; tbody.append(tr); } + if (!summary.pieces.length) tbody.append(emptyRow(columns, t("D04_NotSaved"))); const notes = draft() ? [createBanner({ tone: "warning", text: t("D04_Dirty") })] : []; notes[0]?.classList.add("d04-confirm__dirty"); const broken = summary.pieces @@ -386,6 +387,10 @@ export async function renderD04PlanConfirm(root: HTMLElement): Promise { pickCard.hidden = finalizeButton.hidden = saveButton.hidden = !editable; await load(); } catch (error) { - showToast(error instanceof Error ? error.message : String(error), "error"); + const text = error instanceof Error ? error.message : String(error); + showToast(text, "error"); + // 못 읽음(권한 · 없는 프로젝트) — 빈 화면 대신 까닭 · 단추는 걷음 + main.replaceChildren(createBanner({ tone: "danger", text })); + pickCard.hidden = exportButton.hidden = finalizeButton.hidden = saveButton.hidden = true; } } diff --git a/D04_PlanConfirm/D04_PlanConfirm_UI_Style.css b/D04_PlanConfirm/D04_PlanConfirm_UI_Style.css index 53c4fb41b..e8dce47ea 100644 --- a/D04_PlanConfirm/D04_PlanConfirm_UI_Style.css +++ b/D04_PlanConfirm/D04_PlanConfirm_UI_Style.css @@ -20,7 +20,7 @@ } .d04-confirm__input { - min-width: 10rem; + min-width: 15rem; /* 업체 칸 안내 글 「업체(등록 회사 찾기 또는 이름)」 이 다 보이게 */ } .d04-confirm__picks { diff --git a/M02_MasterTemplete/M02_MasterTemplete_Library_List.ts b/M02_MasterTemplete/M02_MasterTemplete_Library_List.ts index e1a92ede2..b7559365a 100644 --- a/M02_MasterTemplete/M02_MasterTemplete_Library_List.ts +++ b/M02_MasterTemplete/M02_MasterTemplete_Library_List.ts @@ -35,6 +35,7 @@ import { } from "./M02_MasterTemplete_Api_Fetch"; import { tc } from "./M02_MasterTemplete_Labor_Text"; import { formatMoney } from "../common_util/common_util_money"; +import { dateText } from "../common_util/common_util_time"; /** 목록 줄 — 서버가 문서 `이름`(제목) · 단위 · 1 단위 기준 계를 실어 보냄 */ type Row = TemplateInfo & { @@ -84,7 +85,7 @@ const COLUMNS: Record [string, (row: Row) => string][]> = { [tc("Lib_Unit"), (r) => r.단위 ?? ""], [tc("Lib_Base"), (r) => money(r.기준금액)], [L("M02_LibUnlinked"), (r) => (r.안이은줄 ? String(r.안이은줄) : "")], // 729-3 - [tc("Lib_Date"), (r) => r.수정일], + [tc("Lib_Date"), (r) => dateText(r.수정일, "")], ], sangeun: () => [ [tc("Lib_Key"), (r) => r.이름], @@ -94,7 +95,7 @@ const COLUMNS: Record [string, (row: Row) => string][]> = { [L("M02_SangeunEdited"), (r) => String(r.고친줄수 ?? 0)], [L("M02_SangeunUsers"), (r) => String(r.쓰는곳수 ?? 0)], [tc("Lib_Base"), (r) => money(r.기준금액)], - [tc("Lib_Date"), (r) => r.수정일], + [tc("Lib_Date"), (r) => dateText(r.수정일, "")], ], }; diff --git a/M02_MasterTemplete/M02_MyItems_View.ts b/M02_MasterTemplete/M02_MyItems_View.ts index 0fe43446f..f98cb71df 100644 --- a/M02_MasterTemplete/M02_MyItems_View.ts +++ b/M02_MasterTemplete/M02_MyItems_View.ts @@ -40,7 +40,6 @@ export function buildMyItemsView(opt: MyItemsViewOptions): HTMLElement { { key: "같은이름", label: mt("Same_Name"), kind: "number", decimals: 0, width: 70 }, ], rows: [], - empty: mt("Items_None"), mergeSame: ["이름"], onRowClick: (i) => pick(shown[i]), }); @@ -62,7 +61,7 @@ export function buildMyItemsView(opt: MyItemsViewOptions): HTMLElement { const count = new Map(); for (const r of rows) count.set(r.이름, (count.get(r.이름) ?? 0) + 1); shown = rows.filter((r) => words.every((w) => `${r.이름} ${r.규격}`.toLowerCase().includes(w))); - hint.textContent = rows.length ? `${shown.length} / ${rows.length}` : ""; + hint.textContent = rows.length ? `${shown.length} / ${rows.length}` : mt("Items_None"); table.setRows( shown.map((r) => ({ 이름: r.이름, diff --git a/M02_MasterTemplete/M02_MyMachine_Draft.py b/M02_MasterTemplete/M02_MyMachine_Draft.py index 319c07d87..e63bfc106 100644 --- a/M02_MasterTemplete/M02_MyMachine_Draft.py +++ b/M02_MasterTemplete/M02_MyMachine_Draft.py @@ -197,7 +197,7 @@ def saving(body: dict, inner: Callable[[dict], Any]) -> Any: def copy_row(doc: dict, copy: dict | None, no: str) -> dict[str, Any]: - """기계 창 열 때 — {사본: 이 SK 사본에 박힌 줄 | None, 지금: 지금 줄 | None, 새값}(원문번호 · 키로 찾음).""" + """기계 창 열 때 — {사본: 이 SK 사본에 박힌 줄 | None, 지금: 지금 줄 | None}(원문번호 · 키로 찾음).""" from M02_MasterTemplete import M02_Sangeun_Copy as skc no = no.strip().strip("'") @@ -209,5 +209,4 @@ def copy_row(doc: dict, copy: dict | None, no: str) -> dict[str, Any]: whole = skc.whole_() live = (whole.numbers.get("EQ") or {}).get(no) or (whole.index.get("EQ") or {}).get(no) now = prices.to_json(live) if live is not None else None - new = have is not None and now is not None and skc._fp(have) != skc._fp(now) - return {"사본": have, "지금": now, "새값": new} + return {"사본": have, "지금": now} diff --git a/M02_MasterTemplete/M02_MyMachine_Text.ts b/M02_MasterTemplete/M02_MyMachine_Text.ts index 7d04557f2..3e7110e6a 100644 --- a/M02_MasterTemplete/M02_MyMachine_Text.ts +++ b/M02_MasterTemplete/M02_MyMachine_Text.ts @@ -24,7 +24,7 @@ const TEXT = { Delete: "지우기", Deleted: "내 기계 지움", Delete_Ask: "이 내 기계를 지울까? 쓰는 단가산출 {value}", - Delete_Keep: "지워도 이미 만든 단가산출은 마지막 값 유지(「지워짐」 표시)", + Delete_Keep: "지워도 이미 만든 단가산출은 지우기 직전 값 유지", Back: "목록", Close: "닫기", Failed: "못 함", @@ -60,7 +60,6 @@ const TEXT = { Win_M01: "M01 기계", Win_Copy: "이 단가산출에 복사된 값", Win_Live: "원본 지금 값", - Win_Newer: "원본에 새 값 있음 — 프로젝트 사본은 [단가 갱신] 으로 반영", Win_Swap: "이 기계로 바꾸기", Win_Hint: "왼쪽에서 기계를 고르면 값이 보임", Win_View: "조회", diff --git a/M02_MasterTemplete/M02_MyMachine_View.ts b/M02_MasterTemplete/M02_MyMachine_View.ts index 7c777a8a2..d5d581bb8 100644 --- a/M02_MasterTemplete/M02_MyMachine_View.ts +++ b/M02_MasterTemplete/M02_MyMachine_View.ts @@ -45,7 +45,6 @@ export function buildMyMachineView(opt: MyMachineViewOptions): HTMLElement { { key: "고친날", label: mt("Edited"), width: 96 }, ], rows: [], - empty: mt("None"), onRowClick: (i) => shown[i] && void openForm(shown[i].키), }); const draw = (): void => { @@ -54,7 +53,7 @@ export function buildMyMachineView(opt: MyMachineViewOptions): HTMLElement { const text = `${r.이름} ${r.규격} ${r.키}`.toLowerCase(); return words.every((w) => text.includes(w)); }); - hint.textContent = rows.length ? `${shown.length} / ${rows.length}` : ""; + hint.textContent = rows.length ? `${shown.length} / ${rows.length}` : mt("None"); table.setRows( shown.map((r) => ({ 이름: r.이름, diff --git a/M02_MasterTemplete/M02_MyMaterial_View.ts b/M02_MasterTemplete/M02_MyMaterial_View.ts index a340173c3..2dda862f6 100644 --- a/M02_MasterTemplete/M02_MyMaterial_View.ts +++ b/M02_MasterTemplete/M02_MyMaterial_View.ts @@ -40,7 +40,7 @@ const TEXT = { need: "품명 · 단위는 꼭 적음", saved: "저장함 — 쓰는 단가산출이 새 값으로 셈", dropped: "지움", - dropAsk: "「{name}」 을 지움", + dropAsk: "「{name}」 지움", readOnly: "남의 층 — 읽기만", } as const; @@ -65,7 +65,6 @@ export function buildMyMaterialBlock(opt: MyMaterialBlockOptions): HTMLElement { { key: "키", label: TEXT.key, width: 90 }, ], rows: [], - empty: TEXT.none, onRowClick: (i) => canWrite && open(rows[i]), }); const name = createInputField({ label: TEXT.name, required: true }); @@ -84,6 +83,7 @@ export function buildMyMaterialBlock(opt: MyMaterialBlockOptions): HTMLElement { }), ); const head = createText(""); + const none = createText(TEXT.none, "muted"); // 빈 목록 글(표 `empty` = 빈 칸 글이라 따로) const saveBtn = createButton({ label: TEXT.save, variant: "filled", onClick: () => void save() }); const dropBtn = createButton({ label: TEXT.drop, @@ -138,6 +138,7 @@ export function buildMyMaterialBlock(opt: MyMaterialBlockOptions): HTMLElement { rows = got.줄; ver = got.판; table.setRows(rows.map((r) => ({ ...r, 쓰는곳: r.쓰는곳?.length ?? 0 }))); + none.hidden = rows.length > 0; } async function save(): Promise { const 이름 = name.input.value.trim(); @@ -188,6 +189,7 @@ export function buildMyMaterialBlock(opt: MyMaterialBlockOptions): HTMLElement { el("div", { className: "ui-toolbar", children: [addBtn] }), createText(canWrite ? TEXT.note : TEXT.readOnly, "muted"), table.root, + none, form, ], }); diff --git a/resources/tester/helper_m02_item_list.cjs b/resources/tester/helper_m02_item_list.cjs index 2c3ea7d19..d86e71829 100644 --- a/resources/tester/helper_m02_item_list.cjs +++ b/resources/tester/helper_m02_item_list.cjs @@ -16,7 +16,9 @@ const load = (name, stubs) => { }; const model = load("M02_MasterTemplete_TreePanel_Model.ts", {}); const time = load("../common_util/common_util_time.ts", {}); // 날짜 글 = 진짜(PC 시간대는 시험이 고정) +const money = load("../common_util/common_util_money.ts", {}); // 금액 꼴 = 진짜 const m = load("M02_MasterTemplete_ItemList.ts", { + "../common_util/common_util_money": money, "./M02_MasterTemplete_TreePanel_Model": model, "../common_util/common_util_time": time, }); diff --git a/resources/tester/test_827_1_machine_window.py b/resources/tester/test_827_1_machine_window.py index f18a69559..55e60a6fe 100644 --- a/resources/tester/test_827_1_machine_window.py +++ b/resources/tester/test_827_1_machine_window.py @@ -182,9 +182,7 @@ def test_edit_mine_other_sk_new_value(world): now = _at(me, path.read, first) assert now["셈"]["계"] == was seen = _at(me, path.machine, first, f"'{no}'") - assert ( - seen["사본"]["값"]["가격"] == 1000 and seen["지금"]["값"]["가격"] == 5000 and seen["새값"] - ) + assert seen["사본"]["값"]["가격"] == 1000 and seen["지금"]["값"]["가격"] == 5000 def test_company_and_other_refused(world):