From 6f58beb2c516a722bc821a6fea8f1ad7d22f65c7 Mon Sep 17 00:00:00 2001 From: king Date: Mon, 26 Oct 2026 15:53:48 +0900 Subject: [PATCH] =?UTF-8?q?feat(project):=20=ED=9A=8C=EC=9D=98=EB=A1=9D=20?= =?UTF-8?q?=EC=97=85=EB=AC=B4=20=EB=93=B1=EB=A1=9D=20=E2=80=94=20=EC=84=B8?= =?UTF-8?q?=EB=B6=80=20=EC=97=85=EB=AC=B4=20=EC=A4=84=EC=97=90=20=EC=83=81?= =?UTF-8?q?=EC=9C=84=20=EC=97=85=EB=AC=B4=20=EC=84=B9=EC=85=98=20=ED=91=9C?= =?UTF-8?q?=EC=8B=9C=20=C2=B7=20=EC=A0=9C=EB=AA=A9=20=EC=97=B4=EC=9D=84=20?= =?UTF-8?q?=EC=97=85=EB=AC=B4=20=EC=98=A4=EB=A5=B8=EC=AA=BD=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 서버 parent_stage_name(_mt_select LATERAL 재귀 — 세부의 세부면 섹션 있는 맨 위 업무), 화면은 회색 고칠 수 없는 섹션 - 열 순서 담당자·프로젝트·섹션·업무·제목, 제목 Enter = [적용]으로 포커스, 도움말 갱신 - 테스트: 실제 PG parent_stage_name, goals_meeting_ui [2g4]·[2g5] Co-Authored-By: Claude Opus 5.5 --- .../cupang/templates/cupang/index.html | 4 +-- .../notice/templates/notice/admin.html | 4 +-- app/modules/project/CLAUDE.md | 4 ++- app/modules/project/db.py | 15 ++++++++--- app/modules/project/router.py | 2 +- .../templates/project/goal_meeting.html | 6 ++--- .../project/templates/project/goals.html | 4 +-- .../project/templates/project/help.html | 5 ++-- .../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 | 9 ++++--- app/static/project.js | 26 ++++++++++++------- tests/js/goals_meeting_ui.test.js | 23 ++++++++++------ tests/test_project_module.py | 21 +++++++++++++++ 17 files changed, 96 insertions(+), 47 deletions(-) diff --git a/app/modules/cupang/templates/cupang/index.html b/app/modules/cupang/templates/cupang/index.html index 0e9a041..ae69010 100644 --- a/app/modules/cupang/templates/cupang/index.html +++ b/app/modules/cupang/templates/cupang/index.html @@ -2,7 +2,7 @@ {% block head_extra %} {# 출고리스트 작성 팝업의 날짜 칸은 프로젝트 화면의 날짜 팝업을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #} - + @@ -249,7 +249,7 @@ {% endblock %} {% block scripts %} - + {% endblock %} @@ -64,7 +64,7 @@ - + {% endif %} {% endblock %} diff --git a/app/modules/project/CLAUDE.md b/app/modules/project/CLAUDE.md index d1b9340..c429e24 100644 --- a/app/modules/project/CLAUDE.md +++ b/app/modules/project/CLAUDE.md @@ -138,7 +138,9 @@ 작업 칸(마이그레이션 026 `parent_task_id`) = 이미 있는 작업을 고르면 그 작업의 세부 작업으로 등록. 등록된 줄 = 줄 어디든 누르면 오른쪽 작업 창(편집, 저장 대기 — 2026-10-26 예전엔 제목만), 세부 업무 줄의 "↳ 상위" = 상위 업무 창, [크게 열기] = 같은 표를 넓은 창으로. **하위 업무 등록**(2026-10-26, 6-26) — 등록된 줄 [+](`data-quick="add-sub"`) = 바로 아래 세부 업무 초안(프로젝트·`parent_task_id` = 그 업무, 제목을 치면 POST), - 세부 업무 줄은 상위 줄 아래 들여쓰기(`displayOrder`, 서버 순서·DB 변경 없음). 예전 [2g4] "↳(줄 세부 작업)" 버튼은 표 줄끼리 묶던 다른 기능(025 parent_id). + 세부 업무 줄은 상위 줄 아래 들여쓰기(`displayOrder`, 서버 순서·DB 변경 없음). + **열 = 담당자 · 프로젝트 · 섹션 · 업무 · 제목**(2026-10-27 제목을 업무 오른쪽으로, 제목 Enter = [적용]으로 포커스). 세부 업무 줄의 섹션 = + 고른 업무의 섹션(서버 `parent_stage_name` — 세부의 세부면 섹션 있는 맨 위 업무까지 올라감, `_mt_select` LATERAL 재귀, 고칠 수 없음 회색). 예전 [2g4] "↳(줄 세부 작업)" 버튼은 표 줄끼리 묶던 다른 기능(025 parent_id). - 실적 모듈 `performance_store` 매출은 머리 카드에만 읽기 전용 — 줄(쇼핑몰)별 자동 결과·이번주 실적·연결 배지·쇼핑몰 연결 메뉴는 폐지, 지난주 결과는 늘 직접 입력. - "주요 업무" 칸 우클릭 위/아래 줄 추가 = 항목 칸은 그대로 그 항목 안에(마이그레이션 027 `label_cont`, 항목 칸 나누기). - **글 칸 하이퍼링크**(2026-10-26, 6-26) — 목표·회의록 서식 도구(`_cell_format.html`) 🔗 = 선택 글자에 주소(pj-rich 조각 `link`, http(s)만 — 서버 `store.goal_link`, diff --git a/app/modules/project/db.py b/app/modules/project/db.py index c00603f..2b38df2 100644 --- a/app/modules/project/db.py +++ b/app/modules/project/db.py @@ -3774,7 +3774,8 @@ class ProjectStore: out[k] = int(out[k]) if out[k] is not None else None out["week_start"] = r["week_start"].isoformat() out["updated_at"] = r["updated_at"].astimezone(KST).isoformat(timespec="seconds") if r.get("updated_at") else "" - for k in ("project_name", "project_status", "stage_name", "task_title", "task_project_id", "parent_task_title"): + for k in ("project_name", "project_status", "stage_name", "task_title", "task_project_id", "parent_task_title", + "parent_stage_name"): if k in r: out[k] = r[k] if "task_exists" in r: @@ -3839,12 +3840,20 @@ class ProjectStore: f"SELECT {self._mt_cols(conn, 'm.')}, " " p.name AS project_name, p.status AS project_status, s.name AS stage_name, " " t.title AS task_title, t.project_id AS task_project_id, (t.id IS NOT NULL) AS task_exists" - + (", pt.title AS parent_task_title " if v26 else " ") + + + (", pt.title AS parent_task_title, pst.name AS parent_stage_name " if v26 else " ") + "FROM goal_meeting_tasks m " "LEFT JOIN projects p ON p.id = m.project_id " "LEFT JOIN project_stages s ON s.id = m.stage_id " "LEFT JOIN tasks t ON t.id = m.task_id " - + ("LEFT JOIN tasks pt ON pt.id = m.parent_task_id " if v26 else "") + + # 세부 업무로 등록하는 줄(2026-10-27) — 섹션 = 고른 업무의 섹션(세부의 세부면 위로 올라가 섹션 있는 맨 위 업무) + + ("LEFT JOIN tasks pt ON pt.id = m.parent_task_id " + "LEFT JOIN LATERAL (" + " WITH RECURSIVE up AS (" + " SELECT u.id, u.parent_task_id, u.stage_id, 0 AS depth FROM tasks u WHERE u.id = m.parent_task_id " + " UNION ALL SELECT u2.id, u2.parent_task_id, u2.stage_id, up.depth + 1 FROM tasks u2 " + " JOIN up ON u2.id = up.parent_task_id WHERE up.stage_id IS NULL AND up.depth < 20) " + " SELECT ps.name FROM up JOIN project_stages ps ON ps.id = up.stage_id ORDER BY up.depth LIMIT 1" + ") pst ON TRUE " if v26 else "") + f"WHERE {where} ORDER BY m.sort_order, m.id", params, ).fetchall() diff --git a/app/modules/project/router.py b/app/modules/project/router.py index 2be1a15..20b8bb7 100644 --- a/app/modules/project/router.py +++ b/app/modules/project/router.py @@ -4242,7 +4242,7 @@ def _quick_view(st: Any, user: dict[str, Any], rows: list[dict[str, Any]]) -> li r = dict(r, visible=ok, registered=r.get("task_id") is not None) # 등록됨 여부는 누구에게나(작업 내용은 멤버만) if not ok: r.update(project_name="(볼 수 없는 프로젝트)", stage_name="", task_title="", task_id=None, - task_project_id=None, parent_task_id=None, parent_task_title="") + task_project_id=None, parent_task_id=None, parent_task_title="", parent_stage_name="") out.append(r) return out diff --git a/app/modules/project/templates/project/goal_meeting.html b/app/modules/project/templates/project/goal_meeting.html index afa5d6d..9c729aa 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 %} @@ -114,7 +114,7 @@
- +
제목담당자프로젝트섹션업무
담당자프로젝트섹션업무제목
@@ -289,5 +289,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/goals.html b/app/modules/project/templates/project/goals.html index 5364f22..4fa8638 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 7f80f95..48e00fa 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 %} @@ -659,7 +659,8 @@

제목 아래 두 칸은 표를 스크롤해도 그대로 보입니다. 왼쪽 칸 머리 한 줄에 N월 계획과 숫자 4개(월 목표 · 누적 목표 · 누적 실적 · 목표 대비, 목표 표 매출 단위 예: 백만원 — 숫자에 마우스를 올리면 원 단위 금액과 뜻)와 결정사항 제목이 나오고, 그 아래 칸 전체가 결정사항(진행상황 수시 공유 및 완료 되어야 할 것) 입력란입니다. 오른쪽은 업무 등록 표입니다.

  1. 업무 등록(제목에 N주차 업무 등록) — 주차마다 한 표를 모두가 같이 봅니다(다른 사람이 적거나 등록한 줄도 보임, 30초마다·창을 다시 볼 때 새로 읽음). 내가 멤버가 아닌 프로젝트를 고른 남의 줄은 프로젝트 이름을 가립니다. 회의 완료면 읽기 전용입니다. - 업무 칸 — 비워 두면 고른 섹션에 새 업무로, 업무를 고르면 그 업무의 세부 업무로 등록합니다(목록 = 그 섹션의 진행 중인 메인 업무, 고르면 섹션 칸은 —). 등록된 줄(업무·세부 업무)을 누르면 줄 어디든 오른쪽에 업무 창이 열려 바로 편집할 수 있습니다(연 줄은 옅은 보라색, 다른 줄을 누르면 창이 그 업무로 바뀜, 업무 창에서 저장이 끝나야 닫히거나 다른 업무로 바뀝니다). 세부 업무 줄의 ↳ 상위 업무를 누르면 상위 업무 창이 열립니다. + 칸 순서는 담당자 · 프로젝트 · 섹션 · 업무 · 제목입니다(제목에서 Enter = 적용 버튼으로). + 업무 칸 — 비워 두면 고른 섹션에 새 업무로, 업무를 고르면 그 업무의 세부 업무로 등록합니다(목록 = 그 섹션의 진행 중인 메인 업무, 고르면 섹션 칸에 그 업무의 섹션이 회색으로 — 상위 업무를 따름). 등록된 줄(업무·세부 업무)을 누르면 줄 어디든 오른쪽에 업무 창이 열려 바로 편집할 수 있습니다(연 줄은 옅은 보라색, 다른 줄을 누르면 창이 그 업무로 바뀜, 업무 창에서 저장이 끝나야 닫히거나 다른 업무로 바뀝니다). 세부 업무 줄의 ↳ 상위 업무를 누르면 상위 업무 창이 열립니다. 하위 업무 등록 — 등록된 줄 오른쪽 add(하위 업무 추가)을 누르면 바로 아래에 그 업무의 세부 업무 줄이 생깁니다(프로젝트·↳ 상위 업무가 채워져 있음). 제목·담당자를 적고 적용하면 세부 업무로 등록되고, 세부 업무 줄에서 다시 add를 누르면 그 아래 단계도 만들 수 있습니다. 세부 업무 줄은 상위 업무 줄 아래에 들여 써서 보입니다. 크게 열기 — 같은 표를 넓은 창으로 열어 씁니다(줄·저장은 그대로, Esc·×로 닫기). 제목 칸에 업무 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다(완료 프로젝트·완료 섹션은 목록에 나오지 않습니다). 목록 맨 위 새 프로젝트(Pro user 이상)·새 섹션(그 프로젝트 멤버)을 누르면 이름만 적어 바로 만들고 그 칸에 골라집니다. 새 프로젝트는 섹션 없이 시작하니 섹션 칸에서 새 섹션을 만들어 고르세요.
  2. 프로젝트는 내가 멤버인 프로젝트만 나오고, 고르면 첫 섹션이 자동으로 들어갑니다. 담당자는 그 프로젝트의 멤버·소유자 중에서 고릅니다(프로젝트를 먼저 고르면 정확합니다).
  3. diff --git a/app/modules/project/templates/project/inbox.html b/app/modules/project/templates/project/inbox.html index c63450a..c182397 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 %} @@ -106,5 +106,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 a9bcc10..e5f428d 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 292ddde..02655f0 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 5a23a93..f36f8f9 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 %} - + @@ -476,5 +476,5 @@ - + {% endblock %} diff --git a/app/modules/project/templates/project/trash.html b/app/modules/project/templates/project/trash.html index a99eb3b..9eace18 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 b7a5b49..8188720 100644 --- a/app/static/project.css +++ b/app/static/project.css @@ -2756,11 +2756,12 @@ 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: 24%; } +/* 열 = 담당자 · 프로젝트 · 섹션 · 업무 · 제목 · 버튼(2026-10-27 제목을 업무 오른쪽으로) */ +.pj-meet-quick-table th:nth-child(1) { width: 15%; } .pj-meet-quick-table th:nth-child(2) { width: 15%; } -.pj-meet-quick-table th:nth-child(3) { width: 15%; } -.pj-meet-quick-table th:nth-child(4) { width: 12%; } -.pj-meet-quick-table th:nth-child(5) { width: 15%; } +.pj-meet-quick-table th:nth-child(3) { width: 12%; } +.pj-meet-quick-table th:nth-child(4) { width: 15%; } +.pj-meet-quick-table th:nth-child(5) { width: 24%; } .pj-meet-quick-table th:nth-child(6) { width: 19%; } .pj-meet-quick-acts { white-space: nowrap; text-align: right; } .pj-meet-quick-del { diff --git a/app/static/project.js b/app/static/project.js index 4e21fba..87a1d97 100644 --- a/app/static/project.js +++ b/app/static/project.js @@ -12140,13 +12140,14 @@ }; const blank = function () { return { id: null, title: "", assignee: "", projectId: null, projectName: "", stageId: null, stageName: "", - parentTaskId: null, parentTaskTitle: "", taskId: null, registered: false, visible: true, taskExists: true, chain: null, - unsaved: new Set(), err: "" }; + parentTaskId: null, parentTaskTitle: "", parentStageName: "", taskId: null, registered: false, visible: true, taskExists: true, + chain: null, unsaved: new Set(), err: "" }; }; function fromServer(t) { return { id: t.id, title: t.title || "", assignee: t.assignee_email || "", projectId: t.project_id, projectName: t.project_name || "", stageId: t.stage_id, stageName: t.stage_name || "", - parentTaskId: t.parent_task_id || null, parentTaskTitle: t.parent_task_title || "", taskId: t.task_id, + parentTaskId: t.parent_task_id || null, parentTaskTitle: t.parent_task_title || "", parentStageName: t.parent_stage_name || "", + taskId: t.task_id, registered: !!t.registered, visible: t.visible !== false, taskExists: t.task_exists !== false, chain: null, unsaved: new Set(), err: "" }; } @@ -12314,16 +12315,20 @@ const cls = [r.registered ? "is-done" : (r.err && r.unsaved.size ? "is-unsaved" : ""), openable ? "is-openable" : "", depth ? "is-sub" : "", openable && panelOpen() && panelTask === r.taskId ? "is-panel-selected" : ""] .filter(Boolean).join(" "); + // 열 = 담당자 · 프로젝트 · 섹션 · 업무 · 제목(2026-10-27 제목을 업무 오른쪽으로) · 버튼 return '" + - '' + titleCell + "" + "" + (r.assignee ? '" : cell("assignee", "", "담당자", ro)) + "" + "" + cell("project", r.projectName, "프로젝트", ro) + "" + - "" + (r.parentTaskId ? '—' + // 세부 업무 줄의 섹션 = 고른(상위) 업무의 섹션 — 바꿀 수 없음(상위 업무를 따름), 회색 글자(2026-10-27 예전엔 —) + "" + (r.parentTaskId + ? '' + + escapeHtml(r.parentStageName || r.stageName || "—") + "" : cell("stage", r.stageName, "섹션", ro)) + "" + "" + taskCell + "" + + '' + titleCell + "" + '
    ' + acts + "
    "; }).join(""); } @@ -12413,10 +12418,10 @@ const all = await tasksOf(pid); const list = r.stageId ? all.filter(function (t) { return t.stage_id === r.stageId; }) : all; const set = function (t) { - r.parentTaskId = t ? t.id : null; r.parentTaskTitle = t ? t.title : ""; + r.parentTaskId = t ? t.id : null; r.parentTaskTitle = t ? t.title : ""; r.parentStageName = ""; if (t && t.stage_id) { const st = (stageCache[pid] || []).find(function (x) { return x.id === t.stage_id; }); - if (st) { r.stageId = st.id; r.stageName = st.name; } + if (st) { r.stageId = st.id; r.stageName = st.name; r.parentStageName = st.name; } } render(); persist(r, { parent_task_id: r.parentTaskId, stage_id: r.stageId }); }; @@ -12431,7 +12436,8 @@ function addSubRow(parent) { const b = blank(); Object.assign(b, { projectId: parent.projectId, projectName: parent.projectName, stageId: parent.stageId, - stageName: parent.stageName, parentTaskId: parent.taskId, parentTaskTitle: parent.title, subDraft: true }); + stageName: parent.stageName, parentTaskId: parent.taskId, parentTaskTitle: parent.title, subDraft: true, + parentStageName: parent.parentTaskId ? (parent.parentStageName || parent.stageName) : parent.stageName }); rows.push(b); render(); const inp = tbody.querySelector('tr[data-i="' + rows.indexOf(b) + '"] input[data-field="title"]'); if (inp) inp.focus(); @@ -12575,9 +12581,11 @@ tbody.addEventListener("keydown", function (e) { const inp = e.target.closest("input[data-field=title]"); if (inp && !inp.readOnly && e.key === "Enter" && !isImeEnter(e)) { + // 제목은 이제 맨 뒤 칸(2026-10-27) — Enter = 저장하고 [적용]으로(예전엔 다음 칸 담당자 목록을 열었다) e.preventDefault(); flushTitle(rowOf(inp)); - inp.closest("tr").querySelector('[data-pick="assignee"]').click(); + const ap = inp.closest("tr").querySelector('[data-quick="apply"]'); + if (ap) ap.focus(); } }); tbody.addEventListener("click", function (e) { diff --git a/tests/js/goals_meeting_ui.test.js b/tests/js/goals_meeting_ui.test.js index a612557..7f2178a 100644 --- a/tests/js/goals_meeting_ui.test.js +++ b/tests/js/goals_meeting_ui.test.js @@ -559,6 +559,7 @@ function meetServer(env, st) { return { id: r.id, title: r.title || "", assignee_email: r.assignee_email || "", project_id: r.project_id || null, project_name: r.project_name || "", stage_id: r.stage_id || null, stage_name: r.stage_name || "", task_id: r.task_id, parent_task_id: r.parent_task_id || null, parent_task_title: r.parent_task_id ? (r.parent_task_title || "상세페이지 리뉴얼") : "", + parent_stage_name: r.parent_task_id ? (r.parent_stage_name || "") : "", registered: r.task_id != null, visible: r.visible !== false, task_exists: true }; }; env.route("GET", /\/goals\/meetings\/([\d-]+)\/quick-tasks$/, function (u) { @@ -790,17 +791,20 @@ function meetServer(env, st) { await boot(env); await settle(); await wait(5); await settle(); const d = env.d; const row = function () { return d.querySelector("#pj-meet-quick tbody tr"); }; - check("[2g4] 표 머리에 '업무' 칸, 예전 ↳(줄 세부 작업) 버튼 없음", - Array.from(d.querySelectorAll("#pj-meet-quick thead th")).map(function (t) { return t.textContent; }).indexOf("업무") === 4 && - !d.querySelector('[data-quick="add-sub"]')); + // 열 = 담당자 · 프로젝트 · 섹션 · 업무 · 제목(2026-10-27 제목을 업무 오른쪽으로) + const heads = Array.from(d.querySelectorAll("#pj-meet-quick thead th")).map(function (t) { return t.textContent; }); + check("[2g4] 표 머리 = 담당자·프로젝트·섹션·업무·제목, 예전 ↳(줄 세부 작업) 버튼 없음", + heads.slice(0, 5).join("|") === "담당자|프로젝트|섹션|업무|제목" && !d.querySelector('[data-quick="add-sub"]') && + row().children[4].classList.contains("pj-meet-quick-title") && !!row().children[4].querySelector('input[data-field="title"]'), heads); row().querySelector('[data-pick="task"]').click(); await settle(); await wait(5); await settle(); const labels = Array.from(d.querySelectorAll(".pj-ctxmenu-item")).map(itemLabel); check("[2g4] 작업 칸 목록 = '새 업무(섹션에)' + 그 섹션의 진행 중 메인 작업만", labels[0] === "새 업무 (‘할 일’ 섹션에)" && labels.indexOf("상세페이지 리뉴얼") >= 0 && labels.indexOf("다른 섹션 작업") < 0 && labels.indexOf("끝난 작업") < 0 && labels.indexOf("이미 세부 작업") < 0, labels); Array.from(d.querySelectorAll(".pj-ctxmenu-item")).find(function (n) { return itemLabel(n) === "상세페이지 리뉴얼"; }).click(); await settle(); await wait(5); await settle(); - check("[2g4] 작업을 고르면 ↳ 표시·섹션 '—'·제목 칸 '세부 업무 제목'·서버 줄에 parent_task_id", - /↳ 상세페이지 리뉴얼/.test(row().querySelector('[data-pick="task"]').textContent) && /—/.test(row().children[3].textContent) && + check("[2g4] 작업을 고르면 ↳ 표시·섹션 = 그 업무의 섹션(할 일, 고칠 수 없음)·제목 칸 '세부 업무 제목'·서버 줄에 parent_task_id", + /↳ 상세페이지 리뉴얼/.test(row().querySelector('[data-pick="task"]').textContent) && + row().children[2].textContent.trim() === "할 일" && !row().children[2].querySelector('[data-pick="stage"]') && row().querySelector('input[data-field="title"]').placeholder === "세부 업무 제목" && q.rows[1].parent_task_id === 300, q.rows[1]); row().querySelector('[data-quick="apply"]').click(); await settle(); await wait(5); await settle(); check("[2g4] 적용 → 서버 [적용](고른 작업 밑 세부 작업)", q.applied.length === 1 && q.applied[0].parent_task_id === 300, q.applied); @@ -836,7 +840,8 @@ function meetServer(env, st) { const q = quickServer(env, { rows: [ { id: 1, title: "상위 업무", project_id: 7, project_name: "브랜드", stage_id: 71, stage_name: "할 일", task_id: 900 }, { id: 2, title: "다른 줄", project_id: 7, project_name: "브랜드", stage_id: 71, stage_name: "할 일" }, - { id: 3, title: "이미 세부", project_id: 7, project_name: "브랜드", task_id: 901, parent_task_id: 900, parent_task_title: "상위 업무" }] }); + { id: 3, title: "이미 세부", project_id: 7, project_name: "브랜드", task_id: 901, parent_task_id: 900, parent_task_title: "상위 업무", + parent_stage_name: "할 일" }] }); await boot(env); await settle(); await wait(5); await settle(); const d = env.d; const trs = function () { return Array.from(d.querySelectorAll("#pj-meet-quick tbody tr")); }; @@ -844,6 +849,8 @@ function meetServer(env, st) { check("[2g5] 세부 업무 줄은 상위 업무 줄 바로 아래(들여쓰기 is-sub)", titleOf(trs()[0]) === "상위 업무" && titleOf(trs()[1]) === "이미 세부" && trs()[1].classList.contains("is-sub") && titleOf(trs()[2]) === "다른 줄" && !trs()[0].classList.contains("is-sub"), trs().map(titleOf)); + check("[2g5] 세부 업무 줄의 섹션 = 상위 업무의 섹션(서버 parent_stage_name)", trs()[1].children[2].textContent.trim() === "할 일", + trs()[1].children[2].textContent); check("[2g5] 등록된 줄에만 [+](하위 업무 추가)", !!trs()[0].querySelector('[data-quick="add-sub"]') && !!trs()[1].querySelector('[data-quick="add-sub"]') && !trs()[2].querySelector('[data-quick="add-sub"]')); // 등록된 줄 — 제목이 아닌 칸(프로젝트 칸)을 눌러도 오른쪽 업무 창 @@ -864,8 +871,8 @@ function meetServer(env, st) { const calls = env.calls.length; trs()[0].querySelector('[data-quick="add-sub"]').click(); await settle(); const draft = trs()[2]; - check("[2g5] [+] → 상위 줄 아래 세부 업무 초안(↳ 상위 업무, 프로젝트 채움, 제목 칸 포커스, 요청 없음)", - draft.classList.contains("is-sub") && /↳ 상위 업무/.test(draft.textContent) && /브랜드/.test(draft.textContent) && + check("[2g5] [+] → 상위 줄 아래 세부 업무 초안(↳ 상위 업무, 프로젝트 채움, 섹션 = 상위 업무 섹션, 제목 칸 포커스, 요청 없음)", + draft.classList.contains("is-sub") && draft.children[2].textContent.trim() === "할 일" && /↳ 상위 업무/.test(draft.textContent) && /브랜드/.test(draft.textContent) && d.activeElement === draft.querySelector('input[data-field="title"]') && draft.querySelector("input").placeholder === "세부 업무 제목" && env.calls.length === calls, [trs().map(titleOf), env.calls.length - calls]); const inp = draft.querySelector('input[data-field="title"]'); diff --git a/tests/test_project_module.py b/tests/test_project_module.py index 1010281..439d0d8 100644 --- a/tests/test_project_module.py +++ b/tests/test_project_module.py @@ -1318,6 +1318,27 @@ def _clear_quick(*weeks) -> None: conn.execute("DELETE FROM goal_meeting_tasks WHERE week_start = ANY(%s)", (list(weeks),)) +def test_meeting_quick_task_parent_stage_name(): + """업무 등록 표 세부 업무 줄(2026-10-27) — 섹션 = 고른 업무의 섹션, 세부의 세부면 섹션 있는 맨 위 업무까지 올라감.""" + from app.modules.project import store + + w = store.month_weeks(2031, 11)[1][0] + _clear_quick(w) + p = _project("P-qpst", ADMIN, (BOB,)) + s = _stage(p["id"], name="기획", by=ADMIN) + top = ST.create_task(project_id=p["id"], title="상위", stage_id=s["id"], created_by=BOB) + sub = ST.create_task(project_id=p["id"], title="세부", parent_task_id=top["id"], created_by=BOB) + url = f"/project/api/goals/meetings/{w}/quick-tasks" + for parent in (top["id"], sub["id"]): + r = req("POST", url, BOB, json={"title": "새 세부", "project_id": p["id"], "parent_task_id": parent}) + assert r.status_code == 201, r.text + assert r.json()["task"]["parent_stage_name"] == "기획", r.json()["task"] + rows = req("GET", url, BOB).json()["tasks"] + assert [x["parent_stage_name"] for x in rows] == ["기획", "기획"], rows + assert all(x["parent_stage_name"] == "" for x in req("GET", url, ALICE).json()["tasks"]) # 남의 프로젝트 줄 = 가림 + _clear_quick(w) + + def test_review_meeting_quick_tasks_shared(): """작업 등록 표(025) — 주차별 한 표를 모두가 같이 본다. 남의 프로젝트 이름은 가리고, [적용]은 동시에 눌러도 작업 하나.""" from app.modules.project import store