feat(project): 보드 메인 업무 추가 카드에 협업자 아이콘(담당자 옆)
- 고른 협업자는 만들 때 followers 로 같이 저장, 담당자는 후보에서 빼고 담당자로 고르면 협업자에서 뺌 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+35
-5
@@ -4938,13 +4938,17 @@
|
||||
'<div class="pj-tasknew-name"><span class="material-symbols-outlined pj-tasknew-check">check_circle</span>' +
|
||||
'<input type="text" class="pj-tasknew-title" placeholder="업무 이름 입력" aria-label="업무 이름" autocomplete="off"></div>' +
|
||||
'<div class="pj-tasknew-meta"><button type="button" class="pj-tasknew-assignee" aria-label="담당자 지정"></button>' +
|
||||
// 협업자 — 담당자 옆(2026-10-13). 고른 사람은 만들 때 followers 로 같이 보낸다(담당자는 협업자가 아니라 후보에서 뺀다).
|
||||
'<button type="button" class="pj-tasknew-fol" aria-label="협업자 지정"></button>' +
|
||||
'<button type="button" class="pj-tasknew-due" aria-label="마감일 지정"></button></div>';
|
||||
body.appendChild(card);
|
||||
const inp = card.querySelector(".pj-tasknew-title");
|
||||
const av = card.querySelector(".pj-tasknew-assignee");
|
||||
const fol = card.querySelector(".pj-tasknew-fol");
|
||||
const due = card.querySelector(".pj-tasknew-due");
|
||||
if (!draft.followers) draft.followers = [];
|
||||
inp.value = draft.title;
|
||||
inp.disabled = av.disabled = due.disabled = draft.saving;
|
||||
inp.disabled = av.disabled = fol.disabled = due.disabled = draft.saving;
|
||||
function current() { return boardTaskDrafts[stage.id] === draft && !accessLost; }
|
||||
function refocus() { if (current() && inp.isConnected && !draft.saving) inp.focus(); }
|
||||
function paintAv() {
|
||||
@@ -4956,7 +4960,11 @@
|
||||
due.innerHTML = di ? escapeHtml(di.text) : DUE_EMPTY_ICON_SVG;
|
||||
due.title = draft.due || "마감일 지정";
|
||||
}
|
||||
paintAv(); paintDue();
|
||||
function paintFol() {
|
||||
fol.innerHTML = followerIconHtml(draft.followers);
|
||||
fol.title = followerTip(draft.followers);
|
||||
}
|
||||
paintAv(); paintFol(); paintDue();
|
||||
inp.addEventListener("input", function () { draft.title = inp.value; });
|
||||
inp.addEventListener("focus", function () { draft.focused = true; });
|
||||
inp.addEventListener("blur", function () { draft.focused = false; });
|
||||
@@ -4973,11 +4981,32 @@
|
||||
const r = av.getBoundingClientRect();
|
||||
showContextMenu(r.left, r.bottom + 4, assigneeMenuItems(
|
||||
list.map(function (m) { return m.user_email; }), draft.assignee,
|
||||
function (email) { if (!current()) return; draft.assignee = email || ""; paintAv(); refocus(); }
|
||||
function (email) {
|
||||
if (!current()) return;
|
||||
draft.assignee = email || "";
|
||||
const a = draft.assignee.toLowerCase();
|
||||
if (a) draft.followers = draft.followers.filter(function (x) { return x !== a; }); // 담당자는 협업자가 아니다
|
||||
paintAv(); paintFol(); refocus();
|
||||
}
|
||||
));
|
||||
} catch (err) { showToast("멤버 조회 실패: " + err.message, "error"); }
|
||||
finally { draft.picking = false; }
|
||||
});
|
||||
fol.addEventListener("click", async function () {
|
||||
draft.picking = true; // 멤버 조회 중에는 바깥 클릭으로 저장하지 않는다.
|
||||
try {
|
||||
const list = await membersOfProject(projectId);
|
||||
if (!current() || !fol.isConnected) return;
|
||||
openFollowerMenu(fol, list.map(function (m) { return m.user_email; }), function () { return draft.followers; },
|
||||
function (em, on) {
|
||||
if (!current()) return false;
|
||||
draft.followers = on ? draft.followers.concat([em]) : draft.followers.filter(function (x) { return x !== em; });
|
||||
paintFol();
|
||||
return true;
|
||||
}, function () { return draft.assignee; });
|
||||
} catch (err) { showToast("멤버 조회 실패: " + err.message, "error"); }
|
||||
finally { draft.picking = false; }
|
||||
});
|
||||
due.addEventListener("click", function () {
|
||||
openDatePopover(due, {
|
||||
due: draft.due, allowStart: false,
|
||||
@@ -4995,19 +5024,20 @@
|
||||
const title = draft.title.trim();
|
||||
if (!title) return;
|
||||
draft.saving = true;
|
||||
inp.disabled = av.disabled = due.disabled = true;
|
||||
inp.disabled = av.disabled = fol.disabled = due.disabled = true;
|
||||
card.setAttribute("aria-busy", "true");
|
||||
try {
|
||||
const res = await api("POST", "/project/api/projects/" + projectId + "/tasks", {
|
||||
title: title, stage_id: stage.id,
|
||||
assignee_email: draft.assignee, assignee_name: draft.assignee ? idOf(draft.assignee) : "",
|
||||
due_date: draft.due || null,
|
||||
followers: draft.followers,
|
||||
});
|
||||
if (!current()) return;
|
||||
mergeTask(res.task);
|
||||
if (keepOpen) {
|
||||
boardTaskDrafts[stage.id] = {
|
||||
title: "", assignee: stage.default_assignee_email || "", due: null, focused: true, saving: false,
|
||||
title: "", assignee: stage.default_assignee_email || "", followers: [], due: null, focused: true, saving: false,
|
||||
};
|
||||
} else delete boardTaskDrafts[stage.id];
|
||||
refreshActiveView();
|
||||
|
||||
Reference in New Issue
Block a user