feat(project): 섹션째 다른 프로젝트로 · 회의록 글 칸 하이퍼링크 · 업무 등록 표 하위 업무·줄 클릭 업무 창
- 보드 섹션 머리를 왼쪽 프로젝트 목록에 놓으면 확인 창 → POST /api/stages/{id}/move-project
(db.move_stage_to_project 한 트랜잭션: 섹션 + 업무 + 세부 업무, 대상 맨 끝, 원·대상 멤버만, 남의 연결은 원 프로젝트에 섹션 없음)
- 목표·회의록 글 칸 서식 도구 🔗 — pj-rich 조각 link(http(s)만, 서버 store.goal_link), 주소 붙여넣기 = 링크, Ctrl+클릭 = 새 탭
- 회의록 업무 등록 표: 등록된 줄 [+] = 바로 아래 세부 업무 초안, 세부 업무 줄은 상위 줄 아래 들여쓰기,
등록된 줄 어디든 클릭 = 오른쪽 업무 창, ↳ 상위 = 상위 업무 창
- 도움말·CLAUDE.md·PROJECT_MODULE.md 6-26, 정적 파일 버전 20261026a
- 테스트: test_move_stage_to_other_project(실제 PG), 링크 서버 검증, project_ui [섹션 이동], goals_meeting_ui [2g5],
goal_text_link.browser.test.js
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1606,6 +1606,56 @@ def test_move_task_to_other_project():
|
||||
assert BOB in r2.json()["unseen"] # 담당자가 B 멤버가 아님 — 화면이 안내
|
||||
|
||||
|
||||
def test_move_stage_to_other_project():
|
||||
"""섹션째 다른 프로젝트로(2026-10-26) — 섹션 + 업무 + 세부 업무(모든 단계), 섹션은 맨 끝, 연결 정리, 권한."""
|
||||
a = _project("P-smA", ADMIN, (ALICE, BOB))
|
||||
b = _project("P-smB", ADMIN, (ALICE,))
|
||||
c = _project("P-smC", ADMIN, (BOB,)) # ALICE 는 멤버 아님
|
||||
sa = _stage(a["id"], name="옮길 섹션", by=ADMIN)
|
||||
sa2 = _stage(a["id"], name="남는 섹션", by=ADMIN)
|
||||
_stage(b["id"], name="B 기존", by=ADMIN)
|
||||
sb2 = _stage(b["id"], name="B 둘째", by=ADMIN)
|
||||
t = ST.create_task(project_id=a["id"], title="섹션 업무", stage_id=sa["id"], assignee_email=BOB, created_by=ALICE)
|
||||
sub = ST.create_task(project_id=a["id"], title="세부", parent_task_id=t["id"], created_by=ALICE)
|
||||
subsub = ST.create_task(project_id=a["id"], title="세부의 세부", parent_task_id=sub["id"], created_by=ALICE)
|
||||
stay = ST.create_task(project_id=a["id"], title="남는 업무", stage_id=sa2["id"], created_by=ALICE)
|
||||
# 대상 프로젝트로 걸린 연결(→ 원 소속이 되니 지움) · C 업무가 이 섹션에 연결(→ A 에 "섹션 없음"으로 남음)
|
||||
assert req("POST", f"/project/api/tasks/{t['id']}/links", ALICE, json={"project_id": b["id"], "stage_id": sb2["id"]}).status_code == 201
|
||||
ct = ST.create_task(project_id=c["id"], title="C 업무", created_by=BOB)
|
||||
assert req("POST", f"/project/api/tasks/{ct['id']}/links", BOB, json={"project_id": a["id"], "stage_id": sa["id"]}).status_code == 201
|
||||
url = f"/project/api/stages/{sa['id']}/move-project"
|
||||
# 권한·검증 — 대상 비멤버 403, 원 프로젝트 비멤버 403, 같은 프로젝트 400, 없는 섹션 404
|
||||
assert req("POST", url, ALICE, json={"project_id": c["id"]}).status_code == 403
|
||||
assert req("POST", f"/project/api/stages/{sb2['id']}/move-project", BOB, json={"project_id": a["id"]}).status_code == 403
|
||||
assert req("POST", url, ALICE, json={"project_id": a["id"]}).status_code == 400
|
||||
assert req("POST", url, ALICE, json={}).status_code == 400
|
||||
assert req("POST", "/project/api/stages/99999999/move-project", ALICE, json={"project_id": b["id"]}).status_code == 404
|
||||
assert ST.get_stage(stage_id=sa["id"])["project_id"] == a["id"]
|
||||
# 이동
|
||||
r = req("POST", url, ALICE, json={"project_id": b["id"]})
|
||||
assert r.status_code == 200, r.text
|
||||
body = r.json()
|
||||
assert body["stage"]["project_id"] == b["id"] and body["task_count"] == 1
|
||||
assert body["stage"]["sort_order"] > sb2["sort_order"] # 대상 프로젝트 맨 끝
|
||||
assert BOB in body["unseen"] # 담당자 BOB 은 B 멤버가 아님
|
||||
for tid in (t["id"], sub["id"], subsub["id"]):
|
||||
assert ST.get_task(task_id=tid)["project_id"] == b["id"]
|
||||
moved = ST.get_task(task_id=t["id"])
|
||||
assert moved["stage_id"] == sa["id"] and moved["assignee_email"] == BOB # 섹션·담당자 그대로
|
||||
assert ST.get_task(task_id=stay["id"])["project_id"] == a["id"] # 다른 섹션 업무는 그대로
|
||||
assert _count("SELECT COUNT(*) AS n FROM task_project_links WHERE task_id=%s AND project_id=%s", t["id"], b["id"]) == 0
|
||||
assert _count("SELECT COUNT(*) AS n FROM task_project_links WHERE task_id=%s AND project_id=%s AND stage_id IS NULL",
|
||||
ct["id"], a["id"]) == 1
|
||||
assert _count("SELECT COUNT(*) AS n FROM project_activity WHERE task_id=%s AND action='project_moved' AND project_id=%s",
|
||||
t["id"], b["id"]) == 1
|
||||
assert sa["id"] in [s["id"] for s in ST.list_stages(project_id=b["id"])]
|
||||
assert sa["id"] not in [s["id"] for s in ST.list_stages(project_id=a["id"])]
|
||||
# 빈 섹션도 옮겨진다(이력은 프로젝트에만)
|
||||
empty = _stage(a["id"], name="빈 섹션", by=ADMIN)
|
||||
r2 = req("POST", f"/project/api/stages/{empty['id']}/move-project", ALICE, json={"project_id": b["id"]})
|
||||
assert r2.status_code == 200 and r2.json()["task_count"] == 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not ENABLED:
|
||||
print("SKIP: PROJECT_TEST_DB_URL(localhost) not set")
|
||||
|
||||
Reference in New Issue
Block a user