feat(project): meeting task table - pick an existing task to add a subtask; title opens task panel
- New "작업" column (migration 026 parent_task_id): empty = new task in the section, chosen task = register as its subtask (candidates = open main tasks of that section) - Server validates the task belongs to the project, clears it when the project changes, and rejects apply if the chosen task was deleted/moved - Removed the in-table subtask rows (hover button, Tab/Shift+Tab, right-click) from UI/API - Registered row title opens the task editor on the right (iframe ?embed=1, waits for the task window to save before switching/closing, like the inbox panel) - Help + docs (DEPLOYMENT 026); tests (real PostgreSQL, jsdom) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1196,12 +1196,19 @@ def test_review_meeting_section_move():
|
||||
_drop_meetings([w1, w2])
|
||||
|
||||
|
||||
def _clear_quick(*weeks) -> None:
|
||||
"""작업 등록 표 테스트 주차 비우기(로컬 테스트 DB — 앞선 실패한 실행의 줄이 남지 않게)."""
|
||||
with ST._pool.connection() as conn: # noqa: SLF001
|
||||
conn.execute("DELETE FROM goal_meeting_tasks WHERE week_start = ANY(%s)", (list(weeks),))
|
||||
|
||||
|
||||
def test_review_meeting_quick_tasks_shared():
|
||||
"""작업 등록 표(025) — 주차별 한 표를 모두가 같이 본다. 남의 프로젝트 이름은 가리고, [적용]은 동시에 눌러도 작업 하나."""
|
||||
from app.modules.project import store
|
||||
|
||||
w = store.month_weeks(2031, 12)[1][0]
|
||||
other = store.month_weeks(2031, 12)[2][0]
|
||||
_clear_quick(w, other)
|
||||
p = _project("P-quick", ADMIN, (BOB,))
|
||||
s = _stage(p["id"], by=ADMIN)
|
||||
done = _stage(p["id"], name="완료", done=True, by=ADMIN)
|
||||
@@ -1229,9 +1236,10 @@ def test_review_meeting_quick_tasks_shared():
|
||||
assert t["stage_id"] == s["id"] and t["assignee_email"] == BOB
|
||||
# 등록된 줄은 더 못 고침(409), 다시 [적용]해도 그대로
|
||||
assert req("PUT", f"/project/api/goals/meeting-quick-tasks/{row['id']}", BOB, json={"title": "x"}).status_code == 409
|
||||
# 세부 작업 줄 — 위 줄의 작업 밑에 만든다(섹션 없음)
|
||||
r = req("POST", url, BOB, json={"title": "세부 하나", "project_id": p["id"], "parent_id": row["id"]})
|
||||
# 작업 칸 — 방금 만든 작업을 고르면 그 작업의 세부 작업으로(섹션 없음)
|
||||
r = req("POST", url, BOB, json={"title": "세부 하나", "project_id": p["id"], "parent_task_id": tid})
|
||||
sub = r.json()["task"]
|
||||
assert sub["parent_task_id"] == tid and sub["parent_task_title"] == "상세페이지 수정2"
|
||||
r = req("POST", f"/project/api/goals/meeting-quick-tasks/{sub['id']}/apply", BOB)
|
||||
assert r.status_code == 201, r.text
|
||||
st_ = ST.get_task(task_id=r.json()["task"]["task_id"])
|
||||
@@ -1246,39 +1254,35 @@ def test_review_meeting_quick_tasks_shared():
|
||||
finally:
|
||||
_drop_meetings([w])
|
||||
assert req("DELETE", f"/project/api/goals/meeting-quick-tasks/{row['id']}", BOB).status_code == 200
|
||||
assert req("GET", url, BOB).json()["tasks"] == [] # 세부 작업 줄도 함께
|
||||
assert req("DELETE", f"/project/api/goals/meeting-quick-tasks/{sub['id']}", BOB).status_code == 200
|
||||
assert req("GET", url, BOB).json()["tasks"] == []
|
||||
_ = done
|
||||
|
||||
|
||||
def test_review_meeting_quick_subtask_rows():
|
||||
"""세부 작업 줄 — 한 단계만, Tab(위 줄 밑으로)·Shift+Tab, [적용]은 위 줄 작업 밑에(위 줄 프로젝트)."""
|
||||
def test_review_meeting_quick_parent_task_column():
|
||||
"""작업 칸(026) — 그 프로젝트의 작업만, 프로젝트를 바꾸면 비움, 고른 작업이 사라지면 [적용] 400."""
|
||||
from app.modules.project import store
|
||||
|
||||
w = store.month_weeks(2032, 1)[1][0]
|
||||
p = _project("P-quick-sub", ADMIN, (BOB,))
|
||||
_clear_quick(w)
|
||||
p = _project("P-quick-pt", ADMIN, (BOB,))
|
||||
q = _project("P-quick-pt2", ADMIN, (BOB,))
|
||||
s = _stage(p["id"], by=ADMIN)
|
||||
base = ST.create_task(project_id=p["id"], title="기존 작업", stage_id=s["id"], created_by=ADMIN)
|
||||
other = ST.create_task(project_id=q["id"], title="다른 프로젝트 작업", created_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"] == []
|
||||
assert req("POST", url, BOB, json={"title": "x", "project_id": p["id"], "parent_task_id": other["id"]}).status_code == 400
|
||||
row = req("POST", url, BOB, json={"title": "세부", "project_id": p["id"], "parent_task_id": base["id"]}).json()["task"]
|
||||
assert row["parent_task_id"] == base["id"]
|
||||
moved = put(row["id"], {"project_id": q["id"]}).json()["task"]
|
||||
assert moved["parent_task_id"] is None and moved["stage_id"] is None # 프로젝트가 바뀌면 작업·섹션을 비움
|
||||
assert put(row["id"], {"project_id": p["id"], "parent_task_id": base["id"]}).json()["task"]["parent_task_id"] == base["id"]
|
||||
# 고른 작업이 지워지면 [적용]은 400(줄은 그대로)
|
||||
ST.delete_task(task_id=base["id"], deleted_by=ADMIN)
|
||||
assert req("POST", f"/project/api/goals/meeting-quick-tasks/{row['id']}/apply", BOB).status_code == 400
|
||||
assert req("GET", url, BOB).json()["tasks"][0]["task_id"] is None
|
||||
req("DELETE", f"/project/api/goals/meeting-quick-tasks/{row['id']}", BOB)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user