fix(project): 카드 하위 업무 펼치기가 토글째 사라지던 버그 + 아사나식 아이콘
GET /api/tasks/{id} 응답은 {task: {subtasks}} 인데 res.subtasks 를 읽어
하위 업무 0개로 판단 → 개수 동기화 로직이 토글을 없앴다. res.task.subtasks 로
수정. 하위 업무 아이콘을 아사나와 같은 모양(노드에서 두 갈래) SVG 로 교체.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+13
-2
@@ -2614,6 +2614,16 @@
|
||||
// 닫히면(거기서 하위 업무를 고쳤을 수 있으니) 캐시를 비운다(아래 observer).
|
||||
const expandedSubs = new Set();
|
||||
const subsCache = {};
|
||||
// 아사나의 하위 업무 아이콘(위 노드 하나에서 두 갈래로 뻗은 노드).
|
||||
const SUBTASK_ICON_SVG =
|
||||
'<svg class="pj-card-subtoggle-ic" viewBox="0 0 16 16" width="15" height="15" fill="none" ' +
|
||||
'stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">' +
|
||||
'<circle cx="4" cy="3" r="1.7"/>' +
|
||||
'<path d="M4 4.7v6.3a1.5 1.5 0 0 0 1.5 1.5h3.8"/>' +
|
||||
'<path d="M4 7.5h5.3"/>' +
|
||||
'<circle cx="11.2" cy="7.5" r="1.7"/>' +
|
||||
'<circle cx="11.2" cy="12.5" r="1.7"/>' +
|
||||
"</svg>";
|
||||
function cardSubRowHtml(sub) {
|
||||
const overdue = sub.due_date && !sub.completed_at && sub.due_date < todayIso;
|
||||
return '<div class="pj-card-sub' + (sub.completed_at ? " is-done" : "") + '" data-sub-id="' + sub.id + '">' +
|
||||
@@ -2633,7 +2643,8 @@
|
||||
if (!subs) {
|
||||
box.innerHTML = '<div class="pj-card-sub-empty">불러오는 중…</div>';
|
||||
api("GET", "/project/api/tasks/" + t.id).then(function (res) {
|
||||
const subs = (res && res.subtasks) || [];
|
||||
// GET /api/tasks/{id} 응답은 {task: {..., subtasks: [...]}}.
|
||||
const subs = (res && res.task && res.task.subtasks) || [];
|
||||
subsCache[t.id] = subs;
|
||||
// 카드 숫자가 옛 값이면(팝업에서 하위 업무를 추가·삭제) 맞춰서 다시 그린다.
|
||||
const doneN = subs.filter(function (x) { return x.completed_at; }).length;
|
||||
@@ -2701,7 +2712,7 @@
|
||||
? '<button type="button" class="pj-card-subtoggle' + (expandedSubs.has(t.id) ? " is-open" : "") +
|
||||
'" title="하위 업무 ' + t.subtask_total + "개 (완료 " + (t.subtask_done || 0) + ')">' +
|
||||
'<span class="pj-card-subtoggle-n">' + t.subtask_total + "</span>" +
|
||||
'<span class="material-symbols-outlined pj-card-subtoggle-ic">account_tree</span>' +
|
||||
SUBTASK_ICON_SVG +
|
||||
'<span class="material-symbols-outlined pj-card-subtoggle-caret">arrow_drop_down</span>' +
|
||||
"</button>"
|
||||
: "") +
|
||||
|
||||
Reference in New Issue
Block a user