From 9a8aea6435ac235f85ee0988c6db0412a440e15a Mon Sep 17 00:00:00 2001 From: king Date: Tue, 13 Oct 2026 14:48:49 +0900 Subject: [PATCH] =?UTF-8?q?feat(project):=20=EB=B3=B4=EB=93=9C=20=EC=B9=B4?= =?UTF-8?q?=EB=93=9C=EC=97=90=20=EB=A7=88=EC=9A=B0=EC=8A=A4=EB=A5=BC=20?= =?UTF-8?q?=EC=98=AC=EB=A6=AC=EB=A9=B4=20=ED=98=91=EC=97=85=EC=9E=90=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=20=EC=95=84=EC=9D=B4=EC=BD=98(=EB=8B=B4?= =?UTF-8?q?=EB=8B=B9=EC=9E=90=20=EC=98=A4=EB=A5=B8=EC=AA=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 누르면 협업자를 받아 멤버 메뉴, 고르면 바로 저장하고 카드에 표시(담당자는 후보에서 뺌) - 테스트: 메뉴의 문서 Esc 처리기가 붙기 전에 Esc 를 보내던 타이밍 문제 수정(wait 후 Esc) Co-Authored-By: Claude Opus 5.5 --- .../notice/templates/notice/admin.html | 4 +- .../templates/project/goal_meeting.html | 4 +- .../project/templates/project/goals.html | 4 +- .../project/templates/project/help.html | 2 +- .../project/templates/project/inbox.html | 4 +- .../project/templates/project/mytasks.html | 4 +- .../project/templates/project/notifier.html | 4 +- .../project/templates/project/project.html | 4 +- .../project/templates/project/trash.html | 4 +- app/static/project.css | 8 ++++ app/static/project.js | 46 +++++++++++++++++++ docs/PROJECT_MODULE.md | 3 ++ tests/js/project_ui.test.js | 31 ++++++++++--- 13 files changed, 99 insertions(+), 23 deletions(-) diff --git a/app/modules/notice/templates/notice/admin.html b/app/modules/notice/templates/notice/admin.html index b418c50..69c5d3b 100644 --- a/app/modules/notice/templates/notice/admin.html +++ b/app/modules/notice/templates/notice/admin.html @@ -2,7 +2,7 @@ {% block head_extra %} {# 프로젝트 화면 부품(설명 편집기·날짜 팝업·멤버 고르기)을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #} - + {% endblock %} @@ -64,7 +64,7 @@ - + {% endif %} {% endblock %} diff --git a/app/modules/project/templates/project/goal_meeting.html b/app/modules/project/templates/project/goal_meeting.html index f0360e2..11730fe 100644 --- a/app/modules/project/templates/project/goal_meeting.html +++ b/app/modules/project/templates/project/goal_meeting.html @@ -1,7 +1,7 @@ {% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -298,5 +298,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/goals.html b/app/modules/project/templates/project/goals.html index 4eafb3c..4352466 100644 --- a/app/modules/project/templates/project/goals.html +++ b/app/modules/project/templates/project/goals.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -207,5 +207,5 @@ {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/help.html b/app/modules/project/templates/project/help.html index e9f5ed2..0d01f78 100644 --- a/app/modules/project/templates/project/help.html +++ b/app/modules/project/templates/project/help.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index 655ddb3..e20a7ab 100644 --- a/app/modules/project/templates/project/inbox.html +++ b/app/modules/project/templates/project/inbox.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -102,5 +102,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/modules/project/templates/project/mytasks.html b/app/modules/project/templates/project/mytasks.html index 73479f5..607d218 100644 --- a/app/modules/project/templates/project/mytasks.html +++ b/app/modules/project/templates/project/mytasks.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -100,5 +100,5 @@ "today": {{ today | tojson }} } - + {% endblock %} diff --git a/app/modules/project/templates/project/notifier.html b/app/modules/project/templates/project/notifier.html index 0ebe0a8..bfa32c7 100644 --- a/app/modules/project/templates/project/notifier.html +++ b/app/modules/project/templates/project/notifier.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -108,5 +108,5 @@ }); })(); - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 84bd40a..1daac3a 100644 --- a/app/modules/project/templates/project/project.html +++ b/app/modules/project/templates/project/project.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + @@ -470,5 +470,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html index b1e83f0..79ca2f3 100644 --- a/app/modules/project/templates/project/trash.html +++ b/app/modules/project/templates/project/trash.html @@ -1,7 +1,7 @@ {% extends "erp_base.html" %} {% block head_extra %} - + {% endblock %} @@ -70,5 +70,5 @@ {% include "project/_side_modals.html" %} {% include "project/_member_tasks_modal.html" %} - + {% endblock %} diff --git a/app/static/project.css b/app/static/project.css index 8ca22e4..045567f 100644 --- a/app/static/project.css +++ b/app/static/project.css @@ -491,6 +491,14 @@ html.pj-side-resizing, html.pj-side-resizing * { cursor: col-resize !important; .pj-card-cover img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; } .pj-card.has-cover .pj-card-head { border-radius: 0; } .pj-card-meta .pj-card-assignee.is-empty svg, .pj-card-meta .pj-card-due.is-empty svg { width: 24px; height: 24px; } +/* 카드 협업자(담당자 오른쪽) — 비어 있으면 카드에 마우스를 올릴 때만 점선 원 두 사람 아이콘 */ +.pj-card-meta .pj-card-fol { display: inline-flex; align-items: center; gap: 1px; min-height: 24px; color: #6d6e6f; } +.pj-card-meta .pj-card-fol.is-empty { justify-content: center; width: 26px; height: 26px; padding: 0; margin: -2px 0; border-radius: 50%; } +.pj-card-meta .pj-card-fol > svg { width: 24px; height: 24px; } +.pj-card-meta .pj-card-fol img.pj-person-ic { width: 20px; height: 20px; border-radius: 50%; } +.pj-card-meta .pj-card-fol .pj-gicon { font-size: 22px; } +.pj-card:hover .pj-card-meta .pj-card-fol.is-empty { opacity: 1; } +.pj-card-meta .pj-card-fol.is-empty:hover { color: #1e1f21; background: #eceef0; } .pj-pri { padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; } .pj-pri-high { background: #fbe3df; color: #c22b10; } .pj-pri-low { background: #e6eef0; color: #4a6066; } diff --git a/app/static/project.js b/app/static/project.js index f1cadff..3a5f4d0 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -5295,6 +5295,43 @@ } catch (e) { showToast(failMsg + ": " + e.message, "error"); } } + // 보드 카드 협업자 — taskId → 협업자 목록(받았거나 고친 것만). 업무 창을 닫으면 비운다(창에서 바꿨을 수 있다). + const cardFollowers = {}; + function cardFolHtml(list) { + const has = !!(list && list.length); + return '' + followerIconHtml(list || []) + ""; + } + function paintCardFol(anchor, list) { + if (!anchor.isConnected) return; + anchor.classList.toggle("is-empty", !(list && list.length)); + anchor.innerHTML = followerIconHtml(list || []); + anchor.title = followerTip(list || []); + } + async function openCardFollowers(t, anchor) { + let emails; + try { + const got = await Promise.all([ + membersOfProject(t.project_id), + api("GET", "/project/api/tasks/" + t.id + "/followers"), + ]); + emails = got[0].map(function (m) { return m.user_email; }); + cardFollowers[t.id] = got[1].followers || []; + } catch (e) { + showToast(e.status === 503 ? "협업자 기능은 DB 마이그레이션 008 후 사용할 수 있습니다." : "협업자 조회 실패: " + e.message, "error"); + return; + } + paintCardFol(anchor, cardFollowers[t.id]); + if (!anchor.isConnected) return; + openFollowerMenu(anchor, emails, function () { return cardFollowers[t.id]; }, async function (em, on) { + try { + cardFollowers[t.id] = await setTaskFollower(t.id, em, on); + paintCardFol(anchor, cardFollowers[t.id]); + return true; + } catch (err) { showToast("협업자 변경 실패: " + err.message, "error"); return false; } + }, function () { return t.assignee_email; }); + } + async function openAssigneePicker(t, x, y) { let list; try { list = await membersOfProject(t.project_id); } @@ -5302,6 +5339,9 @@ showContextMenu(x, y, assigneeMenuItems( list.map(function (m) { return m.user_email; }), t.assignee_email, function (email) { + if (email && cardFollowers[t.id]) { // 담당자는 협업자가 아니다(서버도 뺀다) + cardFollowers[t.id] = cardFollowers[t.id].filter(function (x) { return String(x).toLowerCase() !== String(email).toLowerCase(); }); + } applyTaskPatch(t, { assignee_email: email, assignee_name: email ? idOf(email) : "" }, "담당자 변경 실패"); } )); @@ -5862,6 +5902,9 @@ avatarHtml(t.assignee_email, "pj-gicon-sm") + escapeHtml(idOf(t.assignee_email)) + "" : '' + ASSIGN_EMPTY_ICON_SVG + "") + + // 협업자(2026-10-13) — 담당자 오른쪽. 카드 목록엔 협업자가 없어 비어 있으면 마우스를 올릴 때만 보이고, + // 누르면 서버에서 받아 멤버 메뉴. 한 번 받은(고른) 협업자는 이 화면에 머무는 동안 카드에 보인다(cardFollowers). + (canManage ? cardFolHtml(cardFollowers[t.id]) : "") + (function () { const di = dueInfo(t.due_date, !!t.completed_at); return '