feat(project): weekly meetings editable by anyone, admin completes to lock
Meeting write APIs now accept any project user; deleting a meeting and the
new POST /api/goals/meetings/{week}/complete (complete/reopen) stay admin
only. A completed meeting (migration 022: completed_at, completed_by)
rejects edits with 409; last-week result fields follow the next meeting's
lock instead. The page shows a complete button / locked badge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,7 +15,7 @@ const ROOT = path.join(__dirname, "..", "..");
|
||||
const OUT = path.join(__dirname, ".out");
|
||||
const JS = fs.readFileSync(path.join(ROOT, "app", "static", "project.js"), "utf8");
|
||||
const PAGE = {};
|
||||
["goals_admin", "goals_ro", "goals_weekly_admin", "meeting_admin", "meeting_err", "meeting_ro"].forEach(function (n) {
|
||||
["goals_admin", "goals_ro", "goals_weekly_admin", "meeting_admin", "meeting_err", "meeting_ro", "meeting_member"].forEach(function (n) {
|
||||
PAGE[n] = fs.readFileSync(path.join(OUT, n + ".html"), "utf8");
|
||||
});
|
||||
const GOALS_URL = "http://localhost/project/goals/2026";
|
||||
@@ -532,6 +532,31 @@ function meetServer(env, st) {
|
||||
check("[2g] 적용 전 줄 × → 줄만 지움", d.querySelectorAll("#pj-meet-quick tbody tr").length === n - 1 && env.calls.length === calls);
|
||||
}, { notifyOnFail: true });
|
||||
|
||||
// ════════════════════ [2h] 회의록은 누구나 수정 · [회의 완료](관리자)면 잠금 ════════════════════
|
||||
await section(async function () {
|
||||
const env = makeEnv(PAGE.meeting_member, MEET_URL);
|
||||
const st = meetServer(env);
|
||||
await boot(env);
|
||||
const d = env.d;
|
||||
check("[2h] 직원도 회의록 입력칸·메모 편집", !!d.querySelector(".pj-meet-text") && !!d.getElementById("pj-meet-notes"));
|
||||
check("[2h] 직원에겐 삭제·회의 완료 버튼 없음", !d.getElementById("pj-meet-del") && !d.getElementById("pj-meet-complete"));
|
||||
const ta = d.querySelector('tr[data-item="1"] .pj-meet-text');
|
||||
ta.focus(); type(env, ta, "직원이 적은 업무"); ta.blur(); await settle(); await wait(10); await settle();
|
||||
check("[2h] 직원 입력 저장", st.items[1] && st.items[1].content === "직원이 적은 업무", st.items[1]);
|
||||
});
|
||||
await section(async function () {
|
||||
const env = makeEnv(PAGE.meeting_admin, MEET_URL);
|
||||
meetServer(env);
|
||||
let posted = null;
|
||||
env.route("POST", /\/project\/api\/goals\/meetings\/2026-09-28\/complete$/, function (u, body) { posted = body; return { body: { ok: true, completed: true } }; });
|
||||
env.w.erpConfirm = function () { return Promise.resolve(true); };
|
||||
await boot(env);
|
||||
env.d.getElementById("pj-meet-complete").click(); await settle(); await wait(10); await settle();
|
||||
check("[2h] 관리자 [회의 완료] → 완료 요청·새로고침", posted && posted.done === true && env.navigations === 1, [posted, env.navigations]);
|
||||
const ro = makeEnv(PAGE.meeting_ro, MEET_URL); meetServer(ro); await boot(ro);
|
||||
check("[2h] 완료된 회의록 — 입력칸 없음·완료 표시", !ro.d.querySelector(".pj-meet-text, #pj-meet-notes") && /회의 완료/.test(ro.d.querySelector(".pj-meet-done-badge").textContent));
|
||||
});
|
||||
|
||||
// ════════════════════ [3] 목표 표 — 글 저장 실패면 구조 변경·표 교체 중단 ════════════════════
|
||||
await section(async function () {
|
||||
const env = makeEnv(PAGE.goals_admin, GOALS_URL, { promptAnswer: "새 영역" });
|
||||
|
||||
@@ -103,7 +103,7 @@ def meeting_view(err: bool) -> dict:
|
||||
|
||||
def meeting_ctx(admin: bool, err: bool, can_sync: bool = True) -> dict:
|
||||
view = meeting_view(err)
|
||||
return {
|
||||
ctx = {
|
||||
"user": {"email": ME, "is_super_admin": False}, "is_admin": admin, "nav_projects": [], "goal_years": [2026],
|
||||
"goal_year_active": 2026, "my_open_total": 0, "mention_unread": 0, "color_palette": ["#4573d2"],
|
||||
"project_icons": ["folder"], "goal_year": 2026, "goal_month": 9, "meetings_enabled": True,
|
||||
@@ -114,6 +114,16 @@ def meeting_ctx(admin: bool, err: bool, can_sync: bool = True) -> dict:
|
||||
"can_sync": can_sync, "meeting_status": store.MEETING_STATUS, "meet_members": [], "month_plan": None,
|
||||
"attendee_list": [], **copy.deepcopy(view),
|
||||
}
|
||||
# 회의록은 누구나 고친다(2026-10-07) — 보기 전용은 "회의 완료"된 회의록뿐. 관리자 아닌 화면 = 완료된 회의록으로 시험
|
||||
ctx["meeting"].update(can_complete=True, completed=not admin, completed_at="2026-10-02 18:00" if not admin else "",
|
||||
completed_by="admin@test.local" if not admin else "")
|
||||
return ctx
|
||||
|
||||
|
||||
def member_ctx() -> dict:
|
||||
ctx = meeting_ctx(False, False, can_sync=False)
|
||||
ctx["meeting"].update(completed=False, completed_at="", completed_by="")
|
||||
return ctx
|
||||
|
||||
|
||||
def meeting_layout_ctx(admin: bool) -> dict:
|
||||
@@ -156,6 +166,8 @@ def main() -> None:
|
||||
"meeting_admin.html": ("project/goal_meeting.html", meeting_ctx(True, False)),
|
||||
"meeting_err.html": ("project/goal_meeting.html", meeting_ctx(True, True)),
|
||||
"meeting_ro.html": ("project/goal_meeting.html", meeting_ctx(False, False, can_sync=False)),
|
||||
# 관리자 아닌 직원 + 아직 완료 전 회의록 — 누구나 고친다(2026-10-07)
|
||||
"meeting_member.html": ("project/goal_meeting.html", member_ctx()),
|
||||
"meeting_layout_admin.html": ("project/goal_meeting.html", meeting_layout_ctx(True)),
|
||||
"meeting_layout_ro.html": ("project/goal_meeting.html", meeting_layout_ctx(False)),
|
||||
"meeting_merged.html": ("project/goal_meeting.html", meeting_merged_ctx()),
|
||||
|
||||
Reference in New Issue
Block a user