feat(project): allow text in meeting target/result cells; fix result note save
- Target and result cells accept text such as "20개". Values that parse
as amounts still go to the integer columns; anything else goes to the
new target_text/result_text columns (migration 021).
- Fix: PUT /api/goals/meeting-items/{id} dropped result_note, so the
last-week result text was never saved.
- Update meeting nav test to the month-bounded week numbering.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -220,7 +220,12 @@ function meetServer(env, st) {
|
||||
const id = Number(u.match(/meeting-items\/(\d+)/)[1]);
|
||||
if (st.itemHook) { const r = await st.itemHook(id, body, call); if (r) return r; }
|
||||
const it = st.items[id] = Object.assign(st.items[id] || { id: id }, {});
|
||||
Object.keys(body).forEach(function (k) { it[k] = /amount$/.test(k) ? amount(body[k]) : body[k]; });
|
||||
// 정량 목표·결과 — 숫자면 원 정수, 아니면(예: 20개) 글 칸(021 target_text·result_text) — 서버와 같게
|
||||
Object.keys(body).forEach(function (k) {
|
||||
if (!/amount$/.test(k)) { it[k] = body[k]; return; }
|
||||
const n = amount(body[k]), tk = k.replace("_amount", "_text");
|
||||
if (n != null && isNaN(n)) { it[k] = null; it[tk] = String(body[k]).trim(); } else { it[k] = n; it[tk] = ""; }
|
||||
});
|
||||
return { body: { ok: true, item: Object.assign({ target_amount: null, result_amount: null }, it) } };
|
||||
});
|
||||
env.route("PUT", /\/project\/api\/goals\/meetings\/2026-09-28$/, async function (u, body, call) {
|
||||
@@ -413,6 +418,15 @@ function meetServer(env, st) {
|
||||
await settle(); await wait(10); await settle();
|
||||
check("[2d] 결과 글 → 지난 주차 줄(902)에 저장", st.items[902] && st.items[902].result_note === "결과 메모", st.items);
|
||||
check("[2d] 페이지 새로고침 없음", env.navigations === 0);
|
||||
// 정량 목표·결과에 글(021) — "20개" 는 글 그대로, 숫자는 쉼표 표기
|
||||
const tin = env.d.querySelector('tr[data-item="2"] input[data-field="target_amount"]');
|
||||
tin.focus(); tin.value = "20개"; tin.blur();
|
||||
await settle(); await wait(10); await settle();
|
||||
check("[2d] 정량 목표 글 저장·표시(20개)", st.items[2].target_text === "20개" && tin.value === "20개", [st.items[2], tin.value]);
|
||||
const rin = env.d.querySelector('tr[data-item="2"] input[data-field="result_amount"]');
|
||||
rin.focus(); rin.value = "1200"; rin.blur();
|
||||
await settle(); await wait(10); await settle();
|
||||
check("[2d] 결과 숫자는 쉼표 표기(1,200)", st.items[902].result_amount === 1200 && rin.value === "1,200", rin.value);
|
||||
check("[2d] 금주 목표 입력칸 없음(위쪽 숫자 4칸)", !env.d.getElementById("pj-meet-target") && env.d.querySelectorAll(".pj-meet-top .pj-meet-kpi").length === 4);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user