feat(project): subtask rows and a wide view for the meeting task table
- Subtask rows (one level, parent_id): hover button / right-click to add, Tab to make a row the subtask of the row above, Shift+Tab to move it back; inherits the parent's project, no section - Apply on a subtask row creates the task under the parent row's task (server-checked) - "크게 열기" moves the same table into a wide window (same rows and saves), Esc/x to close - Server: PUT parent_id with one-level rules; add rejects grandchildren - Help + docs; tests (real PostgreSQL rules + parent apply, jsdom rows/Tab/wide view) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user