fix(M02): 자재 조합 [새로] · [본떠 만들기] 열자마자 이름 칸에 초점 · 본떠 만들기는 이름 칸 비움
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VwJQ5eRrCKf3nH9EFeKvJz
This commit is contained in:
@@ -213,7 +213,10 @@ export function buildMatsetSection(opt: MatsetSectionOptions): MatsetSection {
|
||||
],
|
||||
});
|
||||
const setDirty = opt.show(isNew ? tm("New") : `${row.키} ${row.이름}`, node);
|
||||
if (isNew) setDirty(true);
|
||||
if (isNew) {
|
||||
setDirty(true);
|
||||
node.querySelector<HTMLInputElement>('[data-matset-field="이름"]')?.focus(); // 바로 이름 적기
|
||||
}
|
||||
opt.onOpen();
|
||||
paintList();
|
||||
paintButtons();
|
||||
@@ -227,7 +230,7 @@ export function buildMatsetSection(opt: MatsetSectionOptions): MatsetSection {
|
||||
const from = all.find((x) => x.키 === openKey);
|
||||
if (!from || !(await opt.confirmLeave())) return;
|
||||
const copy = structuredClone(from);
|
||||
draw({ ...copy, 키: "", 이름: tm("CopyName", from.이름), 본뜬키: from.키, 소유: "현장" }, true);
|
||||
draw({ ...copy, 키: "", 이름: "", 본뜬키: from.키, 소유: "현장" }, true); // 이름은 새로 적음
|
||||
});
|
||||
btnDel.addEventListener("click", async () => {
|
||||
const key = openKey;
|
||||
|
||||
@@ -10,7 +10,6 @@ const TEXT = {
|
||||
Search: ["키 · 이름으로 찾기", "Search by key or name"],
|
||||
Empty: ["자재 조합 없음", "No material sets"],
|
||||
New: ["새 자재 조합(저장 전)", "New material set (unsaved)"],
|
||||
CopyName: ["{value} 본뜸", "{value} copy"],
|
||||
Save: ["저장", "Save"],
|
||||
InUse: [
|
||||
"{value} 열이 쓰는 자재 조합이라 못 지움",
|
||||
|
||||
@@ -123,3 +123,10 @@ def test_쓰는_열이_있으면_못_지우고_없으면_지워진다(client) ->
|
||||
|
||||
def test_M01_마스터는_UM_을_모른다() -> None:
|
||||
assert "UM" not in m01.cm.mk.IDS and "자재조합" not in m01.cm.mk.ROW_ORDER
|
||||
|
||||
|
||||
def test_새로_본떠_만들기는_열자마자_이름_칸에_초점() -> None:
|
||||
ui = (ROOT / "M02_MasterTemplete/M02_MasterTemplete_Matset.ts").read_text(encoding="utf-8")
|
||||
assert "'[data-matset-field=\"이름\"]')?.focus()" in ui.split("if (isNew) {")[1]
|
||||
copy = ui.split("btnCopy.addEventListener")[1].split("});")[0]
|
||||
assert '이름: ""' in copy # 본떠 만들기는 이름 칸 비움
|
||||
|
||||
Reference in New Issue
Block a user