fix(project): 업무 편집 팝업 레이아웃 고정 + 내 업무에 담당 하위 업무 트리 표시
- 업무 편집 팝업: 상단 고정 버튼 바 높이를 40px로 고정해 제목을 가리지 않게 하고, 하위 업무가 늘어나도 메타/첨부/댓글 등 기존 기능이 찌그러져 숨지 않도록 모달 본문 전체를 세로 스크롤하게 변경 - 내 업무: 내가 담당자로 지정된 하위 업무를 목록에 반영해 부모 업무 아래에 폴더 트리 접속선으로 이어서 표시(부모가 내 업무가 아니면 안내 행으로 먼저 표시) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -402,6 +402,31 @@ class ProjectStore:
|
||||
).fetchall()
|
||||
return [self._serialize(r) for r in rows]
|
||||
|
||||
def list_my_tasks(self, *, assignee_email: str, limit: int = 1000) -> list[dict[str, Any]]:
|
||||
""""내 업무" 화면 전용 — 내가 담당자인 업무를 레벨(최상위/하위) 상관없이
|
||||
전부 반환한다. 하위 업무 행에는 부모 업무 정보(`parent_title` 등)를 같이
|
||||
붙여서, 부모가 내 업무가 아니어도(다른 사람 담당) 화면에서 트리로 묶어
|
||||
보여줄 수 있게 한다.
|
||||
"""
|
||||
email = store.norm_str(assignee_email, lower=True)
|
||||
with self._pool.connection() as conn:
|
||||
rows = conn.execute(
|
||||
f"SELECT t.*, p.name AS project_name, p.color AS project_color, "
|
||||
f" s.name AS stage_name, s.is_done_stage, "
|
||||
f" (SELECT COUNT(*) FROM task_comments c WHERE c.task_id = t.id) AS comment_count, "
|
||||
f" {self._SUBTASK_COUNTS_SQL}, "
|
||||
f" pt.title AS parent_title, pt.completed_at AS parent_completed_at, "
|
||||
f" pt.assignee_email AS parent_assignee_email "
|
||||
f"FROM tasks t "
|
||||
f"JOIN projects p ON p.id = t.project_id "
|
||||
f"LEFT JOIN project_stages s ON s.id = t.stage_id "
|
||||
f"LEFT JOIN tasks pt ON pt.id = t.parent_task_id "
|
||||
f"WHERE t.assignee_email = %s "
|
||||
"ORDER BY t.sort_order ASC, t.id ASC LIMIT %s",
|
||||
(email, int(limit)),
|
||||
).fetchall()
|
||||
return [self._serialize(r) for r in rows]
|
||||
|
||||
def get_task(self, *, task_id: int) -> dict[str, Any] | None:
|
||||
with self._pool.connection() as conn:
|
||||
row = conn.execute(
|
||||
|
||||
@@ -423,7 +423,7 @@ async def my_tasks_page(request: Request) -> HTMLResponse:
|
||||
nav_projects = _nav_projects(st, user, admin)
|
||||
|
||||
today_iso = today_kst().isoformat()
|
||||
my_tasks = st.list_tasks(assignee_email=user["email"], limit=1000)
|
||||
my_tasks = st.list_my_tasks(assignee_email=user["email"], limit=1000)
|
||||
for t in my_tasks:
|
||||
t["start_label"] = _fmt_date_kr(t.get("start_date"))
|
||||
t["due_label"] = _fmt_date_kr(t.get("due_date"))
|
||||
@@ -960,7 +960,7 @@ async def api_list_tasks(request: Request, project_id: int) -> JSONResponse:
|
||||
async def api_my_tasks(request: Request) -> JSONResponse:
|
||||
user = _require_user(request)
|
||||
st = _db_or_503(request)
|
||||
return JSONResponse({"tasks": st.list_tasks(assignee_email=user["email"], limit=1000)})
|
||||
return JSONResponse({"tasks": st.list_my_tasks(assignee_email=user["email"], limit=1000)})
|
||||
|
||||
|
||||
@router.post("/api/projects/{project_id}/tasks")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260922g" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260922i" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -93,5 +93,5 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/project.js?v=20260922g" defer></script>
|
||||
<script src="/static/project.js?v=20260922i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260922g" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260922i" />
|
||||
<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=20260922g" defer></script>
|
||||
<script src="/static/project.js?v=20260922i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260922g" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20260922i" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -460,5 +460,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20260922g" defer></script>
|
||||
<script src="/static/project.js?v=20260922i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user