Merge branch 'feat/meeting-quick-subtasks'

This commit is contained in:
2026-10-12 16:20:10 +09:00
17 changed files with 343 additions and 60 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
{% block head_extra %}
{# 프로젝트 화면 부품(설명 편집기·날짜 팝업·멤버 고르기)을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #}
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<script>window.PJ_LIB_ONLY = true; window.PJ_HOLIDAYS = {{ (pj_kr_holidays or {}) | tojson }};</script>
{% endblock %}
@@ -64,7 +64,7 @@
</section>
</div>
<script>window.NTC_PEOPLE = {{ people | tojson }};</script>
<script src="/static/project.js?v=20261012h" defer></script>
<script src="/static/project.js?v=20261012i" defer></script>
<script src="/static/erp-notice-admin.js?v=20261012b" defer></script>
{% endif %}
{% endblock %}
+30 -4
View File
@@ -3443,9 +3443,12 @@ class ProjectStore:
self._check_meeting_open(conn, week_start)
clean = self._mt_clean(conn, fields)
if parent_id is not None:
par = conn.execute("SELECT week_start FROM goal_meeting_tasks WHERE id = %s", (parent_id,)).fetchone()
par = conn.execute("SELECT week_start, parent_id FROM goal_meeting_tasks WHERE id = %s",
(parent_id,)).fetchone()
if par is None or par["week_start"] != week_start:
raise ValueError("위 줄이 이 주차 표에 없습니다.")
if par["parent_id"] is not None:
raise ValueError("세부 작업 줄 밑으로는 넣을 수 없습니다(한 단계만).")
nxt = conn.execute("SELECT COALESCE(MAX(sort_order), -1) + 1 AS n FROM goal_meeting_tasks "
"WHERE week_start = %s", (week_start,)).fetchone()["n"]
return int(conn.execute(
@@ -3470,6 +3473,25 @@ class ProjectStore:
if row["task_id"] is not None:
raise store.GoalCellConflict("이미 [적용]해 작업으로 만든 줄입니다. 새로고침해 주세요.")
clean = self._mt_clean(conn, fields, project_id=row["project_id"])
if "parent_id" in fields:
# 세부 작업 줄로(Tab)·위 단계로(Shift+Tab) — 한 단계만: 위 줄은 같은 주차의 맨 위 단계 줄,
# 자기 밑에 세부 작업 줄이 있는 줄은 세부 작업 줄이 될 수 없다.
raw = fields.get("parent_id")
try:
pid = int(raw) if raw not in (None, "") else None
except (TypeError, ValueError):
raise ValueError("위 줄 값이 올바르지 않습니다.")
if pid is not None:
par = conn.execute("SELECT week_start, parent_id FROM goal_meeting_tasks WHERE id = %s",
(pid,)).fetchone()
if pid == item_id or par is None or par["week_start"] != row["week_start"]:
raise ValueError("위 줄이 이 주차 표에 없습니다.")
if par["parent_id"] is not None:
raise ValueError("세부 작업 줄 밑으로는 넣을 수 없습니다(한 단계만).")
if conn.execute("SELECT 1 FROM goal_meeting_tasks WHERE parent_id = %s LIMIT 1",
(item_id,)).fetchone():
raise ValueError("세부 작업 줄이 딸린 줄은 세부 작업이 될 수 없습니다.")
clean["parent_id"] = pid
if not clean:
return
sets = ", ".join(f"{k} = %s" for k in clean)
@@ -3506,12 +3528,16 @@ class ProjectStore:
if row["task_id"] is not None:
return item_id, False
parent_task = None
use = self._mt_row(row)
if row["parent_id"] is not None:
par = conn.execute("SELECT task_id FROM goal_meeting_tasks WHERE id = %s", (row["parent_id"],)).fetchone()
# 세부 작업 줄 — 위 줄이 만든 작업 밑에, 그 작업의 프로젝트로(줄의 프로젝트 칸은 쓰지 않는다)
par = conn.execute("SELECT m.task_id, t.project_id FROM goal_meeting_tasks m "
"LEFT JOIN tasks t ON t.id = m.task_id WHERE m.id = %s", (row["parent_id"],)).fetchone()
parent_task = par["task_id"] if par else None
if parent_task is None:
if parent_task is None or par["project_id"] is None:
raise ValueError("위 줄(상위 작업)을 먼저 [적용]하세요.")
task = create(self._mt_row(row), parent_task)
use = {**use, "project_id": int(par["project_id"]), "stage_id": None}
task = create(use, parent_task)
conn.execute("UPDATE goal_meeting_tasks SET task_id = %s, updated_at = now() WHERE id = %s",
(int(task["id"]), item_id))
return item_id, True
+4 -1
View File
@@ -3820,7 +3820,10 @@ def api_add_quick_task(request: Request, week_start: str, payload: dict[str, Any
def api_update_quick_task(request: Request, item_id: int, payload: dict[str, Any] = Body(...)) -> JSONResponse:
user = _require_user(request)
st = _db_or_503(request)
row = _goal_call(st.update_meeting_task, item_id=item_id, fields=_quick_fields(st, user, payload), by=user["email"])
fields = _quick_fields(st, user, payload)
if "parent_id" in payload: # 세부 작업 줄로(Tab)·위 단계로(Shift+Tab) — 한 단계만(저장소가 검사)
fields["parent_id"] = payload["parent_id"]
row = _goal_call(st.update_meeting_task, item_id=item_id, fields=fields, by=user["email"])
return JSONResponse({"task": _quick_view(st, user, [row])[0]})
@@ -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=20261012d" />
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -119,7 +119,8 @@
{# 작업 등록 — 주차마다 한 표를 서버에(025, 모두가 같은 표 — project.js initMeetQuickTasks). 제목 = "N주차 작업 등록", 회의 완료면 읽기 전용 #}
{% set qw = weeks | selectattr("start", "equalto", week) | first %}
<section class="pj-meet-area pj-meet-quick" id="pj-meet-quick" data-week="{{ week }}"{% if qw and qw.now %} data-now="1"{% endif %}{% if meeting and meeting.completed %} data-locked="1"{% endif %}>
<h3>{% if week_n %}<span class="pj-meet-quick-week">{{ week_n }}주차</span> {% endif %}작업 등록 <small>제목을 쓰고 담당자·프로젝트·섹션 칸을 눌러 고른 뒤 [적용]</small></h3>
<h3>{% if week_n %}<span class="pj-meet-quick-week">{{ week_n }}주차</span> {% endif %}작업 등록 <small>제목 → 담당자·프로젝트·섹션 → [적용] · ↳ 또는 Tab = 세부 작업</small>
<button type="button" class="pj-btn pj-btn-sm pj-meet-quick-expand" data-quick="expand" title="넓은 창에서 작업·세부 작업 등록(같은 표)"><span class="material-symbols-outlined">open_in_full</span>크게 열기</button></h3>
<div class="pj-meet-area-body">
<table class="pj-meet-quick-table">
<thead><tr><th>제목</th><th>담당자</th><th>프로젝트</th><th>섹션</th><th></th></tr></thead>
@@ -294,5 +295,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=20261012h" defer></script>
<script src="/static/project.js?v=20261012i" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% 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=20261012h" defer></script>
<script src="/static/project.js?v=20261012i" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -636,7 +636,9 @@
<h3 id="meetings-kpis">위쪽 3칸 — 월 계획·숫자, 결정 사항, 작업 등록</h3>
<p>제목 아래 세 칸은 표를 스크롤해도 그대로 보입니다. 왼쪽은 <b>월 계획</b>이고 그 머리 줄 오른쪽에 숫자 4개(월 목표 · 누적 목표 · 누적 실적 · 목표 대비)가 작게 한 줄로 나옵니다(목표 표 매출 단위, 예: 백만원 — 숫자에 마우스를 올리면 원 단위 금액과 뜻). 가운데는 <b>결정사항</b>(진행상황 수시 공유 및 완료 되어야 할 것), 오른쪽은 <b>작업 등록</b> 표입니다.</p>
<ol class="pjh-steps">
<li><b>작업 등록</b>(제목에 <b>N주차 작업 등록</b>) — 주차마다 한 표를 <b>모두가 같이</b> 봅니다(다른 사람이 적거나 등록한 줄도 보임, 30초마다·창을 다시 볼 때 새로 읽음). 내가 멤버가 아닌 프로젝트를 고른 남의 줄은 프로젝트 이름을 가립니다. 회의 완료면 읽기 전용입니다. 제목 칸에 작업 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다(완료 프로젝트·완료 섹션은 목록에 나오지 않습니다). 목록 맨 위 <span class="pjh-ui">새 프로젝트</span>(Pro user 이상)·<span class="pjh-ui">새 섹션</span>(그 프로젝트 멤버)을 누르면 이름만 적어 바로 만들고 그 칸에 골라집니다. 새 프로젝트는 섹션 없이 시작하니 섹션 칸에서 <span class="pjh-ui">새 섹션</span>을 만들어 고르세요.</li>
<li><b>작업 등록</b>(제목에 <b>N주차 작업 등록</b>) — 주차마다 한 표를 <b>모두가 같이</b> 봅니다(다른 사람이 적거나 등록한 줄도 보임, 30초마다·창을 다시 볼 때 새로 읽음). 내가 멤버가 아닌 프로젝트를 고른 남의 줄은 프로젝트 이름을 가립니다. 회의 완료면 읽기 전용입니다.
<b>세부 작업</b> — 줄에 마우스를 올리면 나오는 <span class="pjh-ui">↳</span>(또는 우클릭 → 세부 작업 추가)로 바로 아래에 세부 작업 줄을 만듭니다. 제목 칸에서 <kbd>Tab</kbd> = 위 줄의 세부 작업으로, <kbd>Shift</kbd>+<kbd>Tab</kbd> = 다시 위 단계로(한 단계만). 세부 작업 줄은 위 줄의 프로젝트를 따르고 섹션이 없으며, 위 줄을 [적용]한 뒤 [적용]하면 그 작업의 세부 작업이 됩니다.
<span class="pjh-ui">크게 열기</span> — 같은 표를 넓은 창으로 열어 씁니다(줄·저장은 그대로, <kbd>Esc</kbd>·×로 닫기). 제목 칸에 작업 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다(완료 프로젝트·완료 섹션은 목록에 나오지 않습니다). 목록 맨 위 <span class="pjh-ui">새 프로젝트</span>(Pro user 이상)·<span class="pjh-ui">새 섹션</span>(그 프로젝트 멤버)을 누르면 이름만 적어 바로 만들고 그 칸에 골라집니다. 새 프로젝트는 섹션 없이 시작하니 섹션 칸에서 <span class="pjh-ui">새 섹션</span>을 만들어 고르세요.</li>
<li>프로젝트는 내가 멤버인 프로젝트만 나오고, 고르면 첫 섹션이 자동으로 들어갑니다. 담당자는 그 프로젝트의 멤버·소유자 중에서 고릅니다(프로젝트를 먼저 고르면 정확합니다).</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>
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -101,5 +101,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261012h" defer></script>
<script src="/static/project.js?v=20261012i" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -100,5 +100,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20261012h" defer></script>
<script src="/static/project.js?v=20261012i" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -108,5 +108,5 @@
});
})();
</script>
<script src="/static/project.js?v=20261012h" defer></script>
<script src="/static/project.js?v=20261012i" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -468,5 +468,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261012h" defer></script>
<script src="/static/project.js?v=20261012i" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -70,5 +70,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261012h" defer></script>
<script src="/static/project.js?v=20261012i" defer></script>
{% endblock %}
+24
View File
@@ -3057,3 +3057,27 @@ html[data-pj-font="nanum-square-round"] { --pj-font: "NanumSquareRound", var(--p
/* 회의록 작업 등록 — 제목 앞 주차(N주차 작업 등록, 주차마다 따로 기억) */
.pj-meet-quick-week { color: var(--pj-accent); }
.pj-meet-quick-note { padding: 10px 8px; color: #8a9099; font-size: 12.5px; }
/* 작업 등록 — 세부 작업 줄(↳ 들여쓰기)·줄 위 ↳ 추가 버튼·[크게 열기] 창(같은 표를 옮겨 쓴다) */
.pj-meet-quick h3 { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pj-meet-quick-expand { margin-left: auto; order: 2; display: inline-flex; align-items: center; gap: 3px; }
.pj-meet-quick h3 small { order: 3; flex-basis: 100%; margin-left: 0; } /* 한 줄: 제목 + [크게 열기], 그 아래 안내 */
.pj-meet-quick-expand .material-symbols-outlined { font-size: 15px; }
.pj-meet-quick-title { position: relative; }
.pj-meet-quick-table tr.is-sub .pj-meet-quick-title { padding-left: 20px; }
.pj-meet-quick-submark { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); color: #9aa1a9; font-size: 13px; pointer-events: none; }
.pj-meet-quick-addsub {
position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; padding: 0;
display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--pj-border, #e3e5e8); border-radius: 5px;
background: #fff; color: var(--pj-ink-soft); cursor: pointer; opacity: 0; transition: opacity .12s;
}
.pj-meet-quick-addsub .material-symbols-outlined { font-size: 15px; }
.pj-meet-quick-table tr:hover .pj-meet-quick-addsub, .pj-meet-quick-addsub:focus { opacity: 1; }
.pj-meet-quick-inherit { display: block; padding: 0 4px; color: #9aa1a9; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.pj-meet-quick-modal { position: fixed; inset: 0; z-index: 2100; /* 고르기 메뉴(.pj-ctxmenu 2200)가 그 위에 */ display: flex; align-items: center; justify-content: center;
padding: 16px; box-sizing: border-box; background: rgba(15, 17, 21, .4); }
.pj-meet-quick-modal-card { width: min(1100px, 96vw); max-height: 88vh; overflow: auto; box-sizing: border-box; padding: 14px 18px 18px;
border-radius: 12px; background: #fff; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
.pj-meet-quick-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pj-meet-quick-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.pj-meet-quick-modal .pj-meet-quick-table { font-size: 14px; }
.pj-meet-quick-modal .pj-meet-quick-table th { font-size: 13px; padding: 6px 8px; }
+176 -34
View File
@@ -10667,6 +10667,9 @@
// · 등록된 줄의 [삭제] = 확인 뒤 그 작업도 삭제(휴지통 3개월), 적용 전 줄의 × = 줄만 지움.
// · 30초마다·창을 다시 볼 때 다시 읽는다(입력 중·저장 중엔 건너뜀). 회의 완료면 읽기 전용.
// · 이 브라우저에 남은 예전 표(pj_meet_quick:…)는 처음 열 때 서버로 한 번 옮기고 지운다.
// · 세부 작업 줄(한 단계, 서버 parent_id) — ↳ 버튼·우클릭으로 추가, 제목 칸 Tab = 위 줄의 세부 작업으로, Shift+Tab = 위 단계로.
// 프로젝트는 위 줄을 따르고 섹션은 없다. [적용]은 위 줄이 먼저(서버가 위 줄 작업 밑에 세부 작업으로 만든다).
// · [크게 열기] — 같은 표를 넓은 창으로 옮겨 쓴다(줄·저장 그대로), 닫으면 제자리.
function initMeetQuickTasks() {
const box = el("pj-meet-quick");
if (!box) return;
@@ -10690,22 +10693,37 @@
return url ? '<img class="pj-avatar pj-meet-quick-face" src="' + escapeHtml(url) + '" alt="" referrerpolicy="no-referrer">'
: '<span class="pj-meet-quick-face is-ini">' + escapeHtml(nameOf(email).slice(0, 1)) + "</span>";
};
const blank = function () {
const blank = function (parent) {
return { id: null, title: "", assignee: "", projectId: null, projectName: "", stageId: null, stageName: "",
taskId: null, registered: false, visible: true, taskExists: true, chain: null };
taskId: null, registered: false, visible: true, taskExists: true, chain: null,
parentId: parent && parent.id ? parent.id : null, parentRef: parent || null };
};
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 || "", taskId: t.task_id,
registered: !!t.registered, visible: t.visible !== false, taskExists: t.task_exists !== false, chain: null };
registered: !!t.registered, visible: t.visible !== false, taskExists: t.task_exists !== false, chain: null,
parentId: t.parent_id || null, parentRef: null };
}
let rows = [];
let ready = false, unavailable = "";
// 세부 작업 줄(한 단계) — 위 줄 = parentRef(아직 서버에 없는 줄) 또는 parentId
function parentOf(r) {
if (r.parentRef && rows.indexOf(r.parentRef) >= 0) return r.parentRef;
if (r.parentId) return rows.find(function (x) { return x.id === r.parentId; }) || null;
return null;
}
function childrenOf(p) { return rows.filter(function (x) { return parentOf(x) === p; }); }
// 화면 순서 = 맨 위 단계 줄(지금 순서) 바로 뒤에 그 세부 작업 줄들
function reorder() {
const tops = rows.filter(function (r) { return !parentOf(r); });
const out = [];
tops.forEach(function (t) { out.push(t); childrenOf(t).forEach(function (c) { out.push(c); }); });
rows = out;
}
function padBlank() {
if (locked) return;
const open = rows.filter(function (r) { return !r.registered; }).length;
const open = rows.filter(function (r) { return !r.registered && !parentOf(r); }).length;
for (let i = open; i < 3; i++) rows.push(blank());
if (!rows.some(function (r) { return !r.registered; })) rows.push(blank());
}
let projects = null;
@@ -10733,28 +10751,35 @@
return stageCache[pid];
}
// ── 저장 — 줄마다 차례대로. 서버에 없는 줄은 처음 채울 때 만든다(지금 칸 전부를 보낸다) ──
// ── 저장 — 줄마다 차례대로. 서버에 없는 줄은 처음 채울 때 만든다(지금 칸 전부 + 위 줄을 보낸다 — 위 줄도 없으면 먼저) ──
let pendingSaves = 0;
function persist(r, patch) {
pendingSaves++;
const run = async function () {
const par = parentOf(r);
if (par && !par.id) await persist(par, {});
if (par && !par.id) throw new Error("위 줄을 저장하지 못했습니다");
if (!r.id) {
const res = await api("POST", listUrl, {
title: r.title, assignee_email: r.assignee, project_id: r.projectId, stage_id: r.stageId,
title: r.title, assignee_email: r.assignee, project_id: par ? null : r.projectId,
stage_id: par ? null : r.stageId, parent_id: par ? par.id : null,
});
r.id = res.task.id;
r.parentId = par ? par.id : null; r.parentRef = null;
} else {
if (patch && Object.prototype.hasOwnProperty.call(patch, "parent_id") && patch.parent_id === undefined) patch.parent_id = par ? par.id : null;
await api("PUT", rowUrl(r.id), patch);
if (patch && Object.prototype.hasOwnProperty.call(patch, "parent_id")) { r.parentId = patch.parent_id; r.parentRef = null; }
}
};
r.chain = (r.chain || Promise.resolve()).then(run).catch(function (e) {
showToast("작업 등록 표 저장 실패: " + e.message, "error");
if (e.status === 409) setTimeout(function () { load(true); }, 0); // 회의 완료·다른 사람이 [적용]함 — 서버 상태로
if (e.status === 409 || e.status === 400) setTimeout(function () { load(true); }, 0); // 서버 상태로 되돌림
}).finally(function () { pendingSaves--; });
return r.chain;
}
function cell(kind, text, placeholder, disabled) {
return '<button type="button" class="pj-meet-pick-cell' + (text ? "" : " is-empty") + '" data-pick="' + kind + '"' +
function cell(kind, text, placeholder, disabled, extra) {
return '<button type="button" class="pj-meet-pick-cell' + (text ? "" : " is-empty") + (extra || "") + '" data-pick="' + kind + '"' +
(disabled ? " disabled" : "") + ">" + escapeHtml(text || placeholder) + "</button>";
}
function render() {
@@ -10762,7 +10787,9 @@
tbody.innerHTML = '<tr><td colspan="5" class="pj-meet-quick-note">' + escapeHtml(unavailable) + "</td></tr>";
return;
}
reorder();
tbody.innerHTML = rows.map(function (r, i) {
const par = parentOf(r);
const ro = locked || r.registered;
let acts;
if (r.registered) {
@@ -10777,22 +10804,38 @@
} else if (locked) {
acts = "";
} else {
acts = '<button type="button" class="pj-meet-quick-apply" data-quick="apply">적용</button>' +
const wait = par && !par.registered;
acts = '<button type="button" class="pj-meet-quick-apply" data-quick="apply"' +
(wait ? ' disabled title="위 줄(상위 작업)을 먼저 [적용]하세요"' : "") + ">적용</button>" +
'<button type="button" class="pj-meet-quick-del" data-quick="remove" title="이 줄 지우기(아직 등록 전)">' +
'<span class="material-symbols-outlined">close</span></button>';
}
return '<tr data-i="' + i + '"' + (r.registered ? ' class="is-done"' : "") + ">" +
'<td><input type="text" data-field="title" maxlength="200" placeholder="작업 제목" value="' + escapeHtml(r.title) + '"' +
(ro ? " readonly" : "") + "></td>" +
// 세부 작업 줄 — ↳ 들여쓰기, 프로젝트는 위 줄을 따르고 섹션은 없다(작업의 세부 작업)
const projCell = par
? '<span class="pj-meet-quick-inherit" title="위 줄의 프로젝트를 따릅니다">' + escapeHtml(par.projectName || "위 줄 따름") + "</span>"
: cell("project", r.projectName, "프로젝트", ro);
const stageCell = par ? '<span class="pj-meet-quick-inherit" title="세부 작업은 섹션이 없습니다">—</span>' : cell("stage", r.stageName, "섹션", ro);
const addSub = !par && !locked && r.visible
? '<button type="button" class="pj-meet-quick-addsub" data-quick="add-sub" title="세부 작업 추가(제목 칸에서 Tab = 위 줄의 세부 작업으로)">' +
'<span class="material-symbols-outlined">subdirectory_arrow_right</span></button>' : "";
return '<tr data-i="' + i + '" class="' + (r.registered ? "is-done " : "") + (par ? "is-sub" : "") + '">' +
'<td class="pj-meet-quick-title">' + (par ? '<span class="pj-meet-quick-submark" aria-hidden="true">↳</span>' : "") +
'<input type="text" data-field="title" maxlength="200" placeholder="' + (par ? "세부 작업 제목" : "작업 제목") + '" value="' + escapeHtml(r.title) + '"' +
(ro ? " readonly" : "") + ">" + addSub + "</td>" +
"<td>" + (r.assignee
? '<button type="button" class="pj-meet-pick-cell is-person" data-pick="assignee"' + (ro ? " disabled" : "") + ">" +
faceHtml(r.assignee) + "<span>" + escapeHtml(nameOf(r.assignee)) + "</span></button>"
: cell("assignee", "", "담당자", ro)) + "</td>" +
"<td>" + cell("project", r.projectName, "프로젝트", ro) + "</td>" +
"<td>" + cell("stage", r.stageName, "섹션", ro) + "</td>" +
"<td>" + projCell + "</td>" +
"<td>" + stageCell + "</td>" +
'<td class="pj-meet-quick-acts">' + acts + "</td></tr>";
}).join("");
}
function focusTitle(r) {
const i = rows.indexOf(r);
const inp = i >= 0 ? tbody.querySelector('tr[data-i="' + i + '"] input[data-field="title"]') : null;
if (inp) { inp.focus(); try { inp.setSelectionRange(inp.value.length, inp.value.length); } catch (_) {} }
}
function menuAt(btn, items) {
const r = btn.getBoundingClientRect();
showContextMenu(r.left, r.bottom + 2, items.length ? items : [{ label: "고를 항목이 없습니다", onClick: function () {} }]);
@@ -10836,8 +10879,9 @@
})));
}
async function pickAssignee(r, btn) {
// 프로젝트를 골랐으면 그 프로젝트 멤버·소유자만(작업을 볼 수 있는 사람), 아니면 프로젝트 권한이 있는 전체 직원
const emails = r.projectId ? await membersOf(r.projectId)
// 프로젝트(세부 작업 줄은 위 줄의 프로젝트)를 골랐으면 그 멤버·소유자만, 아니면 프로젝트 권한이 있는 전체 직원
const par = parentOf(r), pid = par ? par.projectId : r.projectId;
const emails = pid ? await membersOf(pid)
: (window.PJ_MEET_MEMBERS || []).map(function (m) { return String(m.email).toLowerCase(); });
const set = function (e) { r.assignee = e; render(); persist(r, { assignee_email: e }); };
menuAt(btn, [{ label: "담당자 없음", icon: menuIcon("person_off"), checked: !r.assignee, onClick: function () { set(""); } }, null]
@@ -10866,10 +10910,49 @@
return { label: st.name, icon: menuIcon("view_column"), checked: r.stageId === st.id, onClick: function () { set(st); } };
})));
}
// ── 세부 작업 줄 — 추가(↳ 버튼·우클릭), 세부 작업으로(Tab)·위 단계로(Shift+Tab). 한 단계만 ──
function addSub(p) {
if (locked) return;
const kids = childrenOf(p);
const at = rows.indexOf(kids.length ? kids[kids.length - 1] : p);
const c = blank(p);
rows.splice(at + 1, 0, c);
render();
focusTitle(c);
}
function canIndent(r) {
if (locked || r.registered || parentOf(r) || childrenOf(r).length) return null;
const i = rows.indexOf(r);
for (let k = i - 1; k >= 0; k--) { if (!parentOf(rows[k])) return rows[k].visible ? rows[k] : null; }
return null;
}
function indent(r) {
const p = canIndent(r);
if (!p) return false;
r.parentRef = p; r.parentId = p.id || null;
render(); focusTitle(r);
if (r.id || r.title || r.assignee) persist(r, { parent_id: undefined });
return true;
}
function outdent(r) {
const p = parentOf(r);
if (locked || r.registered || !p) return false;
const kids = childrenOf(p);
rows.splice(rows.indexOf(r), 1);
r.parentRef = null; r.parentId = null;
rows.splice(rows.indexOf(kids[kids.length - 1] === r ? p : kids[kids.length - 1]) + 1, 0, r);
render(); focusTitle(r);
if (r.id) persist(r, { parent_id: null });
return true;
}
async function apply(r, btn) {
flushTitle(r);
const par = parentOf(r);
if (!r.title.trim()) { showToast("작업 제목을 쓰세요."); return; }
if (!r.projectId) { showToast("프로젝트를 고르세요."); return; }
if (par && !par.registered) { showToast("위 줄(상위 작업)을 먼저 [적용]하세요."); return; }
if (!par && !r.projectId) { showToast("프로젝트를 고르세요."); return; }
btn.disabled = true;
try {
await r.chain;
@@ -10877,31 +10960,34 @@
if (!r.id) throw new Error("줄을 저장하지 못했습니다");
const res = await api("POST", rowUrl(r.id) + "/apply", {});
Object.assign(r, fromServer(res.task));
showToast(res.created ? "‘" + r.projectName + "’에 작업을 등록했습니다." : "이미 등록된 줄입니다(다른 사람이 먼저 [적용]했습니다).");
showToast(res.created ? "‘" + ((par ? par.projectName : r.projectName) || "프로젝트") + "’에 " + (par ? "세부 작업을" : "작업을") + " 등록했습니다."
: "이미 등록된 줄입니다(다른 사람이 먼저 [적용]했습니다).");
padBlank(); render();
} catch (e) {
btn.disabled = false;
showToast("작업 등록 실패: " + e.message, "error");
}
}
// 등록된 작업 삭제 — 프로젝트에서도 지운다(휴지통). 이미 없으면(다른 곳에서 삭제) 줄만 지운다.
// 등록된 작업 삭제 — 프로젝트에서도 지운다(휴지통, 세부 작업 포함). 이미 없으면(다른 곳에서 삭제) 줄만 지운다.
async function removeTask(r, btn) {
if (r.taskExists && !(await confirm("‘" + (r.title || "작업") + "’ 작업을 ‘" + (r.projectName || "프로젝트") + "’에서도 삭제할까요? 삭제한 작업은 휴지통에 3개월 보관됩니다.",
if (r.taskExists && !(await confirm("‘" + (r.title || "작업") + "’ 작업을 프로젝트에서도 삭제할까요? 세부 작업도 함께, 휴지통에 3개월 보관됩니다.",
{ okText: "삭제", cancelText: "취소" }))) return;
btn.disabled = true;
if (r.taskId && r.taskExists) {
try { await api("DELETE", "/project/api/tasks/" + r.taskId); showToast("작업을 삭제했습니다."); }
catch (e) { if (e.status !== 404) { btn.disabled = false; showToast("작업 삭제 실패: " + e.message, "error"); return; } }
}
dropRow(r);
dropRow(r, true);
}
async function dropRow(r) {
async function dropRow(r, asked) {
const kids = childrenOf(r);
if (!asked && kids.length && !(await confirm("세부 작업 줄 " + kids.length + "개도 함께 지울까요? (이미 [적용]해 만든 작업은 프로젝트에 남습니다)",
{ okText: "지우기", cancelText: "취소" }))) return;
try {
await r.chain;
if (r.id) await api("DELETE", rowUrl(r.id));
if (r.id) await api("DELETE", rowUrl(r.id)); // 서버는 세부 작업 줄도 함께 지운다(CASCADE)
} catch (e) { if (e.status !== 404) { showToast("줄을 지우지 못했습니다: " + e.message, "error"); return; } }
const i = rows.indexOf(r);
if (i >= 0) rows.splice(i, 1);
rows = rows.filter(function (x) { return x !== r && kids.indexOf(x) < 0; });
padBlank(); render();
}
// 제목 — 치는 동안 0.6초 멈추면, 칸을 떠나면 저장
@@ -10912,23 +10998,32 @@
clearTimeout(t); titleTimers.delete(r);
persist(r, { title: r.title });
}
const rowOf = function (node) { const tr = node.closest("tr"); return tr && tr.dataset.i != null ? rows[+tr.dataset.i] : null; };
tbody.addEventListener("input", function (e) {
const inp = e.target.closest("input[data-field=title]");
if (!inp || inp.readOnly) return;
const r = rows[+inp.closest("tr").dataset.i];
const r = rowOf(inp);
r.title = inp.value;
clearTimeout(titleTimers.get(r));
titleTimers.set(r, setTimeout(function () { titleTimers.delete(r); persist(r, { title: r.title }); }, 600));
});
tbody.addEventListener("focusout", function (e) {
const inp = e.target.closest("input[data-field=title]");
if (inp) flushTitle(rows[+inp.closest("tr").dataset.i]);
if (inp) { const r = rowOf(inp); if (r) flushTitle(r); }
});
tbody.addEventListener("keydown", function (e) {
const inp = e.target.closest("input[data-field=title]");
if (inp && !inp.readOnly && e.key === "Enter" && !isImeEnter(e)) {
if (!inp || inp.readOnly || isImeEnter(e)) return;
const r = rowOf(inp);
if (e.key === "Tab") {
// 아사나처럼 — Tab = 위 줄의 세부 작업으로, Shift+Tab = 위 단계로. 할 수 없으면 원래 Tab(다음 칸)
flushTitle(r);
if (e.shiftKey ? outdent(r) : indent(r)) e.preventDefault();
return;
}
if (e.key === "Enter") {
e.preventDefault();
flushTitle(rows[+inp.closest("tr").dataset.i]);
flushTitle(r);
inp.closest("tr").querySelector('[data-pick="assignee"]').click();
}
});
@@ -10938,6 +11033,7 @@
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 (e.target.closest('[data-quick="add-sub"]')) { addSub(r); return; }
if (r.registered || locked) return;
const fail = function (err) { showToast("목록을 읽지 못했습니다: " + err.message, "error"); };
if (pick) {
@@ -10945,12 +11041,58 @@
({ project: pickProject, assignee: pickAssignee, stage: pickStage })[pick.dataset.pick](r, pick).catch(fail);
} else if (e.target.closest('[data-quick="apply"]')) apply(r, e.target.closest('[data-quick="apply"]'));
});
// 우클릭 — 세부 작업 추가 · 세부 작업으로 · 위 단계로 · 줄 지우기
tbody.addEventListener("contextmenu", function (e) {
const r = rowOf(e.target);
if (!r || locked) return;
e.preventDefault();
const par = parentOf(r);
const items = [];
if (!par && r.visible) items.push({ label: "세부 작업 추가", icon: menuIcon("subdirectory_arrow_right"), onClick: function () { addSub(r); } });
if (canIndent(r)) items.push({ label: "위 줄의 세부 작업으로 (Tab)", icon: menuIcon("format_indent_increase"), onClick: function () { indent(r); } });
if (par && !r.registered) items.push({ label: "위 단계로 (Shift+Tab)", icon: menuIcon("format_indent_decrease"), onClick: function () { outdent(r); } });
if (!r.registered) { if (items.length) items.push(null); items.push({ label: "줄 지우기", danger: true, icon: menuIcon("close"), onClick: function () { dropRow(r); } }); }
if (items.length) showContextMenu(e.clientX, e.clientY, items);
});
const addBtn = box.querySelector('[data-quick="add"]');
if (addBtn) {
if (locked) addBtn.hidden = true;
else addBtn.addEventListener("click", function () { rows.push(blank()); render(); });
else addBtn.addEventListener("click", function () { const b = blank(); rows.push(b); render(); focusTitle(b); });
}
// ── 크게 열기 — 같은 표(같은 줄·같은 저장)를 넓은 창으로 옮겨 쓴다. 닫으면 제자리로 ──
const area = box.querySelector(".pj-meet-area-body");
const expandBtn = box.querySelector('[data-quick="expand"]');
let modal = null;
function closeBig() {
if (!modal) return;
box.appendChild(area);
modal.remove(); modal = null;
document.removeEventListener("keydown", onBigKey, true);
if (expandBtn) expandBtn.focus();
}
function onBigKey(e) {
if (e.key === "Escape" && modal && !document.querySelector(".pj-ctxmenu, .pj-modal:not([hidden])")) { e.preventDefault(); closeBig(); }
}
function openBig() {
if (modal) return;
modal = document.createElement("div");
modal.className = "pj-meet-quick-modal";
modal.innerHTML = '<div class="pj-meet-quick-modal-card" role="dialog" aria-modal="true" aria-label="작업 등록 크게 보기">' +
'<div class="pj-meet-quick-modal-head"><h3></h3><button type="button" class="pj-icon-btn" data-quick="close-big" title="닫기 (Esc)">' +
'<span class="material-symbols-outlined">close</span></button></div></div>';
const wk = box.querySelector(".pj-meet-quick-week");
modal.querySelector("h3").textContent = (wk ? wk.textContent + " " : "") + "작업 등록";
modal.querySelector(".pj-meet-quick-modal-card").appendChild(area);
document.body.appendChild(modal); // 화면 배율(.pj-ui-scale) 밖 — body 에
modal.addEventListener("mousedown", function (e) { if (e.target === modal) closeBig(); });
modal.querySelector('[data-quick="close-big"]').addEventListener("click", closeBig);
document.addEventListener("keydown", onBigKey, true);
const first = area.querySelector('input[data-field="title"]:not([readonly])');
if (first) first.focus();
}
if (expandBtn) expandBtn.addEventListener("click", openBig);
// ── 읽기 — 처음·30초마다·창을 다시 볼 때. 입력 중(제목 칸 포커스·저장 대기)이면 건너뛴다 ──
function busy() {
return titleTimers.size > 0 || pendingSaves > 0 || (document.activeElement && tbody.contains(document.activeElement));
@@ -10959,7 +11101,7 @@
if (!force && busy()) return;
try {
const res = await api("GET", listUrl);
const blanks = rows.filter(function (r) { return !r.id && !r.title && !r.projectId && !r.assignee; }).length;
const blanks = rows.filter(function (r) { return !r.id && !parentOf(r) && !r.title && !r.projectId && !r.assignee; }).length;
rows = (res.tasks || []).map(fromServer);
for (let i = 0; i < blanks; i++) rows.push(blank());
padBlank();
@@ -11003,7 +11145,7 @@
})();
setInterval(function () { if (!document.hidden && ready) load(false); }, 30000);
document.addEventListener("visibilitychange", function () { if (!document.hidden && ready) load(false); });
if (window.__PJ_TEST__) window.__pjMeetQuick = { load: load, rows: function () { return rows; } };
if (window.__PJ_TEST__) window.__pjMeetQuick = { load: load, rows: function () { return rows; }, openBig: openBig, closeBig: closeBig };
}
function initGoalMeeting() {
+5 -1
View File
@@ -1206,7 +1206,11 @@ Windows 트레이 프로그램 **DBX 알림**(`desktop/notifier/`, C# .NET Frame
`POST …/{id}/apply`(줄을 FOR UPDATE 로 잠그고 task_id 가 없을 때만 `_create_task_for` — 작업 창과 같은 권한·알림, 동시에 눌러도 하나).
보기·고치기 = 회의록을 볼 수 있는 사람 누구나(회의 완료면 409), 줄에 고를 수 있는 프로젝트 = 내가 멤버인 것만(403),
내가 멤버가 아닌 프로젝트를 가리키는 남의 줄은 프로젝트·섹션 이름·작업 링크를 가린다(`registered` 만). [적용] 뒤 줄은 고칠 수 없다.
`parent_id` = 세부 작업 줄(위 줄의 작업 밑, 섹션 없이 — 서버는 준비됨, 화면은 다음 단계). 화면은 빈 줄 3개를 화면에만 두고
**세부 작업 줄**(`parent_id`, 한 단계만): ↳ 버튼·우클릭 → 바로 아래 세부 작업 줄, 제목 칸 Tab = 위 줄의 세부 작업으로 · Shift+Tab = 위 단계로
(`PUT … {parent_id}` — 세부 작업 줄 밑·자식 딸린 줄은 400). 세부 작업 줄은 위 줄의 프로젝트를 따르고 섹션이 없다 — [적용]은 위 줄이 먼저,
서버가 위 줄이 만든 작업 밑에(그 작업의 프로젝트로) 세부 작업을 만든다. 위 줄을 지우면 세부 작업 줄도(CASCADE, 이미 만든 작업은 남음).
**[크게 열기]** = 같은 표(DOM 그대로)를 넓은 창(`.pj-meet-quick-modal`, body 에, 고르기 메뉴 아래 z-index)으로 옮겨 쓰고 Esc·×로 제자리.
화면은 빈 줄 3개를 화면에만 두고
처음 채우는 순간 POST, 그 뒤 칸마다 PUT(줄마다 차례대로), 30초마다·창을 다시 볼 때 다시 읽는다(입력·저장 중엔 건너뜀).
이 브라우저에 남은 예전 표(`pj_meet_quick:{이메일}:{주차}`, 이번 주면 `pj_meet_quick:{이메일}`)는 처음 열 때 서버로 옮기고 지운다.
025 미적용이면 표 자리에 안내만(503).
+50
View File
@@ -523,6 +523,7 @@ function meetServer(env, st) {
const out = function (r) {
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_id: r.parent_id || null,
registered: r.task_id != null, visible: r.visible !== false, task_exists: true };
};
env.route("GET", /\/goals\/meetings\/([\d-]+)\/quick-tasks$/, function (u) {
@@ -692,6 +693,55 @@ function meetServer(env, st) {
}
});
// ════════════════════ [2g4] 세부 작업 줄(↳·Tab·Shift+Tab) · [크게 열기] ════════════════════
await section(async function () {
const env = makeEnv(PAGE.meeting_admin, MEET_URL);
meetServer(env);
const q = quickServer(env, { rows: [{ id: 1, title: "부모 작업", project_id: 7, project_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")); };
const inputOf = function (tr) { return tr.querySelector('input[data-field="title"]'); };
const type = async function (inp, v) {
inp.value = v; inp.dispatchEvent(new env.w.Event("input", { bubbles: true }));
inp.dispatchEvent(new env.w.Event("focusout", { bubbles: true })); await settle(); await wait(5); await settle();
};
trs()[0].querySelector('[data-quick="add-sub"]').click(); await settle();
const sub = trs()[1];
check("[2g4] ↳ → 바로 아래 세부 작업 줄(들여쓰기·프로젝트는 위 줄·섹션 없음)", sub.classList.contains("is-sub") &&
inputOf(sub).placeholder === "세부 작업 제목" && /브랜드/.test(sub.querySelector(".pj-meet-quick-inherit").textContent) &&
d.activeElement === inputOf(sub));
await type(inputOf(sub), "세부 하나");
const saved = Object.values(q.rows).find(function (r) { return r.title === "세부 하나"; });
check("[2g4] 세부 작업 줄 저장 = parent_id(위 줄), 프로젝트 칸 없이", !!saved && saved.parent_id === 1 && !saved.project_id, saved);
check("[2g4] 위 줄 [적용] 전에는 세부 작업 [적용] 못 함", trs()[1].querySelector('[data-quick="apply"]').disabled);
// 아래 빈 맨 위 단계 줄 — 제목을 쓰고 Tab = 위 줄(부모 작업)의 세부 작업으로, Shift+Tab = 다시 위 단계로
const top = trs().find(function (tr) { return !tr.classList.contains("is-sub") && !inputOf(tr).value; });
await type(inputOf(top), "둘째");
const key = function (inp, shift) {
const e = new env.w.KeyboardEvent("keydown", { key: "Tab", shiftKey: !!shift, bubbles: true, cancelable: true });
inp.dispatchEvent(e); return e.defaultPrevented;
};
const tabbed = key(inputOf(trs().find(function (tr) { return inputOf(tr).value === "둘째"; })));
await settle(); await wait(5); await settle();
const second = Object.values(q.rows).find(function (r) { return r.title === "둘째"; });
check("[2g4] Tab = 위 줄의 세부 작업으로(저장)", tabbed && second.parent_id === 1 &&
trs().find(function (tr) { return inputOf(tr).value === "둘째"; }).classList.contains("is-sub"), second);
key(inputOf(trs().find(function (tr) { return inputOf(tr).value === "둘째"; })), true);
await settle(); await wait(5); await settle();
check("[2g4] Shift+Tab = 위 단계로(저장)", second.parent_id === null &&
!trs().find(function (tr) { return inputOf(tr).value === "둘째"; }).classList.contains("is-sub"), second);
// 크게 열기 — 같은 표가 넓은 창으로(줄 그대로), Esc 로 제자리
const nRows = trs().length;
d.querySelector('#pj-meet-quick [data-quick="expand"]').click(); await settle();
const modal = d.body.querySelector(".pj-meet-quick-modal");
check("[2g4] 크게 열기 → 같은 표를 넓은 창으로(body 에, 제목 'N주차 작업 등록')", !!modal && !!modal.querySelector("table.pj-meet-quick-table") &&
!d.querySelector("#pj-meet-quick table") && /4주차 작업 등록/.test(modal.querySelector("h3").textContent) &&
modal.querySelectorAll("tbody tr").length === nRows && nRows > 0);
d.dispatchEvent(new env.w.KeyboardEvent("keydown", { key: "Escape", bubbles: true, cancelable: true })); await settle();
check("[2g4] Esc → 닫히고 표는 제자리", !d.body.querySelector(".pj-meet-quick-modal") && !!d.querySelector("#pj-meet-quick table.pj-meet-quick-table"));
});
// ════════════════════ [2h] 회의록은 누구나 수정 · [회의 완료](관리자)면 잠금 ════════════════════
await section(async function () {
const env = makeEnv(PAGE.meeting_member, MEET_URL);
+31
View File
@@ -1250,6 +1250,37 @@ def test_review_meeting_quick_tasks_shared():
_ = done
def test_review_meeting_quick_subtask_rows():
"""세부 작업 줄 — 한 단계만, Tab(위 줄 밑으로)·Shift+Tab, [적용]은 위 줄 작업 밑에(위 줄 프로젝트)."""
from app.modules.project import store
w = store.month_weeks(2032, 1)[1][0]
p = _project("P-quick-sub", ADMIN, (BOB,))
s = _stage(p["id"], by=ADMIN)
url = f"/project/api/goals/meetings/{w}/quick-tasks"
put = lambda i, body: req("PUT", f"/project/api/goals/meeting-quick-tasks/{i}", BOB, json=body)
top = req("POST", url, BOB, json={"title": "부모", "project_id": p["id"], "stage_id": s["id"]}).json()["task"]
sub = req("POST", url, BOB, json={"title": "자식", "parent_id": top["id"]}).json()["task"]
other = req("POST", url, BOB, json={"title": "다른 줄"}).json()["task"]
assert req("POST", url, BOB, json={"title": "손자", "parent_id": sub["id"]}).status_code == 400 # 한 단계만
assert put(other["id"], {"parent_id": sub["id"]}).status_code == 400 # 세부 작업 줄 밑 X
assert put(top["id"], {"parent_id": other["id"]}).status_code == 400 # 자식 딸린 줄은 세부 작업 X
assert put(other["id"], {"parent_id": other["id"]}).status_code == 400
assert put(other["id"], {"parent_id": top["id"]}).json()["task"]["parent_id"] == top["id"] # Tab
assert put(other["id"], {"parent_id": None}).json()["task"]["parent_id"] is None # Shift+Tab
# 위 줄 전에는 세부 작업 [적용] 불가 → 위 줄 [적용] 뒤 세부 작업은 위 줄 작업 밑(섹션 없음)
assert req("POST", f"/project/api/goals/meeting-quick-tasks/{sub['id']}/apply", BOB).status_code == 400
r = req("POST", f"/project/api/goals/meeting-quick-tasks/{top['id']}/apply", BOB)
parent_task = r.json()["task"]["task_id"]
r = req("POST", f"/project/api/goals/meeting-quick-tasks/{sub['id']}/apply", BOB)
assert r.status_code == 201, r.text
t = ST.get_task(task_id=r.json()["task"]["task_id"])
assert (t["parent_task_id"], t["project_id"], t["stage_id"]) == (parent_task, p["id"], None)
for row in (top, other):
req("DELETE", f"/project/api/goals/meeting-quick-tasks/{row['id']}", BOB)
assert req("GET", url, BOB).json()["tasks"] == []
if __name__ == "__main__":
if not ENABLED:
print("SKIP: PROJECT_TEST_DB_URL(localhost) not set")