From 695994112862bcc63f066d12931e34bf9a4c9884 Mon Sep 17 00:00:00 2001 From: king Date: Wed, 7 Oct 2026 16:56:57 +0900 Subject: [PATCH] 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 --- .../templates/project/goal_meeting.html | 4 +- .../project/templates/project/goals.html | 2 +- .../project/templates/project/help.html | 3 +- .../project/templates/project/inbox.html | 2 +- .../project/templates/project/mytasks.html | 2 +- .../project/templates/project/project.html | 2 +- .../project/templates/project/trash.html | 2 +- app/static/project.css | 15 ++++++-- app/static/project.js | 38 ++++++++++++++++--- docs/PROJECT_MODULE.md | 3 +- tests/js/goals_meeting_ui.test.js | 12 ++++++ 11 files changed, 67 insertions(+), 18 deletions(-) diff --git a/app/modules/project/templates/project/goal_meeting.html b/app/modules/project/templates/project/goal_meeting.html index 0385cf5..5d4d80e 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 %} @@ -281,5 +281,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/goals.html b/app/modules/project/templates/project/goals.html index 6f65c11..b1da084 100644 --- a/app/modules/project/templates/project/goals.html +++ b/app/modules/project/templates/project/goals.html @@ -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 8663e06..b4ef8cb 100644 --- a/app/modules/project/templates/project/help.html +++ b/app/modules/project/templates/project/help.html @@ -602,7 +602,8 @@
  1. 작업 등록 — 제목 칸에 작업 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다.
  2. 프로젝트는 내가 멤버인 프로젝트만 나오고, 고르면 첫 섹션이 자동으로 들어갑니다. 담당자는 그 프로젝트의 멤버·소유자 중에서 고릅니다(프로젝트를 먼저 고르면 정확합니다).
  3. -
  4. 맨 오른쪽 적용을 누르면 그 프로젝트에 작업이 만들어지고, 줄에 등록됨 링크가 생깁니다. 아직 적용하지 않은 줄은 이 브라우저에 남아 있어 새로고침해도 사라지지 않습니다. + 줄 추가로 줄을 늘립니다.
  5. +
  6. 맨 오른쪽 적용을 누르면 그 프로젝트에 작업이 만들어지고, 줄에 등록됨 링크가 생깁니다. 줄은 이 브라우저에 남아 있어 새로고침해도 사라지지 않습니다. + 줄 추가로 줄을 늘립니다.
  7. +
  8. 등록된 줄의 휴지통 아이콘을 누르면 확인 후 그 프로젝트의 작업도 함께 삭제됩니다(휴지통에 3개월 보관). 적용 전 줄의 ×는 줄만 지웁니다. 작업 삭제는 만든 사람만 할 수 있습니다.
diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index a93cad7..e0ce1a0 100644 --- a/app/modules/project/templates/project/inbox.html +++ b/app/modules/project/templates/project/inbox.html @@ -104,5 +104,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 7918c7d..5912ce1 100644 --- a/app/modules/project/templates/project/mytasks.html +++ b/app/modules/project/templates/project/mytasks.html @@ -100,5 +100,5 @@ "today": {{ today | tojson }} } - + {% endblock %} diff --git a/app/modules/project/templates/project/project.html b/app/modules/project/templates/project/project.html index 0b93d08..b89dd8d 100644 --- a/app/modules/project/templates/project/project.html +++ b/app/modules/project/templates/project/project.html @@ -487,5 +487,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html index 9cc54f6..ddff4fc 100644 --- a/app/modules/project/templates/project/trash.html +++ b/app/modules/project/templates/project/trash.html @@ -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 d2ce086..d6302ad 100644 --- a/app/static/project.css +++ b/app/static/project.css @@ -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; } diff --git a/app/static/project.js b/app/static/project.js index 0749898..dc5cea6 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -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", "", "담당자")) + "" + "" + "" + - ""; + '등록됨' + + '' + : '' + + '') + ""; }).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) { diff --git a/docs/PROJECT_MODULE.md b/docs/PROJECT_MODULE.md index d23cf76..7759371 100644 --- a/docs/PROJECT_MODULE.md +++ b/docs/PROJECT_MODULE.md @@ -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일 ~ 오늘, 지난 주차면 그 주차 끝날 — 실적 모듈) · **누적 목표 대비 달성**(실적 − 누적 목표 차액 + 실적 ÷ 누적 목표 %) / 오른쪽 절반 **결정 사항·메모**(예전엔 표 아래). diff --git a/tests/js/goals_meeting_ui.test.js b/tests/js/goals_meeting_ui.test.js index 307ca63..267a1df 100644 --- a/tests/js/goals_meeting_ui.test.js +++ b/tests/js/goals_meeting_ui.test.js @@ -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] 목표 표 — 글 저장 실패면 구조 변경·표 교체 중단 ════════════════════
지표뜻과 출처
" + cell("project", r.projectName, "프로젝트") + "" + cell("stage", r.stageName, "섹션") + "" + (r.done + '' + (r.done ? 'check_circle' + - '등록됨' - : '') + "