feat(project): 용어 "업무" 통일·섹션 담당자 바로 지정·세부 업무 협업자·반응 알림
- 화면·메시지·알림 제목·도움말의 "작업" → "업무"(조사 포함). 큰 알림 팝업·PC 알림 소스는 예전 "작업 배정:" 접두어도 뗀다 - 보드·목록 섹션 제목 오른쪽 담당자 아이콘을 눌러 기본 담당자를 그 자리에서 지정 - 섹션을 접으면 제목 보통 굵기, 펼치면 다시 굵게 - 업무 창 세부 업무 줄 담당자 오른쪽에 협업자 지정(subtasks[].followers, list_followers_of) - 댓글 이모티콘 반응을 켜면 댓글 쓴 사람에게 어떤 이모티콘인지 수신함 알림(type=reaction) - 왼쪽 전체 보기의 기본 보기는 대시보드 - 대시보드 업무 목록 패널에서 연 업무 창은 패널 왼쪽에 열림 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+32
-16
@@ -698,12 +698,12 @@ class ProjectStore:
|
||||
"SELECT project_id FROM tasks WHERE id = %s", (parent_task_id,)
|
||||
).fetchone()
|
||||
if not parent:
|
||||
raise KeyError(f"상위 작업을 찾을 수 없습니다: {parent_task_id}")
|
||||
raise KeyError(f"상위 업무를 찾을 수 없습니다: {parent_task_id}")
|
||||
# 권한은 URL 의 project_id 로 검사했으므로, 부모가 다른 프로젝트
|
||||
# 업무면 거부한다(예전엔 부모 프로젝트로 조용히 바꿔 권한 없는
|
||||
# 프로젝트에 세부 업무를 만들 수 있었다).
|
||||
if int(parent["project_id"]) != int(project_id):
|
||||
raise ValueError("상위 작업이 이 프로젝트에 속하지 않습니다.")
|
||||
raise ValueError("상위 업무가 이 프로젝트에 속하지 않습니다.")
|
||||
stage_id = None
|
||||
elif stage_id not in (None, ""):
|
||||
stage_id = self._check_stage_in_project(conn, stage_id, project_id)
|
||||
@@ -776,19 +776,19 @@ class ProjectStore:
|
||||
(task_id,),
|
||||
).fetchone()
|
||||
if not sub:
|
||||
raise KeyError(f"작업을 찾을 수 없습니다: {task_id}")
|
||||
raise KeyError(f"업무를 찾을 수 없습니다: {task_id}")
|
||||
if sub["parent_task_id"] is None:
|
||||
raise ValueError("세부 작업만 다른 작업으로 옮길 수 있습니다.")
|
||||
raise ValueError("세부 업무만 다른 업무로 옮길 수 있습니다.")
|
||||
parent = conn.execute(
|
||||
"SELECT id, project_id, parent_task_id, title FROM tasks WHERE id = %s",
|
||||
(parent_task_id,),
|
||||
).fetchone()
|
||||
if not parent:
|
||||
raise KeyError(f"상위 작업을 찾을 수 없습니다: {parent_task_id}")
|
||||
raise KeyError(f"상위 업무를 찾을 수 없습니다: {parent_task_id}")
|
||||
if parent["parent_task_id"] is not None:
|
||||
raise ValueError("세부 작업 안으로는 옮길 수 없습니다.")
|
||||
raise ValueError("세부 업무 안으로는 옮길 수 없습니다.")
|
||||
if int(parent["project_id"]) != int(sub["project_id"]):
|
||||
raise ValueError("다른 프로젝트의 작업으로는 옮길 수 없습니다.")
|
||||
raise ValueError("다른 프로젝트의 업무로는 옮길 수 없습니다.")
|
||||
if int(parent["id"]) != int(sub["parent_task_id"]):
|
||||
nxt = conn.execute(
|
||||
"SELECT COALESCE(MAX(sort_order), -1) + 1 AS n FROM tasks "
|
||||
@@ -1073,23 +1073,23 @@ class ProjectStore:
|
||||
payload = tr["payload"] or {}
|
||||
tasks = list(payload.get("tasks") or [])
|
||||
if not tasks:
|
||||
raise ValueError("복구할 작업 데이터가 없습니다.")
|
||||
raise ValueError("복구할 업무 데이터가 없습니다.")
|
||||
ids = [int(t["id"]) for t in tasks]
|
||||
clash = conn.execute(
|
||||
"SELECT id FROM tasks WHERE id = ANY(%s) LIMIT 1", (ids,)
|
||||
).fetchone()
|
||||
if clash:
|
||||
raise ValueError(f"이미 같은 작업(id {clash['id']})이 있어 복구할 수 없습니다.")
|
||||
raise ValueError(f"이미 같은 업무(id {clash['id']})이 있어 복구할 수 없습니다.")
|
||||
project_ids = {int(r["id"]) for r in conn.execute("SELECT id FROM projects").fetchall()}
|
||||
stage_ids = {int(r["id"]) for r in conn.execute("SELECT id FROM project_stages").fetchall()}
|
||||
root = next((t for t in tasks if int(t["id"]) == int(tr["task_id"])), tasks[0])
|
||||
if int(root["project_id"]) not in project_ids:
|
||||
raise ValueError("작업이 속했던 프로젝트가 삭제되어 복구할 수 없습니다.")
|
||||
raise ValueError("업무가 속했던 프로젝트가 삭제되어 복구할 수 없습니다.")
|
||||
parent = root.get("parent_task_id")
|
||||
if parent and int(parent) not in ids:
|
||||
ok = conn.execute("SELECT 1 FROM tasks WHERE id = %s", (int(parent),)).fetchone()
|
||||
if not ok:
|
||||
raise ValueError("상위 작업이 없어 복구할 수 없습니다 — 상위 작업을 먼저 복구하세요.")
|
||||
raise ValueError("상위 업무가 없어 복구할 수 없습니다 — 상위 업무를 먼저 복구하세요.")
|
||||
for t in tasks:
|
||||
if t.get("stage_id") is not None and int(t["stage_id"]) not in stage_ids:
|
||||
t["stage_id"] = None
|
||||
@@ -1881,6 +1881,22 @@ class ProjectStore:
|
||||
).fetchall()
|
||||
return [r["user_email"] for r in rows]
|
||||
|
||||
def list_followers_of(self, *, task_ids: list[int]) -> dict[int, list[str]]:
|
||||
"""여러 업무의 협업자를 한 번에 — 업무 창 세부 업무 줄의 협업자 아이콘용."""
|
||||
ids = [int(i) for i in task_ids]
|
||||
if not ids:
|
||||
return {}
|
||||
with self._pool.connection() as conn:
|
||||
rows = conn.execute(
|
||||
"SELECT task_id, user_email FROM task_followers WHERE task_id = ANY(%s) "
|
||||
"ORDER BY created_at ASC, user_email ASC",
|
||||
(ids,),
|
||||
).fetchall()
|
||||
out: dict[int, list[str]] = {i: [] for i in ids}
|
||||
for r in rows:
|
||||
out[int(r["task_id"])].append(r["user_email"])
|
||||
return out
|
||||
|
||||
def add_followers(self, *, task_id: int, emails: list[str]) -> list[str]:
|
||||
"""팔로워 추가(이미 있으면 무시). 새로 추가된 이메일만 돌려준다."""
|
||||
targets = store.normalize_emails(emails)
|
||||
@@ -3479,7 +3495,7 @@ class ProjectStore:
|
||||
if "title" in fields:
|
||||
t = store.norm_str(fields.get("title"))
|
||||
if len(t) > 200:
|
||||
raise ValueError("작업 제목은 200자 이하로 입력하세요.")
|
||||
raise ValueError("업무 제목은 200자 이하로 입력하세요.")
|
||||
clean["title"] = t
|
||||
if "assignee_email" in fields:
|
||||
clean["assignee_email"] = store.norm_str(fields.get("assignee_email") or "", lower=True)
|
||||
@@ -3513,12 +3529,12 @@ class ProjectStore:
|
||||
try:
|
||||
tid = int(raw)
|
||||
except (TypeError, ValueError):
|
||||
raise ValueError("작업 값이 올바르지 않습니다.")
|
||||
raise ValueError("업무 값이 올바르지 않습니다.")
|
||||
if pid is None:
|
||||
raise ValueError("프로젝트를 먼저 고르세요.")
|
||||
t = conn.execute("SELECT project_id FROM tasks WHERE id = %s", (tid,)).fetchone()
|
||||
if t is None or int(t["project_id"]) != int(pid):
|
||||
raise ValueError("이 프로젝트의 작업이 아닙니다.")
|
||||
raise ValueError("이 프로젝트의 업무가 아닙니다.")
|
||||
clean["parent_task_id"] = tid
|
||||
return clean
|
||||
|
||||
@@ -3588,7 +3604,7 @@ class ProjectStore:
|
||||
raise KeyError(item_id)
|
||||
self._check_meeting_open(conn, row["week_start"])
|
||||
if row["task_id"] is not None:
|
||||
raise store.GoalCellConflict("이미 [적용]해 작업으로 만든 줄입니다. 새로고침해 주세요.")
|
||||
raise store.GoalCellConflict("이미 [적용]해 업무로 만든 줄입니다. 새로고침해 주세요.")
|
||||
clean = self._mt_clean(conn, fields, project_id=row["project_id"])
|
||||
if not clean:
|
||||
return
|
||||
@@ -3631,7 +3647,7 @@ class ProjectStore:
|
||||
if parent_task is not None:
|
||||
t = conn.execute("SELECT project_id FROM tasks WHERE id = %s", (parent_task,)).fetchone()
|
||||
if t is None or use["project_id"] is None or int(t["project_id"]) != int(use["project_id"]):
|
||||
raise ValueError("고른 작업이 없어졌거나 다른 프로젝트로 옮겨졌습니다. 작업 칸을 다시 고르세요.")
|
||||
raise ValueError("고른 업무가 없어졌거나 다른 프로젝트로 옮겨졌습니다. 업무 칸을 다시 고르세요.")
|
||||
use = {**use, "stage_id": None}
|
||||
task = create(use, parent_task)
|
||||
conn.execute("UPDATE goal_meeting_tasks SET task_id = %s, updated_at = now() WHERE id = %s",
|
||||
|
||||
Reference in New Issue
Block a user