feat(project): 작업 팝업의 하위 작업 줄을 아사나식으로(드래그 순서·아이콘·날짜)

- ⠿ 손잡이로 끌어 하위 작업 순서 변경
  (PUT /project/api/tasks/{id}/subtasks/order → db.reorder_subtasks)
- 담당자는 아이콘만(아바타/점선 원), 누르면 아이콘+이름 메뉴
- 마감일은 날짜 글자만(없으면 점선 달력 아이콘), 누르면 아사나식 날짜 팝업
- 제목 칸은 글자 길이만큼, 줄의 빈 곳을 누르면 하위 작업 열기
- 완료는 ✓ 아이콘, 삭제는 우클릭 메뉴로(줄의 × 제거)
- 정적 파일 버전 20260925g

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 19:44:39 +09:00
parent ea15c90a61
commit 3620482913
9 changed files with 294 additions and 77 deletions
+11
View File
@@ -1277,6 +1277,17 @@ class ProjectStore:
([int(i) for i in ordered_ids], stage_id),
)
def reorder_subtasks(self, *, parent_task_id: int, ordered_ids: list[int]) -> None:
"""작업 팝업의 하위 작업 목록 드래그 재정렬 — 이 상위 작업의 하위 작업만
0부터 다시 매긴다(목록은 parent_task_id 로 먼저 거른 뒤 sort_order 순)."""
with self._pool.connection() as conn:
conn.execute(
"UPDATE tasks t SET sort_order = v.ord - 1 "
"FROM unnest(%s::bigint[]) WITH ORDINALITY AS v(id, ord) "
"WHERE t.id = v.id AND t.parent_task_id = %s",
([int(i) for i in ordered_ids], parent_task_id),
)
# ════════════════════════════════════════════════════════════
# 알림센터 (project_notifications)
# ════════════════════════════════════════════════════════════
+22
View File
@@ -1359,6 +1359,28 @@ def api_get_task(request: Request, task_id: int) -> JSONResponse:
return JSONResponse({"task": task})
@router.put("/api/tasks/{task_id}/subtasks/order")
def api_reorder_subtasks(
request: Request, task_id: int, payload: dict[str, Any] = Body(...)
) -> JSONResponse:
"""작업 팝업의 하위 작업 목록을 드래그로 재정렬. body: {"ordered_ids": [...]}"""
user = _require_user(request)
st = _db_or_503(request)
parent = st.get_task(task_id=task_id)
if parent is None:
raise HTTPException(status_code=404, detail="작업을 찾을 수 없습니다.")
_require_manage(request, st, user, parent["project_id"])
ids = payload.get("ordered_ids") or []
if not isinstance(ids, list) or not ids:
raise HTTPException(status_code=400, detail="ordered_ids 가 필요합니다.")
try:
ordered = [int(i) for i in ids]
except (TypeError, ValueError):
raise HTTPException(status_code=400, detail="ordered_ids 가 올바르지 않습니다.")
st.reorder_subtasks(parent_task_id=task_id, ordered_ids=ordered)
return JSONResponse({"ok": True})
@router.post("/api/tasks/{task_id}/move-parent")
def api_move_subtask(
request: Request,
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925f" />
<link rel="stylesheet" href="/static/project.css?v=20260925g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -99,5 +99,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260925f" defer></script>
<script src="/static/project.js?v=20260925g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925f" />
<link rel="stylesheet" href="/static/project.css?v=20260925g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -98,5 +98,5 @@
"today": {{ today | tojson }}
}
</script>
<script src="/static/project.js?v=20260925f" defer></script>
<script src="/static/project.js?v=20260925g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925f" />
<link rel="stylesheet" href="/static/project.css?v=20260925g" />
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
<!-- 타임라인 vis-timeline — self-host -->
@@ -465,5 +465,5 @@
</script>
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
<script src="/static/project.js?v=20260925f" defer></script>
<script src="/static/project.js?v=20260925g" defer></script>
{% endblock %}
@@ -1,7 +1,7 @@
{% extends "erp_base.html" %}
{% block head_extra %}
<link rel="stylesheet" href="/static/project.css?v=20260925f" />
<link rel="stylesheet" href="/static/project.css?v=20260925g" />
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
{% endblock %}
@@ -68,5 +68,5 @@
{% include "project/_side_modals.html" %}
{% include "project/_member_tasks_modal.html" %}
<script src="/static/project.js?v=20260925f" defer></script>
<script src="/static/project.js?v=20260925g" defer></script>
{% endblock %}