feat(project): meeting rows added from the task cell stay in the same item cell (migration 027), in-place redraw with animation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
{% block head_extra %}
|
||||
{# 프로젝트 화면 부품(설명 편집기·날짜 팝업·멤버 고르기)을 그대로 쓴다 — project.js 는 PJ_LIB_ONLY 로 부품만 #}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
|
||||
<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=20261012k" defer></script>
|
||||
<script src="/static/project.js?v=20261012l" defer></script>
|
||||
<script src="/static/erp-notice-admin.js?v=20261012b" defer></script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -2776,7 +2776,23 @@ class ProjectStore:
|
||||
return (self._MEETING_ITEM_COLS + (", line_key" if self._meeting_keys(conn) else "")
|
||||
+ (", content_row_span" if self._meeting_cells(conn) else "")
|
||||
+ (", result_note" if self._meeting_v20(conn) else "")
|
||||
+ (", target_text, result_text" if self._meeting_v21(conn) else ""))
|
||||
+ (", target_text, result_text" if self._meeting_v21(conn) else "")
|
||||
+ (", label_cont" if self._meeting_v27(conn) else ""))
|
||||
|
||||
def _meeting_v27(self, conn: Any) -> bool:
|
||||
"""마이그레이션 027 — 항목 칸 묶음(label_cont: 바로 위 줄의 항목 칸에 이어 붙는 줄)."""
|
||||
if getattr(self, "_meeting_v27_ok", False):
|
||||
return True
|
||||
ok = self._column_exists(conn, "goal_meeting_items", "label_cont")
|
||||
if ok:
|
||||
self._meeting_v27_ok = True
|
||||
return ok
|
||||
|
||||
@staticmethod
|
||||
def _meeting_conts(rows: list[dict[str, Any]]) -> list[bool]:
|
||||
"""줄 순서대로 '실제로 이어 붙은 줄'인가 — label_cont 이고 바로 위 줄이 같은 구역일 때만(구역 첫 줄은 늘 묶음 첫 줄)."""
|
||||
return [bool(r.get("label_cont")) and i > 0 and rows[i - 1]["section"] == r["section"]
|
||||
for i, r in enumerate(rows)]
|
||||
|
||||
def _meeting_v21(self, conn: Any) -> bool:
|
||||
"""마이그레이션 021 — 정량 목표·결과 글(target_text·result_text, 예: "20개")."""
|
||||
@@ -2999,6 +3015,7 @@ class ProjectStore:
|
||||
if ws.weekday() != 0 and not self._meeting_v20(conn):
|
||||
raise store.MeetingMigration020Needed() # 월요일만 허용하던 CHECK 가 아직 있다
|
||||
keyed = self._meeting_keys(conn)
|
||||
v27 = self._meeting_v27(conn)
|
||||
ins = conn.execute(
|
||||
"INSERT INTO goal_meetings (week_start, created_by, updated_by) VALUES (%s, %s, %s) "
|
||||
"ON CONFLICT (week_start) DO NOTHING RETURNING week_start",
|
||||
@@ -3006,7 +3023,8 @@ class ProjectStore:
|
||||
).fetchone()
|
||||
if ins is None:
|
||||
return False
|
||||
src_cols = "id, section, section_color, label, marketplace_code, sort_order" + (", line_key" if keyed else "")
|
||||
src_cols = ("id, section, section_color, label, marketplace_code, sort_order" + (", line_key" if keyed else "")
|
||||
+ (", label_cont" if v27 else ""))
|
||||
src_items: list[dict[str, Any]] = []
|
||||
src_is_prev = True
|
||||
for cmp_, order, is_prev in (("<", "DESC", True), (">", "ASC", False)):
|
||||
@@ -3042,6 +3060,12 @@ class ProjectStore:
|
||||
"marketplace_code, carry_from, sort_order, updated_by) VALUES (%s,%s,%s,%s,%s,%s,%s,%s)",
|
||||
(ws, r["section"], r["section_color"], r["label"], r["marketplace_code"], carry, n, who),
|
||||
)
|
||||
if v27 and r.get("label_cont"):
|
||||
# 항목 칸 묶음도 그대로 이어받는다(027) — 방금 넣은 줄(같은 주차·순서)
|
||||
conn.execute(
|
||||
"UPDATE goal_meeting_items SET label_cont = true WHERE week_start = %s AND sort_order = %s",
|
||||
(ws, n),
|
||||
)
|
||||
else:
|
||||
n = 0
|
||||
for name, color in sections or [(k, "") for k in store.MEETING_TEMPLATE]:
|
||||
@@ -3108,9 +3132,14 @@ class ProjectStore:
|
||||
|
||||
def add_meeting_item(
|
||||
self, *, week_start: date, section: str, section_color: str = "", label: str = "",
|
||||
ref_item_id: int | None = None, place: str = "below", updated_by: str = "",
|
||||
ref_item_id: int | None = None, place: str = "below", updated_by: str = "", same_label: bool = False,
|
||||
) -> int:
|
||||
"""줄 추가 — 기준 줄 위/아래(같은 구역), 없으면 그 구역 끝(구역이 없으면 맨 끝 = 새 구역)."""
|
||||
"""줄 추가 — 기준 줄 위/아래(같은 구역), 없으면 그 구역 끝(구역이 없으면 맨 끝 = 새 구역).
|
||||
|
||||
same_label(주요 업무 칸에서 추가, 027) = 새 줄을 기준 줄과 **같은 항목 칸** 안에: 아래면 새 줄이 이어 붙고(label_cont),
|
||||
위면 — 기준 줄이 묶음 첫 줄이면 새 줄이 첫 줄이 되어 이름을 넘겨받고 기준 줄이 이어 붙는다(연간 목표 016 과 같은 규칙)."""
|
||||
if same_label and ref_item_id is None:
|
||||
raise ValueError("같은 항목 칸에 추가하려면 기준 줄이 필요합니다.")
|
||||
sec = store.norm_str(section)
|
||||
if not sec or len(sec) > store.MEETING_LABEL_MAX:
|
||||
raise ValueError("구역 이름을 입력하세요(50자 이하).")
|
||||
@@ -3141,14 +3170,31 @@ class ProjectStore:
|
||||
i = same[-1] + 1 if same else len(ids)
|
||||
if any(a < i <= b for a, b in self._meeting_merge_ranges(rows)):
|
||||
raise ValueError("병합된 셀 안에 줄을 추가하려면 먼저 병합을 해제해 주세요.")
|
||||
cont = False
|
||||
if same_label:
|
||||
if not self._meeting_v27(conn):
|
||||
raise store.MeetingMigration027Needed()
|
||||
k = ids.index(ref_item_id)
|
||||
ref = rows[k]
|
||||
if ref["section"] != sec:
|
||||
raise ValueError("기준 줄과 같은 구역이어야 합니다.")
|
||||
if place == "above" and not self._meeting_conts(rows)[k]:
|
||||
# 묶음 첫 줄 위 — 새 줄이 첫 줄(이름을 넘겨받음), 기준 줄은 이어 붙는다
|
||||
lb = ref["label"]
|
||||
conn.execute("UPDATE goal_meeting_items SET label = '', label_cont = true WHERE id = %s",
|
||||
(ref_item_id,))
|
||||
else:
|
||||
lb, cont = "", True
|
||||
# 새 줄 = 새 연결키(018) — 이름이 같은 다른 줄과 섞이지 않는다
|
||||
keyed = self._meeting_keys(conn)
|
||||
v27 = self._meeting_v27(conn)
|
||||
new_id = int(conn.execute(
|
||||
"INSERT INTO goal_meeting_items (week_start, section, section_color, label, marketplace_code, "
|
||||
"sort_order, updated_by" + (", line_key" if keyed else "") + ") VALUES (%s,%s,%s,%s,%s,0,%s"
|
||||
+ (",%s" if keyed else "") + ") RETURNING id",
|
||||
"sort_order, updated_by" + (", line_key" if keyed else "") + (", label_cont" if v27 else "")
|
||||
+ ") VALUES (%s,%s,%s,%s,%s,0,%s" + (",%s" if keyed else "") + (",%s" if v27 else "") + ") RETURNING id",
|
||||
(week_start, sec, color, lb, store.guess_meeting_market(sec, lb),
|
||||
store.norm_str(updated_by, lower=True), *((str(uuid.uuid4()),) if keyed else ())),
|
||||
store.norm_str(updated_by, lower=True), *((str(uuid.uuid4()),) if keyed else ()),
|
||||
*((cont,) if v27 else ())),
|
||||
).fetchone()["id"])
|
||||
ids.insert(i, new_id)
|
||||
for n, x in enumerate(ids):
|
||||
@@ -3304,6 +3350,15 @@ class ProjectStore:
|
||||
i = next(n for n, r in enumerate(rows) if int(r["id"]) == item_id)
|
||||
if any(a <= i <= b for a, b in self._meeting_merge_ranges(rows)):
|
||||
raise ValueError("병합된 셀의 줄을 삭제하려면 먼저 병합을 해제해 주세요.")
|
||||
if self._meeting_v27(conn):
|
||||
# 항목 칸 묶음 첫 줄을 지우면 바로 아래 이어 붙은 줄이 첫 줄이 되고 이름을 넘겨받는다(비어 있으면)
|
||||
conts = self._meeting_conts(rows)
|
||||
if not conts[i] and i + 1 < len(rows) and conts[i + 1]:
|
||||
conn.execute(
|
||||
"UPDATE goal_meeting_items SET label_cont = false, "
|
||||
"label = CASE WHEN label = '' THEN %s ELSE label END WHERE id = %s",
|
||||
(rows[i]["label"], rows[i + 1]["id"]),
|
||||
)
|
||||
row = conn.execute("DELETE FROM goal_meeting_items WHERE id = %s RETURNING id", (item_id,)).fetchone()
|
||||
if row is None:
|
||||
raise KeyError(item_id)
|
||||
@@ -3321,6 +3376,10 @@ class ProjectStore:
|
||||
return
|
||||
if any(a <= i <= b or a <= j <= b for a, b in self._meeting_merge_ranges(rows)):
|
||||
raise ValueError("병합된 셀의 줄을 이동하려면 먼저 병합을 해제해 주세요.")
|
||||
conts = self._meeting_conts(rows)
|
||||
in_group = lambda k: conts[k] or (k + 1 < len(rows) and conts[k + 1]) # noqa: E731
|
||||
if in_group(i) or in_group(j):
|
||||
raise ValueError("같은 항목 칸으로 묶인 줄은 옮길 수 없습니다. 항목 칸을 나눈 뒤 옮기세요.")
|
||||
ids[i], ids[j] = ids[j], ids[i]
|
||||
for n, x in enumerate(ids):
|
||||
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
|
||||
@@ -3348,6 +3407,24 @@ class ProjectStore:
|
||||
for n, x in enumerate(order):
|
||||
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
|
||||
|
||||
def split_meeting_label(self, *, item_id: int) -> int:
|
||||
"""항목 칸 나누기(027) — item_id(묶음 첫 줄) 아래 이어 붙은 줄들을 각자 항목 칸으로(이름은 빈 칸). 나눈 줄 수."""
|
||||
with self._pool.connection() as conn:
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
if not self._meeting_v27(conn):
|
||||
raise store.MeetingMigration027Needed()
|
||||
rows = self._locked_meeting_items(conn, item_id)
|
||||
conts = self._meeting_conts(rows)
|
||||
i = next(n for n, r in enumerate(rows) if int(r["id"]) == item_id)
|
||||
n = 0
|
||||
for k in range(i + 1, len(rows)):
|
||||
if not conts[k]:
|
||||
break
|
||||
conn.execute("UPDATE goal_meeting_items SET label_cont = false WHERE id = %s", (rows[k]["id"],))
|
||||
n += 1
|
||||
return n
|
||||
|
||||
# ── 회의록 작업 등록 표(025) — 주차별 한 표, 모두가 같이 본다. [적용] 전 줄은 고치고, [적용]은 한 번만 ──
|
||||
# 026 — 작업 칸(parent_task_id): 고르면 [적용] 때 그 작업의 세부 작업으로(비우면 그 섹션에 새 작업).
|
||||
# 025 의 parent_id(표 안 줄끼리 세부 작업)는 화면에서 쓰지 않는다(열·값은 그대로, 읽기·쓰기 안 함).
|
||||
|
||||
@@ -2924,6 +2924,20 @@ def _goal_area_layout(rows: list[dict[str, Any]], this_month: int) -> None:
|
||||
row["layout"] = out
|
||||
|
||||
|
||||
def _meeting_label_spans(rows: list[dict[str, Any]]) -> None:
|
||||
"""회의록 구역 한 덩어리의 항목 칸 묶음(027) — 이어 붙은 줄(label_cont, 구역 첫 줄 제외)은 항목 칸을 그리지 않고
|
||||
(label_hidden) 묶음 첫 줄이 rowspan(label_span). label_shown = 그 줄이 속한 항목 이름(칸 이름표·접근성용)."""
|
||||
grp: dict[str, Any] | None = None
|
||||
for i, it in enumerate(rows):
|
||||
if i and it.get("label_cont") and grp is not None:
|
||||
it["label_hidden"] = True
|
||||
grp["label_span"] += 1
|
||||
else:
|
||||
grp = it
|
||||
it["label_hidden"], it["label_span"] = False, 1
|
||||
it["label_shown"] = grp["label"]
|
||||
|
||||
|
||||
def _goal_label_spans(rows: list[dict[str, Any]]) -> None:
|
||||
"""항목 칸(2열) 묶음(016) — 묶음 첫 줄 label_span = 이어 붙은 줄 수 + 1, 이어 붙은 줄은 label_span 0(2열을 그리지 않음).
|
||||
영역 첫 줄은 늘 묶음 첫 줄."""
|
||||
@@ -2956,6 +2970,8 @@ def _goal_call(fn: Any, *args: Any, **kwargs: Any) -> Any:
|
||||
raise HTTPException(status_code=409, detail="회의가 완료되어 수정할 수 없습니다. 관리자가 [완료 해제]하면 다시 고칠 수 있습니다.")
|
||||
except store.MeetingMigration022Needed:
|
||||
raise HTTPException(status_code=503, detail="회의 완료 기능은 project_db 마이그레이션 022 적용 후 사용할 수 있습니다.")
|
||||
except store.MeetingMigration027Needed:
|
||||
raise HTTPException(status_code=503, detail="같은 항목 칸 안 줄 추가·항목 칸 나누기는 project_db 마이그레이션 027 적용 후 사용할 수 있습니다.")
|
||||
except store.MeetingParentTaskMigrationNeeded:
|
||||
raise HTTPException(status_code=503, detail="작업 칸(이미 있는 작업의 세부 작업으로 등록)은 project_db 마이그레이션 026 적용 후 사용할 수 있습니다.")
|
||||
except store.MeetingTaskMigrationNeeded:
|
||||
@@ -3440,6 +3456,7 @@ def _meeting_view(request: Request, st: Any, *, year: int, month: int, week: dat
|
||||
meeting["sections"] = sections
|
||||
for sec in sections:
|
||||
covered = 0
|
||||
_meeting_label_spans(sec["rows"])
|
||||
for i, it in enumerate(sec["rows"]):
|
||||
it["content_html"] = store.goal_text_html(it["content"])
|
||||
it["content_hidden"] = covered > 0
|
||||
@@ -3683,7 +3700,8 @@ def api_delete_meeting(request: Request, week_start: str) -> JSONResponse:
|
||||
|
||||
@router.post("/api/goals/meetings/{week_start}/items")
|
||||
def api_add_meeting_item(request: Request, week_start: str, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
"""줄 추가 {section, label?, ref_item_id?, place?: above|below} — 기준 줄 위/아래, 없으면 구역 끝(새 구역이면 맨 끝)."""
|
||||
"""줄 추가 {section, label?, ref_item_id?, place?: above|below, same_label?} — 기준 줄 위/아래, 없으면 구역 끝(새 구역이면 맨 끝).
|
||||
same_label = 주요 업무 칸에서 추가 — 기준 줄과 같은 항목 칸 안에(027)."""
|
||||
user = _require_user(request)
|
||||
st = _db_or_503(request)
|
||||
ws = _goal_call(store.validate_week_start, week_start)
|
||||
@@ -3695,6 +3713,7 @@ def api_add_meeting_item(request: Request, week_start: str, payload: dict[str, A
|
||||
item_id = _goal_call(
|
||||
st.add_meeting_item, week_start=ws, section=payload.get("section", ""), label=payload.get("label", ""),
|
||||
ref_item_id=ref_id, place=payload.get("place") or "below", updated_by=user["email"],
|
||||
same_label=bool(payload.get("same_label")),
|
||||
)
|
||||
return JSONResponse({"ok": True, "id": item_id}, status_code=201)
|
||||
|
||||
@@ -3753,6 +3772,14 @@ def api_move_meeting_item(request: Request, item_id: int, payload: dict[str, Any
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
|
||||
@router.post("/api/goals/meeting-items/{item_id}/split-label")
|
||||
def api_split_meeting_label(request: Request, item_id: int) -> JSONResponse:
|
||||
"""항목 칸 나누기(027) — item_id = 묶음 첫 줄. 이어 붙은 줄들이 각자 항목 칸(이름 빈 칸)으로. 줄 순서와 같은 권한."""
|
||||
_require_user(request)
|
||||
n = _goal_call(_db_or_503(request).split_meeting_label, item_id=item_id)
|
||||
return JSONResponse({"ok": True, "split": n})
|
||||
|
||||
|
||||
# ── 회의록 작업 등록 표(025) — 주차별 한 표를 서버에(예전엔 각자 브라우저에만 있어 다른 사람 줄이 안 보였다) ──
|
||||
# 보기·고치기: 회의록을 볼 수 있는 사람 누구나(회의 완료면 잠금). 줄에 고른 프로젝트는 내가 멤버인 것만 고를 수 있고,
|
||||
# 내가 멤버가 아닌 프로젝트를 가리키는 남의 줄은 프로젝트·섹션 이름·만든 작업을 가린다. [적용] = 그 프로젝트 멤버만.
|
||||
|
||||
@@ -431,6 +431,10 @@ class MeetingMigration022Needed(RuntimeError):
|
||||
"""회의 완료(잠금)는 마이그레이션 022 뒤에만 된다."""
|
||||
|
||||
|
||||
class MeetingMigration027Needed(RuntimeError):
|
||||
"""같은 항목 칸 안 줄 추가·항목 칸 나누기(goal_meeting_items.label_cont)는 마이그레이션 027 뒤에만 된다."""
|
||||
|
||||
|
||||
class MeetingTaskMigrationNeeded(RuntimeError):
|
||||
"""회의록 작업 등록 표(서버 저장)는 마이그레이션 025 뒤에만 된다."""
|
||||
|
||||
|
||||
@@ -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=20261012h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -227,22 +227,25 @@
|
||||
<tbody class="pj-meet-sec" data-section="{{ sec.name }}" style="--goal-bg: {{ sec.color or '#fff' }}">
|
||||
{% for it in sec.rows %}
|
||||
{% set p = it.prev %}
|
||||
<tr data-item="{{ it.id }}" data-section="{{ sec.name }}" data-market="{{ it.marketplace_code }}" data-target-amount="{{ it.target_amount if it.target_amount is not none else '' }}"{% if p %} data-prev="{{ p.id }}" data-prev-target="{{ p.target_amount if p.target_amount is not none else '' }}"{% endif %}>
|
||||
<tr data-item="{{ it.id }}" data-section="{{ sec.name }}"{% if it.label_hidden %} data-label-cont="1"{% endif %} data-market="{{ it.marketplace_code }}" data-target-amount="{{ it.target_amount if it.target_amount is not none else '' }}"{% if p %} data-prev="{{ p.id }}" data-prev-target="{{ p.target_amount if p.target_amount is not none else '' }}"{% endif %}>
|
||||
{% if loop.first %}
|
||||
<th class="pj-meet-c-sec" rowspan="{{ sec.rows | length }}">{{ sec.name }}
|
||||
{% if edit %}<button type="button" class="pj-icon-btn pj-meet-more pj-meet-sec-more" data-meet-act="sec-menu" title="구역 메뉴(위로·아래로) · 우클릭도 됩니다"><span class="material-symbols-outlined">more_horiz</span></button>
|
||||
<button type="button" class="pj-meet-sec-add" data-meet-act="sec-add" title="{{ sec.name }} 구역 끝에 줄 추가">+</button>{% endif %}
|
||||
</th>
|
||||
{% endif %}
|
||||
<th class="pj-meet-c-label">
|
||||
{# 항목 칸 — 같은 항목 칸 안에 이어 붙은 줄(027 label_cont)은 그리지 않고 묶음 첫 줄이 rowspan #}
|
||||
{% if not it.label_hidden %}
|
||||
<th class="pj-meet-c-label"{% if (it.label_span or 1) > 1 %} rowspan="{{ it.label_span }}"{% endif %}>
|
||||
<span class="pj-meet-label-line">
|
||||
<span class="pj-meet-label"{% if edit %} data-meet-edit="label" title="눌러서 이름 수정 · 우클릭 = 줄 메뉴"{% endif %}>{{ it.label }}</span>
|
||||
</span>
|
||||
{% if edit %}<button type="button" class="pj-icon-btn pj-meet-more" data-meet-act="menu" title="줄 메뉴"><span class="material-symbols-outlined">more_horiz</span></button>{% endif %}
|
||||
</th>
|
||||
{% endif %}
|
||||
{% if not it.content_hidden %}
|
||||
<td class="pj-meet-c-text" rowspan="{{ it.content_span or 1 }}" data-meet-item="{{ it.id }}">
|
||||
{% if edit %}<div class="pj-meet-text pj-goal-text" contenteditable="true" role="textbox" aria-multiline="true" aria-label="{{ it.label }} 주요 업무" data-field="content" data-placeholder="주요 업무">{% if it.content_html is defined %}{{ it.content_html | safe }}{% else %}{{ it.content }}{% endif %}</div>
|
||||
{% if edit %}<div class="pj-meet-text pj-goal-text" contenteditable="true" role="textbox" aria-multiline="true" aria-label="{{ it.label_shown if it.label_shown is defined else it.label }} 주요 업무" data-field="content" data-placeholder="주요 업무">{% if it.content_html is defined %}{{ it.content_html | safe }}{% else %}{{ it.content }}{% endif %}</div>
|
||||
{% else %}<div class="pj-meet-ro">{% if it.content_html is defined %}{{ it.content_html | safe }}{% else %}{{ it.content }}{% endif %}</div>{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
@@ -255,7 +258,7 @@
|
||||
<td class="pj-meet-c-text is-prev"><div class="pj-meet-ro">{% if p.content_html is defined %}{{ p.content_html | safe }}{% else %}{{ p.content }}{% endif %}</div></td>
|
||||
{# 결과(글) — 지난 주차 줄의 result_note(020). 미적용이면 보기만 #}
|
||||
<td class="pj-meet-c-text is-prev pj-meet-c-note">
|
||||
{% if edit and meeting.result_notes %}<textarea class="pj-meet-rnote" rows="1" data-field="result_note" data-target="prev" aria-label="{{ it.label }} 결과" placeholder="결과">{{ p.result_note or '' }}</textarea>
|
||||
{% if edit and meeting.result_notes %}<textarea class="pj-meet-rnote" rows="1" data-field="result_note" data-target="prev" aria-label="{{ it.label_shown if it.label_shown is defined else it.label }} 결과" placeholder="결과">{{ p.result_note or '' }}</textarea>
|
||||
{% else %}<div class="pj-meet-ro">{{ p.result_note or '' }}</div>{% endif %}
|
||||
</td>
|
||||
<td class="pj-meet-c-amt is-prev">{{ p.target_text or won(p.target_amount) }}</td>
|
||||
@@ -294,6 +297,6 @@
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<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=20261012k" defer></script>
|
||||
<script src="/static/project-meeting-cells.js?v=20261012a" defer></script>
|
||||
<script src="/static/project.js?v=20261012l" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
|
||||
<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=20261012k" defer></script>
|
||||
<script src="/static/project.js?v=20261012l" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
@@ -699,6 +699,7 @@
|
||||
<ul>
|
||||
<li>구역 이름 옆 <span class="pjh-ui">+</span>는 그 구역 끝에 줄을 추가합니다. 표 아래 <span class="pjh-ui">+ 구역 추가</span>로 새 구역을 만듭니다.</li>
|
||||
<li>항목 이름을 클릭하면 그 자리에서 고칩니다. 우클릭 또는 ⋯ 메뉴에서 <span class="pjh-ui">위에 줄 추가 · 아래에 줄 추가 · 위로 · 아래로 · 줄 삭제</span>를 사용합니다. 순서 이동은 같은 구역 안에서 합니다.</li>
|
||||
<li><b>주요 업무</b> 칸을 우클릭해 <span class="pjh-ui">위에 줄 추가 · 아래에 줄 추가</span>를 하면 <b>항목 칸은 그대로</b> 두고 그 항목 안에 줄이 늘어납니다(줄마다 주요 업무·정량 목표는 따로). 같은 메뉴의 <span class="pjh-ui">줄 삭제</span>는 그 한 줄만 지웁니다. 묶인 항목 칸은 항목 칸 메뉴의 <span class="pjh-ui">항목 칸 나누기</span>로 다시 나눕니다. 줄을 추가·삭제하면 새로고침 없이 표가 그 자리에서 움직이며 바뀝니다.</li>
|
||||
<li><b>구역 순서</b> — 첫 열 <b>구분</b> 칸을 우클릭하거나 마우스를 올려 나오는 <span class="pjh-ui">⋯</span>를 누르면 <span class="pjh-ui">구역 위로 · 구역 아래로 · 구역 끝에 줄 추가</span>가 나옵니다. 구역 안의 줄 순서·병합은 그대로 함께 옮겨지고, 다음에 만드는 회의록도 바뀐 순서를 이어받습니다(회의 완료 전까지, 누구나).</li>
|
||||
<li>줄을 삭제하면 주요 업무·정량 목표도 함께 삭제됩니다. 새 줄은 지난주에 이어진 항목이 없으면 지난주 리뷰가 비어 있습니다.</li>
|
||||
</ul>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
|
||||
<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=20261012k" defer></script>
|
||||
<script src="/static/project.js?v=20261012l" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
|
||||
<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=20261012k" defer></script>
|
||||
<script src="/static/project.js?v=20261012l" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -108,5 +108,5 @@
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<script src="/static/project.js?v=20261012k" defer></script>
|
||||
<script src="/static/project.js?v=20261012l" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — 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=20261012k" defer></script>
|
||||
<script src="/static/project.js?v=20261012l" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012h" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012i" />
|
||||
<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=20261012k" defer></script>
|
||||
<script src="/static/project.js?v=20261012l" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -287,19 +287,25 @@
|
||||
if (merged.length) items.push({ label: "병합 해제", icon: opts.icon("call_split"), onClick: () => unmergeCells(merged) });
|
||||
if (cells.some(c => editorOf(c).value)) items.push({ label: "내용 지우기 (Del)", icon: opts.icon("ink_eraser"), onClick: () => clearCells(cells) });
|
||||
if (saver) {
|
||||
// 주요 업무 칸에서 추가한 줄은 같은 항목 칸 안에 들어간다(항목 칸은 그대로 — 027 sameLabel)
|
||||
items.push(null,
|
||||
{ label: "위에 줄 추가", icon: opts.icon("add_row_above"), onClick: () => saver.addRow(cell.closest("tbody").dataset.section, cell.dataset.meetItem, "above") },
|
||||
{ label: "위에 줄 추가", icon: opts.icon("add_row_above"), onClick: () => saver.addRow(cell.closest("tbody").dataset.section, cell.dataset.meetItem, "above", { sameLabel: true }) },
|
||||
{ label: "아래에 줄 추가", icon: opts.icon("add_row_below"), onClick: () => {
|
||||
const rows = Array.from(cell.closest("tbody").rows), bottom = rows[rows.indexOf(cell.parentElement) + cell.rowSpan - 1];
|
||||
saver.addRow(cell.closest("tbody").dataset.section, bottom.dataset.item, "below");
|
||||
saver.addRow(cell.closest("tbody").dataset.section, bottom.dataset.item, "below", { sameLabel: true });
|
||||
} });
|
||||
if (cell.rowSpan === 1 && cells.length === 1 && saver.deleteRow) {
|
||||
items.push({ label: "줄 삭제", danger: true, icon: opts.icon("delete"), onClick: () => saver.deleteRow(cell.parentElement) });
|
||||
}
|
||||
}
|
||||
}
|
||||
if (items.length) items.push(null);
|
||||
items.push(...widthItems(td));
|
||||
if (items.length) { e.preventDefault(); opts.menu(e.clientX, e.clientY, items); }
|
||||
});
|
||||
return { bindSaver: s => { saver = s; }, widthItems: widthItems };
|
||||
// 줄 구조를 다시 끼운 뒤(refreshMeeting) — 새 칸에 열 너비 손잡이·이동 테두리, 너비 다시 적용, 선택 풀기
|
||||
function refresh() { anchor = null; clearSelection(); handles(); applyWidths(); }
|
||||
return { bindSaver: s => { saver = s; }, widthItems: widthItems, refresh: refresh };
|
||||
}
|
||||
window.PJMeetingCells = { init: init };
|
||||
})();
|
||||
|
||||
@@ -2475,6 +2475,9 @@ html.pj-goal-moving, html.pj-goal-moving * { cursor: grabbing !important; user-s
|
||||
@keyframes pj-goal-merge-flash { from { box-shadow: inset 0 0 0 2px var(--pj-accent), inset 0 0 0 999px rgba(123, 104, 238, .14); }
|
||||
to { box-shadow: inset 0 0 0 2px transparent, inset 0 0 0 999px rgba(123, 104, 238, 0); } }
|
||||
@media (prefers-reduced-motion: reduce) { .pj-goal-table tr.is-new-row > *, .pj-goal-table td.is-merge-flash { animation: none; } }
|
||||
/* 주간 회의록 — 줄을 그 자리에서 다시 그린 뒤(refreshMeeting) 새 줄 잠깐 강조(연간 목표와 같은 색) */
|
||||
.pj-meet-table tr.is-new-row > * { animation: pj-goal-row-new 1.4s ease-out; }
|
||||
@media (prefers-reduced-motion: reduce) { .pj-meet-table tr.is-new-row > * { animation: none; } }
|
||||
/* 칸 병합 — 끌어서 고르는 동안 글 선택 막기 */
|
||||
html.pj-goal-selecting, html.pj-goal-selecting * { user-select: none !important; cursor: cell !important; }
|
||||
/* 칸 아무 곳이나 눌러 입력 — 칸 전체가 글 입력 커서(관리자 화면) */
|
||||
|
||||
+145
-29
@@ -10572,6 +10572,7 @@
|
||||
btn.setAttribute("aria-pressed", prevFirst ? "true" : "false");
|
||||
}
|
||||
arrange();
|
||||
table.addEventListener("pj-meet-rows", arrange); // 줄 구조를 다시 끼운 뒤(refreshMeeting) 새 줄도 같은 순서로
|
||||
btn.addEventListener("click", function () {
|
||||
prevFirst = !prevFirst;
|
||||
try { localStorage.setItem(KEY, prevFirst ? "prev" : "this"); } catch (_) {}
|
||||
@@ -11408,7 +11409,10 @@
|
||||
return ta.dataset.field === "result_note" ? "meet:item:" + tr.dataset.prev + ":result_note"
|
||||
: "meet:item:" + tr.dataset.item + ":content";
|
||||
},
|
||||
onSaved: function (ta) { const n = ta.closest("td") || ta; clearSaveFailed(n); flashSaved(n); },
|
||||
onSaved: function (ta) {
|
||||
const n = ta.closest("td") || ta; clearSaveFailed(n); flashSaved(n);
|
||||
if (pendingMeetRefresh && !textSaver.anyDirty()) refreshMeeting().catch(function (err) { showToast(err.message, "error"); });
|
||||
},
|
||||
onClear: function (ta) { clearSaveFailed(ta.closest("td") || ta); },
|
||||
onFail: function (ta, err) { markSaveFailed(ta.closest("td") || ta, err); },
|
||||
});
|
||||
@@ -11433,8 +11437,11 @@
|
||||
if (table) table.querySelectorAll(".pj-meet-text, .pj-meet-rnote").forEach(bindText);
|
||||
if (cellGrid) cellGrid.bindSaver({ flush: flushAll, save: function (ta) { return textSaver.flush(ta); },
|
||||
replace: function (ta, value) { ta.value = value; textSaver.acceptSaved(ta, ta.value); },
|
||||
rowMenu: rowMenu, addRow: function (section, ref, place) { run(function () { return addRow(section, ref, place); }); },
|
||||
reload: reloadKeepScroll });
|
||||
rowMenu: rowMenu,
|
||||
// 주요 업무 칸 메뉴 — 위/아래 줄 추가는 같은 항목 칸 안에(027, 이름을 묻지 않음), 줄 삭제
|
||||
addRow: function (section, ref, place, o) { run(function () { return addRow(section, ref, place, o && o.sameLabel); }); },
|
||||
deleteRow: function (tr) { run(function () { return deleteRow(tr); }); },
|
||||
reload: function () { refreshMeeting().catch(function (err) { showToast("처리 실패: " + err.message, "error"); }); } });
|
||||
if (table && window.PJGoalText) window.PJGoalText.init(table, el("pj-goal-format"));
|
||||
if (restored) showToast("저장되지 않았던 글 " + restored + "칸을 되살려 다시 저장합니다.");
|
||||
else if (conflict) showToast("다른 곳에서 바뀐 칸 " + conflict + "개는 예전 초안을 되살리지 않았습니다.");
|
||||
@@ -11500,41 +11507,150 @@
|
||||
span.addEventListener("blur", onBlur);
|
||||
});
|
||||
|
||||
// ── 줄 메뉴(⋯ · 항목 우클릭) — 위/아래 줄 추가 · 순서 · 삭제 ──
|
||||
// 줄 작업 뒤엔 새로고침 — 그 전에 저장 안 된 칸(대기·진행 중·실패)을 저장하고, 실패하면 작업 자체를 하지 않는다(초안 유지)
|
||||
async function run(fn) {
|
||||
try {
|
||||
await flushAll();
|
||||
if (!(await fn())) return;
|
||||
await flushAll();
|
||||
reloadKeepScroll();
|
||||
} catch (err) { showToast("처리 실패: " + err.message, "error"); }
|
||||
// ── 줄 메뉴(⋯ · 항목 우클릭) — 위/아래 줄 추가 · 순서 · 항목 칸 나누기 · 삭제 ──
|
||||
// 줄 작업 전에 저장 안 된 칸(대기·진행 중·실패)을 저장하고, 실패하면 작업 자체를 하지 않는다(초안 유지).
|
||||
// 작업 뒤엔 새로고침 대신 표만 그 자리에서 다시 그린다(refreshMeeting — 연간 목표 표와 같은 애니메이션).
|
||||
// fn 이 true 면 다시 그리기, { removed: [tr…] } 면 그 줄을 흐리게 지운 뒤 다시 그리기, false 면 아무것도 안 함.
|
||||
let meetStruct = Promise.resolve();
|
||||
function run(fn) {
|
||||
const job = meetStruct.then(async function () { // 줄 작업은 한 번에 하나씩(앞 작업 다시 그리기가 끝난 뒤)
|
||||
try {
|
||||
await flushAll();
|
||||
const r = await fn();
|
||||
if (!r) return;
|
||||
await flushAll();
|
||||
await refreshMeeting(r === true ? {} : r);
|
||||
} catch (err) { showToast("처리 실패: " + err.message, "error"); }
|
||||
});
|
||||
meetStruct = job;
|
||||
return job;
|
||||
}
|
||||
async function addRow(section, ref, place) {
|
||||
// sameLabel(주요 업무 칸에서) = 기준 줄과 같은 항목 칸 안에 — 이름을 묻지 않는다(027)
|
||||
async function addRow(section, ref, place, sameLabel) {
|
||||
if (sameLabel) {
|
||||
await api("POST", meetingUrl + "/items", { section: section, label: "", ref_item_id: ref, place: place, same_label: true });
|
||||
return true;
|
||||
}
|
||||
const v = await prompt("새 줄 이름 (예: 쿠팡 — 비워 둬도 됩니다)", "");
|
||||
if (v == null) return false;
|
||||
await api("POST", meetingUrl + "/items", { section: section, label: String(v).trim(), ref_item_id: ref, place: place });
|
||||
return true;
|
||||
}
|
||||
// 항목 칸 묶음의 첫 줄(이어 붙은 줄이면 위로 거슬러 올라감)·맨 아래 줄
|
||||
function groupHead(tr) {
|
||||
let r = tr;
|
||||
while (r && r.dataset.labelCont === "1" && r.previousElementSibling) r = r.previousElementSibling;
|
||||
return r;
|
||||
}
|
||||
function groupBottom(tr) {
|
||||
const head = groupHead(tr), th = head.querySelector("th.pj-meet-c-label");
|
||||
const rows = Array.from(head.closest("tbody").rows);
|
||||
return rows[Math.min(rows.length - 1, rows.indexOf(head) + ((th && th.rowSpan) || 1) - 1)];
|
||||
}
|
||||
async function deleteRow(tr) {
|
||||
const head = groupHead(tr);
|
||||
const label = ((head.querySelector(".pj-meet-label") || {}).textContent || "").trim();
|
||||
const grouped = groupBottom(tr) !== head;
|
||||
const msg = !grouped ? "'" + (label || "이 줄") + "' 줄을 삭제할까요? 주요 업무·금액도 함께 삭제됩니다."
|
||||
: tr === head ? "'" + (label || "이 항목") + "' 항목의 첫 줄을 삭제할까요? 주요 업무·금액도 함께 삭제되고, 아래 줄이 항목 이름을 이어받습니다."
|
||||
: "'" + (label || "이 항목") + "' 항목의 이 줄을 삭제할까요? 주요 업무·금액도 함께 삭제됩니다.";
|
||||
const ok = await confirm(msg, { okText: "삭제", cancelText: "취소" });
|
||||
if (!ok) return false;
|
||||
await api("DELETE", itemUrl(tr.dataset.item));
|
||||
return { removed: [tr] };
|
||||
}
|
||||
function rowMenu(x, y, tr) {
|
||||
const id = tr.dataset.item, section = tr.dataset.section;
|
||||
const label = (tr.querySelector(".pj-meet-label") || {}).textContent || "";
|
||||
showContextMenu(x, y, [
|
||||
tr = groupHead(tr);
|
||||
const id = tr.dataset.item, section = tr.dataset.section, bottom = groupBottom(tr);
|
||||
const grouped = bottom !== tr;
|
||||
// 항목 칸에서 추가 = 항목 칸 밖에 따로(묶음 맨 위·맨 아래 기준). 묶인 칸은 순서 대신 "항목 칸 나누기"
|
||||
const items = [
|
||||
{ label: "위에 줄 추가", icon: menuIcon("add_row_above"), onClick: function () { run(function () { return addRow(section, id, "above"); }); } },
|
||||
{ label: "아래에 줄 추가", icon: menuIcon("add_row_below"), onClick: function () { run(function () { return addRow(section, id, "below"); }); } },
|
||||
{ label: "위로", icon: menuIcon("arrow_upward"), onClick: function () { run(async function () { await api("POST", itemUrl(id) + "/move", { direction: -1 }); return true; }); } },
|
||||
{ label: "아래로", icon: menuIcon("arrow_downward"), onClick: function () { run(async function () { await api("POST", itemUrl(id) + "/move", { direction: 1 }); return true; }); } },
|
||||
null,
|
||||
{ label: "줄 삭제", danger: true, icon: menuIcon("delete"), onClick: function () {
|
||||
run(async function () {
|
||||
const ok = await confirm("'" + (label.trim() || "이 줄") + "' 줄을 삭제할까요? 주요 업무·금액도 함께 삭제됩니다.",
|
||||
{ okText: "삭제", cancelText: "취소" });
|
||||
if (!ok) return false;
|
||||
await api("DELETE", itemUrl(id));
|
||||
return true;
|
||||
{ label: "아래에 줄 추가", icon: menuIcon("add_row_below"), onClick: function () { run(function () { return addRow(section, bottom.dataset.item, "below"); }); } },
|
||||
];
|
||||
if (grouped) {
|
||||
items.push({ label: "항목 칸 나누기", icon: menuIcon("horizontal_split"), onClick: function () {
|
||||
run(async function () { await api("POST", itemUrl(id) + "/split-label"); return true; });
|
||||
} });
|
||||
} else {
|
||||
items.push(
|
||||
{ label: "위로", icon: menuIcon("arrow_upward"), onClick: function () { run(async function () { await api("POST", itemUrl(id) + "/move", { direction: -1 }); return true; }); } },
|
||||
{ label: "아래로", icon: menuIcon("arrow_downward"), onClick: function () { run(async function () { await api("POST", itemUrl(id) + "/move", { direction: 1 }); return true; }); } });
|
||||
}
|
||||
items.push(null, { label: grouped ? "첫 줄 삭제" : "줄 삭제", danger: true, icon: menuIcon("delete"), onClick: function () {
|
||||
run(function () { return deleteRow(tr); });
|
||||
} });
|
||||
showContextMenu(x, y, items.concat(cellGrid ? [null].concat(cellGrid.widthItems(tr.querySelector("th.pj-meet-c-label"))) : []));
|
||||
}
|
||||
|
||||
// ── 줄 구조가 바뀐 뒤(줄 추가·삭제·이동·항목 칸 나누기·구역 이동·셀 병합) 새로고침 없이 표의 구역 부분만 서버에서 다시 받아
|
||||
// 그 자리에서 바꿔 끼운다(연간 목표 refreshTable 과 같은 방식) — 지운 줄은 흐려지며 사라지고, 남은 줄은 예전 자리에서
|
||||
// 새 자리로 미끄러지고(FLIP), 새 줄은 위에서 내려오며 잠깐 강조. 동작 줄이기 설정이면 애니메이션 없이.
|
||||
// 글 보호: 시작 전에 저장(실패하면 throw — 표는 그대로), 받는 사이에 새로 입력한 글이 있으면 저장 후 다시 받고,
|
||||
// 계속 입력 중이면 바꿔 끼우지 않고 저장이 끝난 뒤 다시 그린다(pendingMeetRefresh). 받아 오기에 실패하면 예전처럼 새로고침.
|
||||
const MEET_ANIM_MS = 280;
|
||||
let pendingMeetRefresh = false;
|
||||
async function refreshMeeting(opts) {
|
||||
opts = opts || {};
|
||||
await flushAll();
|
||||
const reduce = !Element.prototype.animate ||
|
||||
(window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches);
|
||||
const busy = function () {
|
||||
return textSaver.anyDirty() || amtSaver.anyDirty() || !!table.querySelector("[data-meet-edit].is-editing");
|
||||
};
|
||||
let fresh = null, anims = [];
|
||||
for (let tries = 0; ; tries++) {
|
||||
fresh = null;
|
||||
try {
|
||||
const res = await fetch(location.href, { credentials: "same-origin", cache: "no-store" });
|
||||
if (res.ok) fresh = new DOMParser().parseFromString(await res.text(), "text/html").getElementById("pj-meet-table");
|
||||
} catch (_) { fresh = null; }
|
||||
if (!busy() && opts.removed && opts.removed.length && !reduce && !anims.length) {
|
||||
anims = opts.removed.filter(function (tr) { return tr.isConnected; }).map(function (tr) {
|
||||
return tr.animate([{ opacity: 1 }, { opacity: 0 }], { duration: 180, easing: "ease-in", fill: "forwards" });
|
||||
});
|
||||
} },
|
||||
].concat(cellGrid ? [null].concat(cellGrid.widthItems(tr.querySelector("th.pj-meet-c-label"))) : []));
|
||||
await Promise.all(anims.map(function (a) { return a.finished.catch(function () {}); }));
|
||||
}
|
||||
if (!busy()) break;
|
||||
anims.forEach(function (a) { try { a.cancel(); } catch (_) {} });
|
||||
anims = [];
|
||||
if (tries >= 2) {
|
||||
pendingMeetRefresh = true;
|
||||
showToast("입력 중인 칸이 있어 표를 아직 다시 그리지 않았습니다 — 저장되면 다시 그립니다.");
|
||||
return;
|
||||
}
|
||||
await flushAll(); // 받는 동안 새로 입력한 글 — 저장 실패면 throw(표는 그대로)
|
||||
}
|
||||
if (!fresh) { reloadKeepScroll(); return; }
|
||||
pendingMeetRefresh = false;
|
||||
const before = new Map();
|
||||
table.querySelectorAll("tbody.pj-meet-sec > tr[data-item]").forEach(function (tr) {
|
||||
before.set(tr.dataset.item, tr.getBoundingClientRect().top);
|
||||
});
|
||||
table.querySelectorAll("tbody.pj-meet-sec").forEach(function (t) { t.remove(); });
|
||||
fresh.querySelectorAll("tbody.pj-meet-sec").forEach(function (t) { table.appendChild(document.importNode(t, true)); });
|
||||
textSaver.prune();
|
||||
amtSaver.prune();
|
||||
table.querySelectorAll(".pj-meet-text, .pj-meet-rnote").forEach(bindText);
|
||||
table.querySelectorAll("input.pj-meet-amount").forEach(bindAmount);
|
||||
table.dispatchEvent(new CustomEvent("pj-meet-rows")); // 이번주 ↔ 지난주 칸 순서(initMeetOrder)
|
||||
if (cellGrid && cellGrid.refresh) cellGrid.refresh(); // 열 너비 손잡이·이동 테두리·선택
|
||||
if (reduce) return;
|
||||
table.querySelectorAll("tbody.pj-meet-sec > tr[data-item]").forEach(function (tr) {
|
||||
const top = tr.getBoundingClientRect().top;
|
||||
if (before.has(tr.dataset.item)) {
|
||||
const dy = before.get(tr.dataset.item) - top;
|
||||
if (Math.abs(dy) > 1) {
|
||||
tr.animate([{ transform: "translateY(" + dy + "px)" }, { transform: "translateY(0)" }],
|
||||
{ duration: MEET_ANIM_MS, easing: "cubic-bezier(.2,.8,.2,1)" });
|
||||
}
|
||||
} else {
|
||||
tr.animate([{ opacity: 0, transform: "translateY(-10px)" }, { opacity: 1, transform: "translateY(0)" }],
|
||||
{ duration: MEET_ANIM_MS + 40, easing: "cubic-bezier(.2,.8,.2,1)" });
|
||||
tr.classList.add("is-new-row");
|
||||
setTimeout(function () { tr.classList.remove("is-new-row"); }, 1400);
|
||||
}
|
||||
});
|
||||
}
|
||||
// ── 구역 메뉴(구분 칸 ⋯ · 우클릭) — 구역을 통째로 위/아래(그 안의 줄 순서·병합은 그대로), 구역 끝에 줄 추가 ──
|
||||
function secMenu(x, y, tbody) {
|
||||
|
||||
@@ -125,6 +125,18 @@ docker exec postgres-db psql -U postgres -d project_db -c "SELECT to_regclass('g
|
||||
|
||||
설정이 없거나 권한이 모자라면 버튼을 눌렀을 때 사유가 안내되고(503), 회의록 다른 기능은 그대로 동작한다.
|
||||
|
||||
## 주간 회의록 항목 칸 묶음 마이그레이션 (027)
|
||||
|
||||
027은 `goal_meeting_items.label_cont` 열만 추가한다(기본 false, 기존 값 그대로, 다시 실행 가능). 미적용이면 "주요 업무" 칸의
|
||||
같은 항목 칸 줄 추가·항목 칸 나누기만 503 안내, 나머지는 그대로.
|
||||
|
||||
```bash
|
||||
cd /opt/www/main
|
||||
docker exec postgres-db pg_dump -U postgres project_db > ~/project_db_before_027_$(date +%Y%m%d%H%M).sql
|
||||
docker exec -i postgres-db psql -v ON_ERROR_STOP=1 -U postgres -d project_db < scripts/sql/project_db_027_meeting_label_groups.sql
|
||||
docker exec postgres-db psql -U postgres -d project_db -c "SELECT column_name FROM information_schema.columns WHERE table_name='goal_meeting_items' AND column_name='label_cont';"
|
||||
```
|
||||
|
||||
## 실적 수동 입력·열 순서 마이그레이션 (performance_db 002)
|
||||
|
||||
002는 `perf_marketplaces.manual_input` 열(기본 꺼짐) + `perf_manual_sales` 표를 추가하고, 쇼핑몰 순서(`sort_order`)를
|
||||
|
||||
@@ -1196,6 +1196,19 @@ Windows 트레이 프로그램 **DBX 알림**(`desktop/notifier/`, C# .NET Frame
|
||||
행 잠금 안에서 이어진 같은 구역 줄 묶음과 옆 묶음의 자리를 바꾼다(묶음 안 줄 순서·세로 병합 그대로, 맨 끝이면 그대로). 줄 이동과 같은
|
||||
권한(누구나, 회의 완료면 409). 다음 회의록은 `create_meeting` 이 이 순서를 이어받는다. 마이그레이션 없음.
|
||||
|
||||
- **회의록 항목 칸 묶음**(2026-10-12, 마이그레이션 027 `goal_meeting_items.label_cont`): "주요 업무" 칸 우클릭 → 위/아래 줄 추가는
|
||||
**항목 칸은 그대로 두고 그 항목 안에** 줄을 늘린다(`POST …/items {same_label: true}` — 이름을 묻지 않음. 아래 = 새 줄이 이어 붙고,
|
||||
묶음 첫 줄 위 = 새 줄이 첫 줄이 되어 이름을 넘겨받고 기준 줄이 이어 붙음 — 연간 목표 016 과 같은 규칙). 주요 업무 칸 메뉴에 "줄 삭제"(그 한 줄).
|
||||
화면은 묶음 첫 줄 항목 칸 `rowspan`(`router._meeting_label_spans`, 구역 첫 줄은 늘 묶음 첫 줄), 이어 붙은 줄은 `tr[data-label-cont]`.
|
||||
항목 칸 메뉴(우클릭·⋯) = 따로 추가(묶음 맨 위·맨 아래 기준, 이름 물음) · 묶였으면 위로/아래로 대신 **항목 칸 나누기**
|
||||
(`POST /api/goals/meeting-items/{id}/split-label`) · 첫 줄 삭제(아래 줄이 이름을 이어받음). 묶인 줄의 순서 이동은 400.
|
||||
줄마다 주요 업무·정량 목표·연결키(line_key)는 따로라 지난주 리뷰는 줄 단위 그대로, 다음 주 회의록은 묶음을 이어받는다.
|
||||
027 미적용이면 같은 항목 칸 추가·나누기만 503, 나머지는 예전처럼.
|
||||
- **회의록 줄 작업 애니메이션**(2026-10-12): 줄 추가·삭제·이동·항목 칸 나누기·구역 이동·셀 병합/해제 뒤 새로고침 대신 `refreshMeeting` —
|
||||
같은 주소를 다시 받아 표의 구역(`tbody.pj-meet-sec`)만 바꿔 끼우고 저장·셀 도구(`PJMeetingCells.refresh`)·칸 순서(`pj-meet-rows` 이벤트)를
|
||||
다시 붙인다. 지운 줄은 흐려지며 사라지고, 남은 줄은 미끄러지고(FLIP), 새 줄은 내려오며 강조(연간 목표 `refreshTable` 과 같음).
|
||||
저장 안 된 글은 먼저 저장(실패면 작업 안 함), 계속 입력 중이면 저장 뒤 다시 그림, 받아 오기 실패면 새로고침. 줄 작업은 한 번에 하나씩.
|
||||
|
||||
- **회의록 작업 등록 — 새 프로젝트·새 섹션**(2026-10-12): 프로젝트 칸 목록 맨 위 "새 프로젝트"(Pro user 이상만 보임 — `POST /api/projects`,
|
||||
만든 사람이 소유자), 섹션 칸 맨 위 "새 섹션"(그 프로젝트 멤버 — `POST /api/projects/{id}/stages`). 이름만 묻고 만든 뒤 바로 그 칸에 고른다.
|
||||
- **회의록 작업 등록 — 고를 목록**(2026-10-12): 완료 프로젝트(`status = completed`)·완료 섹션(`is_done_stage`)은 목록에서 빼고,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
-- =====================================================================
|
||||
-- project_db 마이그레이션 027 — 주간 회의록: 같은 항목 칸 안에 줄 추가(항목 칸 묶음)
|
||||
-- =====================================================================
|
||||
-- 멱등(idempotent). 열 하나만 추가한다(기존 값 변경·삭제 없음). 운영: /opt/www/main 에서 기존 project_db 에 적용.
|
||||
--
|
||||
-- 왜(2026-10-12 사용자 요청): 회의록 표 "주요 업무" 칸에서 위/아래 줄 추가를 하면 "항목" 칸은 그대로 두고
|
||||
-- 그 항목 안에 줄이 늘어나게(연간 목표 goal_rows.label_cont(016)와 같은 방식).
|
||||
-- label_cont = true 인 줄은 바로 위 줄(같은 구역)의 항목 칸에 이어 붙는다 — 항목 이름은 묶음 첫 줄에만.
|
||||
-- 줄마다 주요 업무·정량 목표·지난주 결과·연결키(line_key)는 따로다. 다음 주차 회의록은 묶음을 그대로 이어받는다.
|
||||
-- =====================================================================
|
||||
BEGIN;
|
||||
|
||||
ALTER TABLE goal_meeting_items ADD COLUMN IF NOT EXISTS label_cont BOOLEAN NOT NULL DEFAULT FALSE;
|
||||
COMMENT ON COLUMN goal_meeting_items.label_cont IS '바로 위 줄(같은 구역)의 항목 칸에 이어 붙는 줄 — 항목 이름은 묶음 첫 줄에';
|
||||
|
||||
COMMIT;
|
||||
SELECT 'project_db 027 meeting label groups ready' AS status;
|
||||
@@ -15,7 +15,8 @@ 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", "meeting_member"].forEach(function (n) {
|
||||
["goals_admin", "goals_ro", "goals_weekly_admin", "meeting_admin", "meeting_err", "meeting_ro", "meeting_member",
|
||||
"meeting_groups", "meeting_groups_added"].forEach(function (n) {
|
||||
PAGE[n] = fs.readFileSync(path.join(OUT, n + ".html"), "utf8");
|
||||
});
|
||||
const GOALS_URL = "http://localhost/project/goals/2026";
|
||||
@@ -355,21 +356,25 @@ function meetServer(env, st) {
|
||||
// 첫 열(구분) — 구역 통째로 위/아래(우클릭·⋯), 맨 위는 "위로" 없음, 구역 첫 줄 id 로 요청
|
||||
await section(async function () {
|
||||
const env = makeEnv(PAGE.meeting_admin, MEET_URL);
|
||||
meetServer(env);
|
||||
const st = meetServer(env);
|
||||
await boot(env);
|
||||
const blocks = Array.from(env.d.querySelectorAll("tbody.pj-meet-sec"));
|
||||
blocks[0].querySelector("th.pj-meet-c-sec").dispatchEvent(new env.w.MouseEvent("contextmenu", { bubbles: true, cancelable: true, clientX: 5, clientY: 5 }));
|
||||
let labels = Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).map(itemLabel);
|
||||
check("[1e] 첫 구역 우클릭 — 구역 아래로·구역 끝에 줄 추가(위로 없음)",
|
||||
labels.indexOf("구역 아래로") >= 0 && labels.indexOf("구역 위로") < 0 && labels.indexOf("구역 끝에 줄 추가") >= 0, labels);
|
||||
const gets0 = st.gets || 0; // 부팅 때 실적 자동 갱신이 이미 한 번 받는다
|
||||
Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).find(function (b) { return itemLabel(b) === "구역 아래로"; }).click();
|
||||
await settle(); await wait(20); await settle();
|
||||
const firstId = blocks[0].querySelector("tr[data-item]").dataset.item;
|
||||
const call = env.calls.find(function (c) { return /\/move-section$/.test(c.url); });
|
||||
check("[1e] 구역 아래로 → 그 구역 첫 줄로 move-section(direction 1) 후 새로고침",
|
||||
// 2026-10-12 — 새로고침 대신 표만 서버에서 다시 받아 그 자리에서 바꿔 끼운다(연간 목표와 같은 애니메이션)
|
||||
check("[1e] 구역 아래로 → 그 구역 첫 줄로 move-section(direction 1) 후 표만 다시 받음(새로고침 없음)",
|
||||
!!call && call.method === "POST" && call.url.indexOf("/meeting-items/" + firstId + "/move-section") >= 0 &&
|
||||
call.body.direction === 1 && env.navigations === 1, [call, env.navigations]);
|
||||
const last = blocks[blocks.length - 1];
|
||||
call.body.direction === 1 && env.navigations === 0 && st.gets === gets0 + 1 &&
|
||||
!blocks[0].isConnected && env.d.querySelectorAll("tbody.pj-meet-sec").length === blocks.length, [call, env.navigations, st.gets]);
|
||||
const fresh = Array.from(env.d.querySelectorAll("tbody.pj-meet-sec"));
|
||||
const last = fresh[fresh.length - 1];
|
||||
last.querySelector('[data-meet-act="sec-menu"]').click();
|
||||
labels = Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).map(itemLabel);
|
||||
check("[1e] 마지막 구역 ⋯ — 구역 위로(아래로 없음)", labels.indexOf("구역 위로") >= 0 && labels.indexOf("구역 아래로") < 0, labels);
|
||||
@@ -1205,18 +1210,23 @@ function meetServer(env, st) {
|
||||
const request = env.calls.find(c => /\/meeting-cells\/merge$/.test(c.url));
|
||||
check("[회의록 병합] 선택한 주의 줄 ID로 요청", request.body.item_from === "2" && request.body.item_to === "3");
|
||||
env.route("POST", /\/meeting-cells\/merge$/, () => ({ body: { ok: true } }));
|
||||
const gets0 = st.gets || 0;
|
||||
b.dispatchEvent(new env.w.MouseEvent("contextmenu", { bubbles: true, cancelable: true }));
|
||||
Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).find(n => itemLabel(n).startsWith("셀 병합")).click(); await settle();
|
||||
check("[회의록 병합] 저장 성공 뒤 화면을 다시 받음", env.navigations === 1);
|
||||
await wait(20); await settle();
|
||||
check("[회의록 병합] 저장 성공 뒤 표만 다시 받음(새로고침 없음)", env.navigations === 0 && st.gets === gets0 + 1, [env.navigations, st.gets]);
|
||||
});
|
||||
|
||||
await section(async function () {
|
||||
const env = makeEnv(fs.readFileSync(path.join(OUT, "meeting_merged.html"), "utf8"), MEET_URL); meetServer(env); await boot(env);
|
||||
const env = makeEnv(fs.readFileSync(path.join(OUT, "meeting_merged.html"), "utf8"), MEET_URL); const st = meetServer(env); await boot(env);
|
||||
const gets0 = st.gets || 0;
|
||||
const a = env.d.querySelector('td[data-meet-item="2"]');
|
||||
check("[회의록 병합 화면] 첫 셀만 표시하고 숫자 칸 유지", a.rowSpan === 2 && !env.d.querySelector('td[data-meet-item="3"]') && env.d.querySelectorAll('.pj-meet-amount[data-field="target_amount"]').length === 3);
|
||||
a.dispatchEvent(new env.w.MouseEvent("contextmenu", { bubbles: true, cancelable: true }));
|
||||
Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).find(n => itemLabel(n) === "병합 해제").click(); await settle();
|
||||
check("[회의록 병합 해제] 첫 셀 ID로 요청하고 화면 갱신", env.calls.some(c => c.method === "DELETE" && /\/meeting-items\/2\/cell-merge$/.test(c.url)) && env.navigations === 1);
|
||||
await wait(20); await settle();
|
||||
check("[회의록 병합 해제] 첫 셀 ID로 요청하고 표만 다시 받음", env.calls.some(c => c.method === "DELETE" && /\/meeting-items\/2\/cell-merge$/.test(c.url)) &&
|
||||
env.navigations === 0 && st.gets === gets0 + 1, [env.navigations, st.gets]);
|
||||
check("[회의록 병합 해제] 요청 중 합쳐진 글 보존", a.textContent.includes("병합한 계획"));
|
||||
});
|
||||
|
||||
@@ -1303,6 +1313,69 @@ function meetServer(env, st) {
|
||||
check("[서식 혼합] 초기화는 모든 서식 제거·내용 보존", editor.value === "작은큰");
|
||||
});
|
||||
|
||||
// ════════════════════ [2h] 항목 칸 묶음(027) — 주요 업무 칸 줄 추가는 같은 항목 칸 안에 · 표만 다시 그리며 애니메이션 ════════════════════
|
||||
await section(async function () {
|
||||
const env = makeEnv(PAGE.meeting_groups, MEET_URL);
|
||||
const st = meetServer(env, { page: PAGE.meeting_groups });
|
||||
// jsdom 에는 Web Animations 가 없다 — 있는 것처럼(애니메이션 경로·새 줄 강조 확인용)
|
||||
const animated = [];
|
||||
env.w.Element.prototype.animate = function (frames) { animated.push([this, frames]); return { finished: Promise.resolve(), cancel: function () {} }; };
|
||||
const posts = [];
|
||||
env.route("POST", /\/project\/api\/goals\/meetings\/2026-09-28\/items$/, function (u, body) {
|
||||
posts.push(body); st.page = PAGE.meeting_groups_added; return { status: 201, body: { ok: true, id: 9 } };
|
||||
});
|
||||
await boot(env);
|
||||
const gets0 = st.gets || 0;
|
||||
const head = env.d.querySelector('tr[data-item="2"] th.pj-meet-c-label');
|
||||
check("[2h] 묶음 첫 줄 항목 칸 rowspan=2 · 이어 붙은 줄은 항목 칸 없음",
|
||||
head && head.rowSpan === 2 && !env.d.querySelector('tr[data-item="3"] th.pj-meet-c-label') &&
|
||||
env.d.querySelector('tr[data-item="3"]').dataset.labelCont === "1");
|
||||
const td = env.d.querySelector('td[data-meet-item="2"]');
|
||||
td.dispatchEvent(new env.w.MouseEvent("contextmenu", { bubbles: true, cancelable: true, clientX: 5, clientY: 5 }));
|
||||
let labels = Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).map(itemLabel);
|
||||
check("[2h] 주요 업무 칸 메뉴 — 위/아래 줄 추가 · 줄 삭제", labels.indexOf("위에 줄 추가") >= 0 && labels.indexOf("아래에 줄 추가") >= 0 &&
|
||||
labels.indexOf("줄 삭제") >= 0, labels);
|
||||
const prompts = env.prompts.length;
|
||||
const oldRow2 = env.d.querySelector('tr[data-item="2"]');
|
||||
Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).find(function (b) { return itemLabel(b) === "아래에 줄 추가"; }).click();
|
||||
await settle(); await wait(20); await settle();
|
||||
check("[2h] 아래에 줄 추가 → 같은 항목 칸(same_label)·이름 안 물음", posts.length === 1 && posts[0].same_label === true &&
|
||||
String(posts[0].ref_item_id) === "2" && posts[0].place === "below" && env.prompts.length === prompts, posts);
|
||||
check("[2h] 새로고침 없이 표만 다시 받아 바꿔 끼움", env.navigations === 0 && st.gets === gets0 + 1 && !oldRow2.isConnected &&
|
||||
!!env.d.querySelector('tr[data-item="9"]'), [env.navigations, st.gets]);
|
||||
const head2 = env.d.querySelector('tr[data-item="2"] th.pj-meet-c-label');
|
||||
check("[2h] 항목 칸은 그대로(rowspan 3) — 새 줄에 항목 칸 없음", head2 && head2.rowSpan === 3 &&
|
||||
!env.d.querySelector('tr[data-item="9"] th.pj-meet-c-label'));
|
||||
const row9 = env.d.querySelector('tr[data-item="9"]');
|
||||
check("[2h] 새 줄 — 내려오며 나타나고 잠깐 강조", row9.classList.contains("is-new-row") &&
|
||||
animated.some(function (a) { return a[0] === row9 && a[1][0].opacity === 0; }));
|
||||
// 다시 끼운 칸도 저장이 연결됨(새 줄 주요 업무 입력 → 그 줄로 PUT)
|
||||
const ta9 = row9.querySelector(".pj-meet-text");
|
||||
ta9.focus(); type(env, ta9, "새 줄 업무"); ta9.blur();
|
||||
await settle(); await wait(20); await settle();
|
||||
check("[2h] 다시 끼운 새 줄도 저장 연결", st.items[9] && st.items[9].content === "새 줄 업무", st.items[9]);
|
||||
// 항목 칸 메뉴(묶음) — 순서 대신 항목 칸 나누기, 아래 추가는 묶음 맨 아래 줄 기준(항목 칸 밖에 따로)
|
||||
env.d.querySelector('tr[data-item="2"] th.pj-meet-c-label').dispatchEvent(new env.w.MouseEvent("contextmenu", { bubbles: true, cancelable: true, clientX: 5, clientY: 5 }));
|
||||
labels = Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).map(itemLabel);
|
||||
check("[2h] 묶인 항목 칸 메뉴 — 항목 칸 나누기·첫 줄 삭제(위로·아래로 없음)", labels.indexOf("항목 칸 나누기") >= 0 &&
|
||||
labels.indexOf("첫 줄 삭제") >= 0 && labels.indexOf("위로") < 0 && labels.indexOf("아래로") < 0, labels);
|
||||
Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).find(function (b) { return itemLabel(b) === "아래에 줄 추가"; }).click();
|
||||
await settle(); await wait(20); await settle();
|
||||
check("[2h] 항목 칸에서 아래 줄 추가 → 묶음 맨 아래 줄(3) 기준·따로(같은 항목 아님)·이름 물음",
|
||||
posts.length === 2 && String(posts[1].ref_item_id) === "3" && !posts[1].same_label && env.prompts.length === prompts + 1, posts[1]);
|
||||
// 이어 붙은 줄의 주요 업무 칸 → 줄 삭제(흐려지며 사라진 뒤 다시 그림)
|
||||
let deleted = null;
|
||||
env.route("DELETE", /\/project\/api\/goals\/meeting-items\/\d+$/, function (u) { deleted = u; return { body: { ok: true } }; });
|
||||
const gets = st.gets;
|
||||
const row3 = env.d.querySelector('tr[data-item="3"]');
|
||||
row3.querySelector('td[data-meet-item="3"]').dispatchEvent(new env.w.MouseEvent("contextmenu", { bubbles: true, cancelable: true, clientX: 5, clientY: 5 }));
|
||||
Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).find(function (b) { return itemLabel(b) === "줄 삭제"; }).click();
|
||||
await settle(); await wait(20); await settle();
|
||||
check("[2h] 주요 업무 칸 줄 삭제 → 그 줄 DELETE · 흐려짐 · 표 다시 받음",
|
||||
/\/meeting-items\/3$/.test(deleted || "") && animated.some(function (a) { return a[0] === row3 && a[1][1].opacity === 0; }) &&
|
||||
st.gets === gets + 1 && env.navigations === 0, [deleted, st.gets]);
|
||||
});
|
||||
|
||||
clearTimeout(WATCHDOG);
|
||||
const realUnhandled = unhandled.filter(function (m) { return !/Not implemented/.test(m); });
|
||||
check("처리 안 된 Promise 거부 없음", realUnhandled.length === 0, realUnhandled);
|
||||
|
||||
@@ -19,7 +19,7 @@ sys.path.insert(0, ROOT)
|
||||
OUT_DIR = os.path.join(ROOT, "tests", "js", ".out")
|
||||
|
||||
from app.modules.project import store # noqa: E402
|
||||
from app.modules.project.router import _goal_area_layout, _goal_label_spans # noqa: E402
|
||||
from app.modules.project.router import _goal_area_layout, _goal_label_spans, _meeting_label_spans # noqa: E402
|
||||
|
||||
BASE_STUB = ("{% block head_extra %}{% endblock %}<body>{% block topbar_after_logout %}{% endblock %}{% block topbar_actions %}{% endblock %}"
|
||||
"<main class='erp-page'>{% block content %}{% endblock %}</main></body>")
|
||||
@@ -151,6 +151,22 @@ def meeting_merged_ctx() -> dict:
|
||||
return ctx
|
||||
|
||||
|
||||
def meeting_groups_ctx(added: bool = False) -> dict:
|
||||
"""항목 칸 묶음(027) — 상품 구역: 상품1(묶음 첫 줄) + 이어 붙은 줄(id 3, label_cont) — 실제 라우터 도우미로 칸 계산.
|
||||
added = 상품1 아래에 같은 항목 칸으로 줄(id 9)을 추가한 뒤의 화면(다시 받기 응답)."""
|
||||
ctx = meeting_ctx(True, False, can_sync=False)
|
||||
rows = ctx["meeting"]["sections"][0]["rows"]
|
||||
rows[1].update(label="", label_cont=True)
|
||||
if added:
|
||||
new = copy.deepcopy(rows[1])
|
||||
new.update(id=9, content="", target_amount=None, prev=None)
|
||||
rows.insert(1, new)
|
||||
ctx["meeting"]["items"].insert(1, new)
|
||||
for sec in ctx["meeting"]["sections"]:
|
||||
_meeting_label_spans(sec["rows"])
|
||||
return ctx
|
||||
|
||||
|
||||
def main() -> None:
|
||||
env = jinja2.Environment(loader=jinja2.ChoiceLoader([
|
||||
jinja2.DictLoader({"erp_base.html": BASE_STUB}),
|
||||
@@ -171,6 +187,8 @@ def main() -> None:
|
||||
"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()),
|
||||
"meeting_groups.html": ("project/goal_meeting.html", meeting_groups_ctx()),
|
||||
"meeting_groups_added.html": ("project/goal_meeting.html", meeting_groups_ctx(added=True)),
|
||||
"meeting_content_admin.html": ("project/goal_meeting.html", meeting_ctx(True, False, can_sync=False) | {"meeting_embedded": True}),
|
||||
"meeting_content_ro.html": ("project/goal_meeting.html", meeting_ctx(False, False, can_sync=False) | {"meeting_embedded": True}),
|
||||
}
|
||||
|
||||
@@ -1196,6 +1196,78 @@ def test_review_meeting_section_move():
|
||||
_drop_meetings([w1, w2])
|
||||
|
||||
|
||||
def test_review_meeting_label_groups():
|
||||
"""항목 칸 묶음(027) — 주요 업무 칸에서 추가(same_label)는 같은 항목 칸 안에(아래 = 이어 붙음, 묶음 첫 줄 위 = 새 줄이
|
||||
첫 줄·이름 넘겨받음), 화면은 항목 칸 rowspan, 묶인 줄은 순서 이동 거절, 다음 주 회의록이 묶음을 이어받음,
|
||||
첫 줄 삭제 = 아래 줄이 이름을 이어받음, 항목 칸 나누기, 회의 완료 뒤 잠금."""
|
||||
from app.modules.project import store
|
||||
|
||||
w1 = store.month_weeks(2032, 2)[1][0]
|
||||
w2 = store.week_period(w1)[1] + timedelta(days=1)
|
||||
_drop_meetings([w1, w2])
|
||||
try:
|
||||
_create_meeting(w1)
|
||||
rows = lambda w=w1: ST.get_meeting(week_start=w)["items"] # noqa: E731
|
||||
a = rows()[0]
|
||||
url = f"/project/api/goals/meetings/{w1}/items"
|
||||
r = req("POST", url, BOB, json={"section": a["section"], "ref_item_id": a["id"], "place": "below", "same_label": True})
|
||||
assert r.status_code == 201, r.text
|
||||
b_id = r.json()["id"]
|
||||
cur = rows()
|
||||
k = [x["id"] for x in cur].index(a["id"])
|
||||
assert cur[k + 1]["id"] == b_id and cur[k + 1]["label_cont"] and cur[k + 1]["label"] == "" and not cur[k]["label_cont"]
|
||||
# 묶음 첫 줄 위 → 새 줄이 첫 줄(이름 넘겨받음), 기준 줄은 이어 붙음
|
||||
r = req("POST", url, BOB, json={"section": a["section"], "ref_item_id": a["id"], "place": "above", "same_label": True})
|
||||
assert r.status_code == 201, r.text
|
||||
c_id = r.json()["id"]
|
||||
cur = rows()
|
||||
ids = [x["id"] for x in cur]
|
||||
k = ids.index(c_id)
|
||||
assert ids[k:k + 3] == [c_id, a["id"], b_id], ids
|
||||
assert cur[k]["label"] == a["label"] and not cur[k]["label_cont"]
|
||||
assert cur[k + 1]["label"] == "" and cur[k + 1]["label_cont"] and cur[k + 2]["label_cont"]
|
||||
# 줄마다 연결키는 따로(지난주 리뷰가 줄 단위로 이어짐)
|
||||
assert len({cur[k + n]["line_key"] for n in range(3)}) == 3
|
||||
# 화면 — 회의록 화면이 그려지고(이 테스트 환경은 템플릿을 실제로 그리지 않음 — 표 모양은 jsdom [2h]),
|
||||
# 화면용 묶음 계산(라우터 도우미) = 항목 칸 rowspan 3 · 이어 붙은 줄은 항목 칸 없음
|
||||
from app.modules.project.router import _meeting_label_spans
|
||||
page = req("GET", f"/project/goals/{w1.year}/meetings/{w1.month}?week={w1}&content=1", BOB)
|
||||
assert page.status_code == 200, page.text[:300]
|
||||
sec_rows = [x for x in rows() if x["section"] == a["section"]]
|
||||
_meeting_label_spans(sec_rows)
|
||||
spans = {x["id"]: (x.get("label_span"), x["label_hidden"], x["label_shown"]) for x in sec_rows}
|
||||
assert spans[c_id][:2] == (3, False) and spans[a["id"]][1] and spans[b_id][1], spans
|
||||
assert spans[b_id][2] == a["label"]
|
||||
# 묶인 줄은 옮길 수 없다(항목 칸을 나눈 뒤)
|
||||
r = req("POST", f"/project/api/goals/meeting-items/{a['id']}/move", BOB, json={"direction": 1})
|
||||
assert r.status_code == 400 and "항목 칸" in r.text, r.text
|
||||
# 같은 항목 칸 추가는 기준 줄이 필요
|
||||
assert req("POST", url, BOB, json={"section": a["section"], "same_label": True}).status_code == 400
|
||||
# 다음 주 회의록 — 묶음을 그대로 이어받음(연결키 기준)
|
||||
_create_meeting(w2)
|
||||
by_key = {x["line_key"]: x for x in rows(w2)}
|
||||
assert [bool(by_key[cur[k + n]["line_key"]]["label_cont"]) for n in range(3)] == [False, True, True]
|
||||
assert by_key[cur[k]["line_key"]]["label"] == a["label"]
|
||||
# 첫 줄(c) 삭제 → 바로 아래 줄(a)이 첫 줄이 되고 이름을 이어받음
|
||||
assert req("DELETE", f"/project/api/goals/meeting-items/{c_id}", BOB).status_code == 200
|
||||
cur = rows()
|
||||
k = [x["id"] for x in cur].index(a["id"])
|
||||
assert not cur[k]["label_cont"] and cur[k]["label"] == a["label"] and cur[k + 1]["id"] == b_id and cur[k + 1]["label_cont"]
|
||||
# 항목 칸 나누기 → b 가 따로(이름 빈 칸)
|
||||
r = req("POST", f"/project/api/goals/meeting-items/{a['id']}/split-label", BOB)
|
||||
assert r.status_code == 200 and r.json()["split"] == 1, r.text
|
||||
cur = rows()
|
||||
k = [x["id"] for x in cur].index(b_id)
|
||||
assert not cur[k]["label_cont"] and cur[k]["label"] == ""
|
||||
assert req("POST", f"/project/api/goals/meeting-items/{a['id']}/move", BOB, json={"direction": 1}).status_code == 200
|
||||
# 회의 완료 뒤 잠금
|
||||
ST.set_meeting_completed(week_start=w1, done=True, by=ADMIN)
|
||||
assert req("POST", url, BOB, json={"section": a["section"], "ref_item_id": a["id"], "place": "below",
|
||||
"same_label": True}).status_code == 409
|
||||
finally:
|
||||
_drop_meetings([w1, w2])
|
||||
|
||||
|
||||
def _clear_quick(*weeks) -> None:
|
||||
"""작업 등록 표 테스트 주차 비우기(로컬 테스트 DB — 앞선 실패한 실행의 줄이 남지 않게)."""
|
||||
with ST._pool.connection() as conn: # noqa: SLF001
|
||||
|
||||
Reference in New Issue
Block a user