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:
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -98,5 +98,5 @@
|
||||
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20260924a" defer></script>
|
||||
<script src="/static/project.js?v=20260924b" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -119,5 +119,5 @@
|
||||
"today": {{ today | tojson }}
|
||||
}
|
||||
</script>
|
||||
<script src="/static/project.js?v=20260924a" defer></script>
|
||||
<script src="/static/project.js?v=20260924b" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260924b" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -505,5 +505,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20260924a" defer></script>
|
||||
<script src="/static/project.js?v=20260924b" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -797,7 +797,7 @@
|
||||
}
|
||||
.pj-card-subtoggle:hover { background: #f1f2f4; color: var(--pj-ink); }
|
||||
.pj-card-subtoggle.is-open { border-color: #4573d2; color: var(--pj-ink); background: #fff; }
|
||||
.pj-card-subtoggle-ic { font-size: 15px; transform: scaleX(-1) rotate(90deg); }
|
||||
.pj-card-subtoggle-ic { display: block; margin-left: 3px; }
|
||||
.pj-card-subtoggle-caret { font-size: 18px; margin-left: -2px; transition: transform .12s; }
|
||||
.pj-card-subtoggle.is-open .pj-card-subtoggle-caret { transform: rotate(180deg); }
|
||||
.pj-card-subs { margin: 10px -4px 0; border-top: 1px solid #eef0f2; }
|
||||
|
||||
+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