feat(project): delete registered tasks from the meeting task table

Registered rows get a delete button that, after confirmation, deletes the
task from its project (trash). Unapplied rows get an x to drop the row.
Registered rows now stay in the browser list so they can be deleted later.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 16:56:57 +09:00
parent 18dd9531ad
commit 6959941128
11 changed files with 67 additions and 18 deletions
@@ -1,7 +1,7 @@
{% extends "project/_meeting_content_base.html" if meeting_embedded else "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261007f" />
<link rel="stylesheet" href="/static/project.css?v=20261007g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -281,5 +281,5 @@
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project-meeting-cells.js?v=20261007a" defer></script>
<script src="/static/project.js?v=20261007k" defer></script>
<script src="/static/project.js?v=20261007l" defer></script>
{% endblock %}
@@ -207,5 +207,5 @@
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project.js?v=20261007k" defer></script>
<script src="/static/project.js?v=20261007l" defer></script>
{% endblock %}
@@ -602,7 +602,8 @@
<ol class="pjh-steps">
<li><b>작업 등록</b> — 제목 칸에 작업 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다.</li>
<li>프로젝트는 내가 멤버인 프로젝트만 나오고, 고르면 첫 섹션이 자동으로 들어갑니다. 담당자는 그 프로젝트의 멤버·소유자 중에서 고릅니다(프로젝트를 먼저 고르면 정확합니다).</li>
<li>맨 오른쪽 <span class="pjh-ui">적용</span>을 누르면 그 프로젝트에 작업이 만들어지고, 줄에 <b>등록됨</b> 링크가 생깁니다. 아직 적용하지 않은 줄은 이 브라우저에 남아 있어 새로고침해도 사라지지 않습니다. <span class="pjh-ui">+ 줄 추가</span>로 줄을 늘립니다.</li>
<li>맨 오른쪽 <span class="pjh-ui">적용</span>을 누르면 그 프로젝트에 작업이 만들어지고, 줄에 <b>등록됨</b> 링크가 생깁니다. 줄은 이 브라우저에 남아 있어 새로고침해도 사라지지 않습니다. <span class="pjh-ui">+ 줄 추가</span>로 줄을 늘립니다.</li>
<li>등록된 줄의 휴지통 아이콘을 누르면 확인 후 <b>그 프로젝트의 작업도 함께 삭제</b>됩니다(휴지통에 3개월 보관). 적용 전 줄의 <span class="pjh-ui">×</span>는 줄만 지웁니다. 작업 삭제는 만든 사람만 할 수 있습니다.</li>
</ol>
<table class="pjh-table">
<tr><th>지표</th><th>뜻과 출처</th></tr>
@@ -104,5 +104,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261007k" defer></script>
<script src="/static/project.js?v=20261007l" defer></script>
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20261007k" defer></script>
<script src="/static/project.js?v=20261007l" defer></script>
{% endblock %}
@@ -487,5 +487,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261007k" defer></script>
<script src="/static/project.js?v=20261007l" defer></script>
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261007k" defer></script>
<script src="/static/project.js?v=20261007l" defer></script>
{% endblock %}
+12 -3
View File
@@ -2524,11 +2524,19 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
}
.pj-ctxmenu-ic .pj-meet-quick-face { width: 20px; height: 20px; }
.pj-member-pick.is-owner { opacity: .75; }
.pj-meet-quick-table th:nth-child(1) { width: 34%; }
.pj-meet-quick-table th:nth-child(1) { width: 30%; }
.pj-meet-quick-table th:nth-child(2) { width: 17%; }
.pj-meet-quick-table th:nth-child(3) { width: 20%; }
.pj-meet-quick-table th:nth-child(3) { width: 19%; }
.pj-meet-quick-table th:nth-child(4) { width: 15%; }
.pj-meet-quick-table th:nth-child(5) { width: 14%; }
.pj-meet-quick-table th:nth-child(5) { width: 19%; }
.pj-meet-quick-acts { white-space: nowrap; text-align: right; }
.pj-meet-quick-del {
display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 4px; vertical-align: middle;
border: none; border-radius: 6px; background: none; color: #9aa1ab; cursor: pointer;
}
.pj-meet-quick-del .material-symbols-outlined { font-size: 17px; }
.pj-meet-quick-del:hover { background: #fdecec; color: #c22b10; }
.pj-meet-quick-del:disabled { opacity: .4; cursor: default; }
.pj-meet-quick-table td { padding: 2px 3px; border-bottom: 1px solid #eef0f2; vertical-align: middle; }
.pj-meet-quick-table input { width: 100%; box-sizing: border-box; height: 26px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; }
.pj-meet-quick-table input:hover, .pj-meet-quick-table input:focus { border-color: #dfe2e6; background: #fff; outline: none; }
@@ -2543,6 +2551,7 @@ html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important;
.pj-meet-quick-done { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: #1f8a4c; white-space: nowrap; }
.pj-meet-quick-done a { color: inherit; }
.pj-meet-quick-table tr.is-done input, .pj-meet-quick-table tr.is-done .pj-meet-pick-cell { color: var(--pj-ink-soft); pointer-events: none; }
.pj-meet-quick-table tr.is-done .pj-meet-pick-cell.is-person { color: var(--pj-ink-soft); }
.pj-meet-quick-add { margin-top: 4px; padding: 2px 6px; border: none; background: none; color: var(--pj-accent-dark); font: inherit; font-size: 12px; cursor: pointer; }
@media print { .pj-meet-quick { display: none !important; } .pj-meet-area { height: auto; } }
.pj-meet-title { flex-wrap: wrap; }
+32 -6
View File
@@ -10272,7 +10272,8 @@
// ── 회의록 머리 ③ 작업 등록 표 — 제목 입력, 담당자·프로젝트·섹션 칸을 누르면 목록(showContextMenu — body 에 붙음),
// [적용] = 그 프로젝트에 작업 만들기(POST /project/api/projects/{id}/tasks, 담당자는 그 프로젝트 멤버·소유자만 —
// 서버 _check_assignee). 프로젝트 목록은 내가 멤버인 최상위 프로젝트(GET /project/api/projects).
// 아직 적용 안 한 줄은 이 브라우저에 보관(localStorage pj_meet_quick:{이메일}) — 새로고침해도 남는다.
// 줄은 이 브라우저에 보관(localStorage pj_meet_quick:{이메일}) — 새로고침해도 남는다(등록된 줄도 — 나중에 삭제할 수 있게).
// 등록된 줄의 [삭제] = 확인 뒤 그 작업을 프로젝트에서도 삭제(DELETE /project/api/tasks/{id}, 휴지통 3개월), 적용 전 줄의 × = 줄만 지움.
function initMeetQuickTasks() {
const box = el("pj-meet-quick");
if (!box) return;
@@ -10293,10 +10294,10 @@
};
const blank = function () { return { title: "", assignee: "", projectId: null, projectName: "", stageId: null, stageName: "" }; };
let rows = [];
try { rows = (JSON.parse(localStorage.getItem(KEY) || "[]") || []).filter(function (r) { return r && !r.done; }); } catch (_) { rows = []; }
try { rows = (JSON.parse(localStorage.getItem(KEY) || "[]") || []).filter(function (r) { return r && typeof r === "object"; }); } catch (_) { rows = []; }
while (rows.length < 3) rows.push(blank());
const save = function () {
try { localStorage.setItem(KEY, JSON.stringify(rows.filter(function (r) { return !r.done && (r.title || r.projectId || r.assignee); }))); } catch (_) {}
try { localStorage.setItem(KEY, JSON.stringify(rows.filter(function (r) { return r.done || r.title || r.projectId || r.assignee; }))); } catch (_) {}
};
let projects = null;
const memberCache = {}, stageCache = {};
@@ -10335,10 +10336,14 @@
: cell("assignee", "", "담당자")) + "</td>" +
"<td>" + cell("project", r.projectName, "프로젝트") + "</td>" +
"<td>" + cell("stage", r.stageName, "섹션") + "</td>" +
"<td>" + (r.done
'<td class="pj-meet-quick-acts">' + (r.done
? '<span class="pj-meet-quick-done"><span class="material-symbols-outlined" style="font-size:16px">check_circle</span>' +
'<a href="/project/p/' + r.done.pid + "?task=" + r.done.id + '" target="_blank" rel="noopener">등록됨</a></span>'
: '<button type="button" class="pj-meet-quick-apply" data-quick="apply">적용</button>') + "</td></tr>";
'<a href="/project/p/' + r.done.pid + "?task=" + r.done.id + '" target="_blank" rel="noopener">등록됨</a></span>' +
'<button type="button" class="pj-meet-quick-del" data-quick="delete" title="이 작업을 프로젝트에서도 삭제(휴지통에 3개월 보관)">' +
'<span class="material-symbols-outlined">delete</span></button>'
: '<button type="button" class="pj-meet-quick-apply" data-quick="apply">적용</button>' +
'<button type="button" class="pj-meet-quick-del" data-quick="remove" title="이 줄 지우기(아직 등록 전)">' +
'<span class="material-symbols-outlined">close</span></button>') + "</td></tr>";
}).join("");
}
function menuAt(btn, items) {
@@ -10397,6 +10402,25 @@
showToast("작업 등록 실패: " + e.message, "error");
}
}
// 등록된 작업 삭제 — 프로젝트에서도 지운다(휴지통). 이미 없으면(다른 곳에서 삭제) 줄만 지운다.
async function removeTask(r, btn) {
if (!(await confirm("‘" + (r.title || "작업") + "’ 작업을 ‘" + (r.projectName || "프로젝트") + "’에서도 삭제할까요? 삭제한 작업은 휴지통에 3개월 보관됩니다.",
{ okText: "삭제", cancelText: "취소" }))) return;
btn.disabled = true;
try {
await api("DELETE", "/project/api/tasks/" + r.done.id);
showToast("작업을 삭제했습니다.");
} catch (e) {
if (e.status !== 404) { btn.disabled = false; showToast("작업 삭제 실패: " + e.message, "error"); return; }
}
dropRow(r);
}
function dropRow(r) {
const i = rows.indexOf(r);
if (i >= 0) rows.splice(i, 1);
if (!rows.some(function (x) { return !x.done; })) rows.push(blank());
save(); render();
}
tbody.addEventListener("input", function (e) {
const inp = e.target.closest("input[data-field=title]");
if (!inp) return;
@@ -10411,6 +10435,8 @@
const tr = e.target.closest("tr");
if (!tr) return;
const r = rows[+tr.dataset.i], pick = e.target.closest("[data-pick]");
const del = e.target.closest('[data-quick="delete"], [data-quick="remove"]');
if (del) { if (del.dataset.quick === "delete") removeTask(r, del); else dropRow(r); return; }
if (r.done) return;
const fail = function (err) { showToast("목록을 읽지 못했습니다: " + err.message, "error"); };
if (pick) {
+2 -1
View File
@@ -868,7 +868,8 @@ description 을 항상 HTML로 취급하기 때문). 두 번 실행하면 이중
[적용]. 빈 칸을 누르면 `showContextMenu`(body) 목록 — 프로젝트 = `GET /api/projects` 의 최상위(내가 멤버인 것), 고르면 첫 섹션 자동,
담당자 = 그 프로젝트 멤버+소유자(`GET /api/projects/{id}/members`, 프로젝트 전이면 `PJ_MEET_MEMBERS`; 프로젝트를 바꿔 멤버가 아니면 비움),
섹션 = `GET /api/projects/{id}/stages`. [적용] = `POST /api/projects/{id}/tasks {title, stage_id, assignee_email}`(서버가 멤버·담당자 권한 검사)
→ 줄에 "등록됨" 링크(`/project/p/{id}?task=`). 적용 전 줄은 localStorage `pj_meet_quick:{이메일}`. 예전 `#pj-meet-top`(pane 안 sticky)은 없앴다.
→ 줄에 "등록됨" 링크(`/project/p/{id}?task=`) + 삭제(확인 뒤 `DELETE /api/tasks/{id}` — 그 프로젝트 작업도 삭제, 휴지통, 이미 없으면 줄만 지움),
적용 전 줄의 × = 줄만 지움. 줄(등록된 줄 포함)은 localStorage `pj_meet_quick:{이메일}`. 예전 `#pj-meet-top`(pane 안 sticky)은 없앴다.
- (예전) **위쪽 고정 영역**(`#pj-meet-top`, `.pj-meet-pane` 안 sticky): 왼쪽 절반 숫자 4칸 — **월 목표 매출**(목표 표, = 주차 목표 합) ·
**월 누적 목표 매출**(주차별 목표 1주차~이 주차 합, 원) · **월 누적 실적**(1일 ~ 오늘, 지난 주차면 그 주차 끝날 — 실적 모듈) ·
**누적 목표 대비 달성**(실적 − 누적 목표 차액 + 실적 ÷ 누적 목표 %) / 오른쪽 절반 **결정 사항·메모**(예전엔 표 아래).
+12
View File
@@ -518,6 +518,18 @@ function meetServer(env, st) {
check("[2g] 적용 → 그 프로젝트에 작업 생성", posted && posted.title === "상세페이지 수정" && posted.stage_id === 71 && posted.assignee_email === "kim@test.local", posted);
check("[2g] 등록된 줄은 '등록됨' 링크", /등록됨/.test(d.querySelector("#pj-meet-quick tbody tr").textContent) &&
d.querySelector("#pj-meet-quick tbody tr a").getAttribute("href") === "/project/p/7?task=555");
// 등록된 줄 삭제 → 확인 → 그 프로젝트의 작업도 삭제(DELETE), 줄 사라짐
let deleted = null;
env.route("DELETE", /\/project\/api\/tasks\/555$/, function (u) { deleted = u; return { body: { ok: true } }; });
env.w.erpConfirm = function () { return Promise.resolve(true); };
const before = d.querySelectorAll("#pj-meet-quick tbody tr").length;
d.querySelector('#pj-meet-quick tbody tr [data-quick="delete"]').click(); await settle(); await wait(5); await settle();
check("[2g] 등록된 작업 삭제 → 프로젝트 작업 DELETE·줄 제거", !!deleted && d.querySelectorAll("#pj-meet-quick tbody tr").length === before - 1 &&
!d.querySelector("#pj-meet-quick tbody tr.is-done"), [deleted, before]);
// 적용 전 줄의 × = 줄만 지움(요청 없음)
const calls = env.calls.length, n = d.querySelectorAll("#pj-meet-quick tbody tr").length;
d.querySelector('#pj-meet-quick tbody tr [data-quick="remove"]').click(); await settle();
check("[2g] 적용 전 줄 × → 줄만 지움", d.querySelectorAll("#pj-meet-quick tbody tr").length === n - 1 && env.calls.length === calls);
}, { notifyOnFail: true });
// ════════════════════ [3] 목표 표 — 글 저장 실패면 구조 변경·표 교체 중단 ════════════════════