feat(project): workload chart counts nested subtasks
subtasks-summary now returns every level under the scope's main tasks (recursive CTE, depth <= 20) with root_task_id and parent_title; the dashboard groups by root_task_id. Also fix drawer header '세부 작업 작업'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -696,6 +696,9 @@ function titleVal(d) { return d.getElementById("pj-t-title").value; }
|
||||
{ id: 501, parent_task_id: 101, title: "하위 1", assignee_email: "me@test.local", assignee_name: "Me", done: true, completed_at: "2026-09-29T10:00:00+09:00" },
|
||||
{ id: 502, parent_task_id: 101, title: "하위 2", assignee_email: "bob@test.local", assignee_name: "Bob", done: false },
|
||||
{ id: 503, parent_task_id: 103, title: "다른 프로젝트 하위", assignee_email: "bob@test.local", assignee_name: "Bob", done: true },
|
||||
// 세부 작업의 세부 작업(2026-10-08) — root_task_id 로 맨 위 메인 작업을 따져 센다
|
||||
{ id: 504, parent_task_id: 501, root_task_id: 101, depth: 2, parent_title: "하위 1", title: "하위 1-1", assignee_email: "me@test.local", assignee_name: "Me", done: false },
|
||||
{ id: 505, parent_task_id: 503, root_task_id: 103, depth: 2, parent_title: "다른 프로젝트 하위", title: "다른 1-1", assignee_email: "bob@test.local", assignee_name: "Bob", done: true },
|
||||
] } };
|
||||
});
|
||||
env.route("GET", /\/project\/api\/tasks\/502$/, function () { return { body: { task: detail(502, "하위 2", { parent_task_id: 101 }) } }; });
|
||||
@@ -710,13 +713,13 @@ function titleVal(d) { return d.getElementById("pj-t-title").value; }
|
||||
return [g.querySelector(".pj-wl-name b").textContent].concat(Array.from(g.querySelectorAll(".pj-wl-val")).map(function (v) { return v.firstChild.textContent; })).join("|");
|
||||
});
|
||||
check("[대시보드 담당자별] 하위 작업 요청(이 프로젝트 범위)", !!asked);
|
||||
check("[대시보드 담당자별] 세로 막대: 사람별 메인·하위 완료/전체(다른 프로젝트 하위 제외)",
|
||||
JSON.stringify(groups) === JSON.stringify(["Me|1/2|1/1", "Bob|0/1|0/1"]), groups);
|
||||
check("[대시보드 담당자별] 세로 막대: 사람별 메인·세부 완료/전체(세부의 세부 포함, 다른 프로젝트 제외)",
|
||||
JSON.stringify(groups) === JSON.stringify(["Me|1/2|1/2", "Bob|0/1|0/1"]), groups);
|
||||
// 막대 = 그 작업 전체, 채움 = 완료율(작업 수가 아니라) — Me 메인 1/2 → 50%, 하위 1/1 → 100%, Bob 0/1 → 0%
|
||||
const pcts = Array.from(env.d.querySelectorAll(".pj-wl-done")).map(function (f) { return f.dataset.pct; });
|
||||
check("[대시보드 담당자별] 채움 높이 = 완료율", JSON.stringify(pcts) === JSON.stringify(["50", "100", "0", "0"]), pcts);
|
||||
check("[대시보드 담당자별] 채움 높이 = 완료율", JSON.stringify(pcts) === JSON.stringify(["50", "50", "0", "0"]), pcts);
|
||||
const sum = env.d.querySelector(".pj-wl-sum").textContent.replace(/\s+/g, " ");
|
||||
check("[대시보드 담당자별] 전체 완료 2/5 (40%)", /2 \/ 5 \(40%\)/.test(sum), sum);
|
||||
check("[대시보드 담당자별] 전체 완료 2/6 (33%)", /2 \/ 6 \(33%\)/.test(sum), sum);
|
||||
// 막대 → 오른쪽 패널(body 에) → 항목 → 편집 창
|
||||
env.d.querySelectorAll(".pj-wl-group")[1].querySelector(".pj-wl-col.is-sub").click(); await settle();
|
||||
const drawer = env.d.body.querySelector(".pj-wl-drawer");
|
||||
|
||||
Reference in New Issue
Block a user