feat(project): meeting numbers in sales unit, member add/remove, quick-task polish
- Header numbers use the goal table sales unit (e.g. 백만원); exact won amounts in tooltips. - Notes title: 결정사항 : 진행상황 수시 공유 및 완료 되어야 함. - Member dialog shows current members checked: check to add, uncheck to remove (owner locked); member APIs also require project access. - Quick task table: centered bold headers, assignee shown as avatar + name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@ const WATCHDOG = setTimeout(function () { console.log("TIMEOUT — 어딘가에
|
||||
|
||||
const ROOT = path.join(__dirname, "..", "..");
|
||||
const html = fs.readFileSync(path.join(__dirname, ".out", "project_render.html"), "utf8");
|
||||
const adminHtml = fs.readFileSync(path.join(__dirname, ".out", "project_admin_render.html"), "utf8");
|
||||
const JS = fs.readFileSync(path.join(ROOT, "app", "static", "project.js"), "utf8");
|
||||
|
||||
const fails = [];
|
||||
@@ -29,8 +30,8 @@ function deferred() {
|
||||
return { promise: p, resolve: resolve, reject: reject };
|
||||
}
|
||||
|
||||
function makeEnv() {
|
||||
const dom = new JSDOM(html, { runScripts: "dangerously", pretendToBeVisual: true, url: "http://localhost/project/p/1" });
|
||||
function makeEnv(page) {
|
||||
const dom = new JSDOM(page || html, { runScripts: "dangerously", pretendToBeVisual: true, url: "http://localhost/project/p/1" });
|
||||
const w = dom.window, d = w.document;
|
||||
w.__PJ_TEST__ = true;
|
||||
w.HTMLDialogElement.prototype.showModal = function () { this.open = true; };
|
||||
@@ -726,6 +727,29 @@ function titleVal(d) { return d.getElementById("pj-t-title").value; }
|
||||
check("[대시보드 담당자별] 항목 → 작업 편집 창(하위 작업은 서버에서 받아)", !env.d.getElementById("pj-modal-task").hidden &&
|
||||
env.d.getElementById("pj-t-title").value === "하위 2", env.d.getElementById("pj-t-title").value);
|
||||
}
|
||||
// ── 멤버 배정·제외 — 지금 멤버는 체크된 채로, 체크 = 배정 · 해제 = 제외(확인 뒤) ──
|
||||
{
|
||||
const env = makeEnv(adminHtml); baseRoutes(env);
|
||||
env.route("GET", /\/project\/api\/assignable-users$/, function () { return { body: { users: [
|
||||
{ email: "me@test.local", id: "me", name: "Me", avatar: "" },
|
||||
{ email: "bob@test.local", id: "bob", name: "Bob", avatar: "" },
|
||||
{ email: "carol@test.local", id: "carol", name: "Carol", avatar: "" }] } }; });
|
||||
const added = [], removed = [];
|
||||
env.route("POST", /\/project\/api\/projects\/1\/members$/, function (u, body) { added.push(body.user_email); return { body: { member: { user_email: body.user_email } } }; });
|
||||
env.route("DELETE", /\/project\/api\/projects\/1\/members\/.+$/, function (u) { removed.push(decodeURIComponent(u.split("/").pop())); return { body: { ok: true } }; });
|
||||
await boot(env);
|
||||
const d = env.d;
|
||||
d.getElementById("pj-add-member").click(); await settle();
|
||||
const box = function (e) { return d.querySelector('#pj-m-users input[value="' + e + '"]'); };
|
||||
check("[멤버 배정·제외] 지금 멤버 체크·나머지 해제", box("bob@test.local").checked && box("me@test.local").checked && !box("carol@test.local").checked);
|
||||
box("bob@test.local").checked = false; box("carol@test.local").checked = true;
|
||||
env.setConfirm(true);
|
||||
d.getElementById("pj-save-member").click(); await settle(); await wait(10); await settle();
|
||||
check("[멤버 배정·제외] 체크 = 배정, 해제 = 제외(확인 뒤)", JSON.stringify(added) === '["carol@test.local"]' &&
|
||||
JSON.stringify(removed) === '["bob@test.local"]' && env.confirms === 1, [added, removed, env.confirms]);
|
||||
const shown = Array.from(d.querySelectorAll(".pj-tmember")).map(function (n) { return n.dataset.email; });
|
||||
check("[멤버 배정·제외] 머리 멤버 아이콘 갱신", shown.indexOf("bob@test.local") < 0 && shown.indexOf("carol@test.local") >= 0, shown);
|
||||
}
|
||||
clearTimeout(WATCHDOG);
|
||||
console.log(fails.length ? "\nFAILED: " + fails.join(", ") : "\nALL PASS");
|
||||
process.exit(fails.length ? 1 : 0);
|
||||
|
||||
Reference in New Issue
Block a user