feat(project): 담당자는 협업자에서 제외·세부 업무 추가 칸 아이콘·내 업무 오른쪽 창

- 협업자 = 담당자 외의 멤버: add_followers 가 담당자를 거르고, 담당자 지정 시 같은 트랜잭션에서 협업자에서 뺌, 담당자 협업자 추가는 400
- 마이그레이션 028: 이미 겹친 task_followers 행 정리(스키마 변경 없음, 멱등)
- 업무 창 세부 업무 추가 칸: 담당자·협업자·마감일을 동그라미 아이콘 버튼으로, 제목 칸을 넓게
- 내 업무 화면: 줄 클릭 시 화면 이동 없이 오른쪽 업무 창(iframe), 닫으면 목록 다시 받기
- 대시보드 "미완료 업무 합계(섹션별)" 카드 삭제

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-13 14:24:51 +09:00
parent 5bd0a5c406
commit f36f7d3ad4
21 changed files with 365 additions and 74 deletions
+14 -2
View File
@@ -918,6 +918,8 @@ class ProjectStore:
store.validate_date_range(final("start_date"), final("due_date"),
final("start_time"), final("due_time"))
conn.execute(f"UPDATE tasks SET {', '.join(sets)} WHERE id = %s", (*params, task_id))
if "assignee_email" in assignee_fields:
self._drop_assignee_follower(conn, task_id, assignee_fields["assignee_email"])
if newly_assigned:
self._log(conn, project_id=prev["project_id"], task_id=task_id,
actor=actor, action=store.ACTION_ASSIGNED,
@@ -986,6 +988,8 @@ class ProjectStore:
params.append(now_kst())
newly_completed = True
conn.execute(f"UPDATE tasks SET {', '.join(sets)} WHERE id = %s", (*params, task_id))
if newly_assigned:
self._drop_assignee_follower(conn, task_id, newly_assigned)
conn.execute(
"DELETE FROM task_project_links WHERE task_id = ANY(%s) AND project_id = %s", (ids, target))
conn.execute("UPDATE project_activity SET project_id = %s WHERE task_id = ANY(%s)", (target, ids))
@@ -1993,7 +1997,8 @@ class ProjectStore:
return out
def add_followers(self, *, task_id: int, emails: list[str]) -> list[str]:
"""팔로워 추가(이미 있으면 무시). 새로 추가된 이메일만 돌려준다."""
"""팔로워 추가(이미 있으면 무시). 새로 추가된 이메일만 돌려준다.
그 업무의 담당자는 넣지 않는다 — 협업자는 담당자 외의 멤버(2026-10-13)."""
targets = store.normalize_emails(emails)
if not targets:
return []
@@ -2001,11 +2006,18 @@ class ProjectStore:
rows = conn.execute(
"INSERT INTO task_followers (task_id, user_email) "
"SELECT %s, e FROM unnest(%s::text[]) AS e "
"WHERE e <> COALESCE((SELECT lower(assignee_email) FROM tasks WHERE id = %s), '') "
"ON CONFLICT DO NOTHING RETURNING user_email",
(task_id, targets),
(task_id, targets, task_id),
).fetchall()
return [r["user_email"] for r in rows]
def _drop_assignee_follower(self, conn: Any, task_id: int, email: str) -> None:
"""새 담당자는 협업자에서 뺀다(같은 트랜잭션). 008 미적용이면 건너뜀."""
if email and self._table_exists(conn, "task_followers"):
conn.execute("DELETE FROM task_followers WHERE task_id = %s AND user_email = %s",
(task_id, store.norm_str(email, lower=True)))
def remove_follower(self, *, task_id: int, user_email: str) -> None:
with self._pool.connection() as conn:
conn.execute(
+7 -6
View File
@@ -1514,8 +1514,9 @@ def _create_task_for(
raise HTTPException(status_code=400, detail=str(exc))
except KeyError as exc:
raise HTTPException(status_code=404, detail=str(exc))
# 만든 사람·담당자는 자동 팔로워(아사나와 같은 규칙) + 만들 때 고른 협업자(세부 업무 추가 칸 등)
_follow(st, task["id"], [user["email"], task.get("assignee_email") or ""] + followers)
# 만든 사람은 자동 협업자 + 만들 때 고른 협업자(세부 업무 추가 칸 등). 담당자는 협업자가 아니다(2026-10-13,
# db.add_followers 가 담당자를 거른다 — 만든 사람이 담당자여도 빠진다).
_follow(st, task["id"], [user["email"]] + followers)
# 생성과 동시에 담당자 지정 시 관리자 메일 + 담당자 인앱 알림
if task.get("assignee_email"):
_notify(
@@ -1603,8 +1604,7 @@ def api_update_task(
project_name = task.get("project_name") or ""
project = st.get_project(project_id=existing["project_id"]) or {"id": existing["project_id"], "name": project_name}
if task.get("_newly_assigned"):
_follow(st, task_id, [task["_newly_assigned"]])
if task.get("_newly_assigned"): # 담당자는 협업자가 아니다 — db.update_task 가 협업자에서 뺐다(2026-10-13)
_notify(
bg, request,
subject=store.build_subject_assigned(
@@ -1775,8 +1775,7 @@ def api_move_task_project(
raise HTTPException(status_code=404, detail=str(exc))
task.pop("_moved_ids", None)
newly_assigned = task.pop("_newly_assigned", None)
if newly_assigned: # 대상 섹션 기본 담당자가 자동 배정됨 — 일반 배정과 같은 알림
_follow(st, task["id"], [newly_assigned])
if newly_assigned: # 대상 섹션 기본 담당자가 자동 배정됨 — 일반 배정과 같은 알림(담당자는 협업자가 아님)
_inbox(
st, recipients=[newly_assigned], actor=user["email"], project_id=target, task_id=task["id"],
ntype="assigned", title=f"업무 배정: {task['title']}",
@@ -1829,6 +1828,8 @@ def api_add_follower(
st = _db_or_503(request)
task = _task_for_followers(request, st, user, task_id)
email = store.norm_str(payload.get("email") or user["email"], lower=True)
if email and email == store.norm_str(task.get("assignee_email") or "", lower=True):
raise HTTPException(status_code=400, detail="담당자는 협업자로 지정할 수 없습니다(협업자는 담당자 외의 멤버).")
if email != store.norm_str(user["email"], lower=True):
if not access.can_assign(st, email, task["project_id"]):
raise HTTPException(status_code=400, detail="이 프로젝트 멤버만 협업자로 추가할 수 있습니다.")
@@ -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=20261013c" />
<link rel="stylesheet" href="/static/project.css?v=20261013d" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -298,5 +298,5 @@
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
<script src="/static/project-meeting-cells.js?v=20261012a" defer></script>
<script src="/static/project.js?v=20261013c" defer></script>
<script src="/static/project.js?v=20261013d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013c" />
<link rel="stylesheet" href="/static/project.css?v=20261013d" />
<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=20261013c" defer></script>
<script src="/static/project.js?v=20261013d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013c" />
<link rel="stylesheet" href="/static/project.css?v=20261013d" />
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013c" />
<link rel="stylesheet" href="/static/project.css?v=20261013d" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -102,5 +102,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20261013c" defer></script>
<script src="/static/project.js?v=20261013d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013c" />
<link rel="stylesheet" href="/static/project.css?v=20261013d" />
<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=20261013c" defer></script>
<script src="/static/project.js?v=20261013d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013c" />
<link rel="stylesheet" href="/static/project.css?v=20261013d" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -108,5 +108,5 @@
});
})();
</script>
<script src="/static/project.js?v=20261013c" defer></script>
<script src="/static/project.js?v=20261013d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013c" />
<link rel="stylesheet" href="/static/project.css?v=20261013d" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -469,5 +469,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20261013c" defer></script>
<script src="/static/project.js?v=20261013d" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20261013c" />
<link rel="stylesheet" href="/static/project.css?v=20261013d" />
<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=20261013c" defer></script>
<script src="/static/project.js?v=20261013d" defer></script>
{% endblock %}