feat(project): dashboard workload by assignee with subtasks and completion

Replace the scheduled-tasks bar chart with a table of all tasks assigned
per person in scope (no due date needed, filters ignored): main tasks,
subtasks (new GET /api/projects/{id}/subtasks-summary), done counts and
completion rate, plus a total row. Admin only, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 14:09:06 +09:00
parent c766af691a
commit fc3a2d0b9b
14 changed files with 247 additions and 26 deletions
+30
View File
@@ -684,6 +684,36 @@ function titleVal(d) { return d.getElementById("pj-t-title").value; }
const d = env.d;
check("[프로젝트 줄] 읽기 전용은 연결 목록만 표시", d.getElementById("pj-link-form").hidden && d.getElementById("pj-links-block").classList.contains("is-readonly") && !!d.querySelector(".pj-link-chip") && !d.querySelector(".pj-link-del"));
}
// ── 대시보드 담당자별 작업 합계 — 메인·하위 분리, 완료 수, 마감일 없어도 포함, 다른 범위 하위 작업 제외 ──
{
const env = makeEnv(); baseRoutes(env);
env.d.querySelector(".pj-project-view").dataset.isAdmin = "true";
let asked = null;
env.route("GET", /\/project\/api\/projects\/1\/subtasks-summary\?scope=project$/, function (u) {
asked = u;
return { body: { subtasks: [
{ parent_task_id: 101, assignee_email: "me@test.local", assignee_name: "Me", done: true },
{ parent_task_id: 101, assignee_email: "bob@test.local", assignee_name: "Bob", done: false },
{ parent_task_id: 103, assignee_email: "bob@test.local", assignee_name: "Bob", done: true }, // 다른 프로젝트 작업의 하위
] } };
});
const P = await boot(env);
P.state().tasks.forEach(function (t) {
if (t.id === 101) Object.assign(t, { assignee_email: "me@test.local", assignee_name: "Me", completed_at: "2026-09-29T10:00:00+09:00" });
if (t.id === 102) Object.assign(t, { assignee_email: "me@test.local", assignee_name: "Me" });
if (t.id === 301) Object.assign(t, { assignee_email: "bob@test.local", assignee_name: "Bob" });
});
env.d.querySelector('.pj-tab[data-view="dashboard"]').click(); await settle();
const rows = Array.from(env.d.querySelectorAll(".pj-wl-table tbody tr")).map(function (tr) {
return Array.from(tr.children).slice(0, 4).map(function (c) { return c.textContent.trim(); }).join("|");
});
const totalRow = env.d.querySelector(".pj-wl-total");
const total = totalRow ? totalRow.textContent.replace(/\s+/g, " ") : "";
check("[대시보드 담당자별] 하위 작업 요청(이 프로젝트 범위)", !!asked);
check("[대시보드 담당자별] 사람별 메인·하위·전체(마감일 없는 작업 포함, 다른 프로젝트 하위 제외)",
JSON.stringify(rows) === JSON.stringify(["Me|2|1|3", "Bob|1|1|2"]), rows);
check("[대시보드 담당자별] 합계 줄 완료 2/5 (40%) — 메인 완료 1 + 하위 완료 1", /2 \/ 5 40%/.test(total), total);
}
clearTimeout(WATCHDOG);
console.log(fails.length ? "\nFAILED: " + fails.join(", ") : "\nALL PASS");
process.exit(fails.length ? 1 : 0);