feat(project): subtask rows and a wide view for the meeting task table
- Subtask rows (one level, parent_id): hover button / right-click to add, Tab to make a row the subtask of the row above, Shift+Tab to move it back; inherits the parent's project, no section - Apply on a subtask row creates the task under the parent row's task (server-checked) - "크게 열기" moves the same table into a wide window (same rows and saves), Esc/x to close - Server: PUT parent_id with one-level rules; add rejects grandchildren - Help + docs; tests (real PostgreSQL rules + parent apply, jsdom rows/Tab/wide view) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3443,9 +3443,12 @@ class ProjectStore:
|
||||
self._check_meeting_open(conn, week_start)
|
||||
clean = self._mt_clean(conn, fields)
|
||||
if parent_id is not None:
|
||||
par = conn.execute("SELECT week_start FROM goal_meeting_tasks WHERE id = %s", (parent_id,)).fetchone()
|
||||
par = conn.execute("SELECT week_start, parent_id FROM goal_meeting_tasks WHERE id = %s",
|
||||
(parent_id,)).fetchone()
|
||||
if par is None or par["week_start"] != week_start:
|
||||
raise ValueError("위 줄이 이 주차 표에 없습니다.")
|
||||
if par["parent_id"] is not None:
|
||||
raise ValueError("세부 작업 줄 밑으로는 넣을 수 없습니다(한 단계만).")
|
||||
nxt = conn.execute("SELECT COALESCE(MAX(sort_order), -1) + 1 AS n FROM goal_meeting_tasks "
|
||||
"WHERE week_start = %s", (week_start,)).fetchone()["n"]
|
||||
return int(conn.execute(
|
||||
@@ -3470,6 +3473,25 @@ class ProjectStore:
|
||||
if row["task_id"] is not None:
|
||||
raise store.GoalCellConflict("이미 [적용]해 작업으로 만든 줄입니다. 새로고침해 주세요.")
|
||||
clean = self._mt_clean(conn, fields, project_id=row["project_id"])
|
||||
if "parent_id" in fields:
|
||||
# 세부 작업 줄로(Tab)·위 단계로(Shift+Tab) — 한 단계만: 위 줄은 같은 주차의 맨 위 단계 줄,
|
||||
# 자기 밑에 세부 작업 줄이 있는 줄은 세부 작업 줄이 될 수 없다.
|
||||
raw = fields.get("parent_id")
|
||||
try:
|
||||
pid = int(raw) if raw not in (None, "") else None
|
||||
except (TypeError, ValueError):
|
||||
raise ValueError("위 줄 값이 올바르지 않습니다.")
|
||||
if pid is not None:
|
||||
par = conn.execute("SELECT week_start, parent_id FROM goal_meeting_tasks WHERE id = %s",
|
||||
(pid,)).fetchone()
|
||||
if pid == item_id or par is None or par["week_start"] != row["week_start"]:
|
||||
raise ValueError("위 줄이 이 주차 표에 없습니다.")
|
||||
if par["parent_id"] is not None:
|
||||
raise ValueError("세부 작업 줄 밑으로는 넣을 수 없습니다(한 단계만).")
|
||||
if conn.execute("SELECT 1 FROM goal_meeting_tasks WHERE parent_id = %s LIMIT 1",
|
||||
(item_id,)).fetchone():
|
||||
raise ValueError("세부 작업 줄이 딸린 줄은 세부 작업이 될 수 없습니다.")
|
||||
clean["parent_id"] = pid
|
||||
if not clean:
|
||||
return
|
||||
sets = ", ".join(f"{k} = %s" for k in clean)
|
||||
@@ -3506,12 +3528,16 @@ class ProjectStore:
|
||||
if row["task_id"] is not None:
|
||||
return item_id, False
|
||||
parent_task = None
|
||||
use = self._mt_row(row)
|
||||
if row["parent_id"] is not None:
|
||||
par = conn.execute("SELECT task_id FROM goal_meeting_tasks WHERE id = %s", (row["parent_id"],)).fetchone()
|
||||
# 세부 작업 줄 — 위 줄이 만든 작업 밑에, 그 작업의 프로젝트로(줄의 프로젝트 칸은 쓰지 않는다)
|
||||
par = conn.execute("SELECT m.task_id, t.project_id FROM goal_meeting_tasks m "
|
||||
"LEFT JOIN tasks t ON t.id = m.task_id WHERE m.id = %s", (row["parent_id"],)).fetchone()
|
||||
parent_task = par["task_id"] if par else None
|
||||
if parent_task is None:
|
||||
if parent_task is None or par["project_id"] is None:
|
||||
raise ValueError("위 줄(상위 작업)을 먼저 [적용]하세요.")
|
||||
task = create(self._mt_row(row), parent_task)
|
||||
use = {**use, "project_id": int(par["project_id"]), "stage_id": None}
|
||||
task = create(use, parent_task)
|
||||
conn.execute("UPDATE goal_meeting_tasks SET task_id = %s, updated_at = now() WHERE id = %s",
|
||||
(int(task["id"]), item_id))
|
||||
return item_id, True
|
||||
|
||||
@@ -3820,7 +3820,10 @@ def api_add_quick_task(request: Request, week_start: str, payload: dict[str, Any
|
||||
def api_update_quick_task(request: Request, item_id: int, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
user = _require_user(request)
|
||||
st = _db_or_503(request)
|
||||
row = _goal_call(st.update_meeting_task, item_id=item_id, fields=_quick_fields(st, user, payload), by=user["email"])
|
||||
fields = _quick_fields(st, user, payload)
|
||||
if "parent_id" in payload: # 세부 작업 줄로(Tab)·위 단계로(Shift+Tab) — 한 단계만(저장소가 검사)
|
||||
fields["parent_id"] = payload["parent_id"]
|
||||
row = _goal_call(st.update_meeting_task, item_id=item_id, fields=fields, by=user["email"])
|
||||
return JSONResponse({"task": _quick_view(st, user, [row])[0]})
|
||||
|
||||
|
||||
|
||||
@@ -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=20261012d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -119,7 +119,8 @@
|
||||
{# 작업 등록 — 주차마다 한 표를 서버에(025, 모두가 같은 표 — project.js initMeetQuickTasks). 제목 = "N주차 작업 등록", 회의 완료면 읽기 전용 #}
|
||||
{% set qw = weeks | selectattr("start", "equalto", week) | first %}
|
||||
<section class="pj-meet-area pj-meet-quick" id="pj-meet-quick" data-week="{{ week }}"{% if qw and qw.now %} data-now="1"{% endif %}{% if meeting and meeting.completed %} data-locked="1"{% endif %}>
|
||||
<h3>{% if week_n %}<span class="pj-meet-quick-week">{{ week_n }}주차</span> {% endif %}작업 등록 <small>제목을 쓰고 담당자·프로젝트·섹션 칸을 눌러 고른 뒤 [적용]</small></h3>
|
||||
<h3>{% if week_n %}<span class="pj-meet-quick-week">{{ week_n }}주차</span> {% endif %}작업 등록 <small>제목 → 담당자·프로젝트·섹션 → [적용] · ↳ 또는 Tab = 세부 작업</small>
|
||||
<button type="button" class="pj-btn pj-btn-sm pj-meet-quick-expand" data-quick="expand" title="넓은 창에서 작업·세부 작업 등록(같은 표)"><span class="material-symbols-outlined">open_in_full</span>크게 열기</button></h3>
|
||||
<div class="pj-meet-area-body">
|
||||
<table class="pj-meet-quick-table">
|
||||
<thead><tr><th>제목</th><th>담당자</th><th>프로젝트</th><th>섹션</th><th></th></tr></thead>
|
||||
@@ -294,5 +295,5 @@
|
||||
|
||||
<script src="/static/project-goal-text.js?v=20261003d" defer></script>
|
||||
<script src="/static/project-meeting-cells.js?v=20261007a" defer></script>
|
||||
<script src="/static/project.js?v=20261012h" defer></script>
|
||||
<script src="/static/project.js?v=20261012i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
|
||||
<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=20261012h" defer></script>
|
||||
<script src="/static/project.js?v=20261012i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
|
||||
<link rel="stylesheet" href="/static/project-help.css?v=20261003a" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
@@ -636,7 +636,9 @@
|
||||
<h3 id="meetings-kpis">위쪽 3칸 — 월 계획·숫자, 결정 사항, 작업 등록</h3>
|
||||
<p>제목 아래 세 칸은 표를 스크롤해도 그대로 보입니다. 왼쪽은 <b>월 계획</b>이고 그 머리 줄 오른쪽에 숫자 4개(월 목표 · 누적 목표 · 누적 실적 · 목표 대비)가 작게 한 줄로 나옵니다(목표 표 매출 단위, 예: 백만원 — 숫자에 마우스를 올리면 원 단위 금액과 뜻). 가운데는 <b>결정사항</b>(진행상황 수시 공유 및 완료 되어야 할 것), 오른쪽은 <b>작업 등록</b> 표입니다.</p>
|
||||
<ol class="pjh-steps">
|
||||
<li><b>작업 등록</b>(제목에 <b>N주차 작업 등록</b>) — 주차마다 한 표를 <b>모두가 같이</b> 봅니다(다른 사람이 적거나 등록한 줄도 보임, 30초마다·창을 다시 볼 때 새로 읽음). 내가 멤버가 아닌 프로젝트를 고른 남의 줄은 프로젝트 이름을 가립니다. 회의 완료면 읽기 전용입니다. 제목 칸에 작업 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다(완료 프로젝트·완료 섹션은 목록에 나오지 않습니다). 목록 맨 위 <span class="pjh-ui">새 프로젝트</span>(Pro user 이상)·<span class="pjh-ui">새 섹션</span>(그 프로젝트 멤버)을 누르면 이름만 적어 바로 만들고 그 칸에 골라집니다. 새 프로젝트는 섹션 없이 시작하니 섹션 칸에서 <span class="pjh-ui">새 섹션</span>을 만들어 고르세요.</li>
|
||||
<li><b>작업 등록</b>(제목에 <b>N주차 작업 등록</b>) — 주차마다 한 표를 <b>모두가 같이</b> 봅니다(다른 사람이 적거나 등록한 줄도 보임, 30초마다·창을 다시 볼 때 새로 읽음). 내가 멤버가 아닌 프로젝트를 고른 남의 줄은 프로젝트 이름을 가립니다. 회의 완료면 읽기 전용입니다.
|
||||
<b>세부 작업</b> — 줄에 마우스를 올리면 나오는 <span class="pjh-ui">↳</span>(또는 우클릭 → 세부 작업 추가)로 바로 아래에 세부 작업 줄을 만듭니다. 제목 칸에서 <kbd>Tab</kbd> = 위 줄의 세부 작업으로, <kbd>Shift</kbd>+<kbd>Tab</kbd> = 다시 위 단계로(한 단계만). 세부 작업 줄은 위 줄의 프로젝트를 따르고 섹션이 없으며, 위 줄을 [적용]한 뒤 [적용]하면 그 작업의 세부 작업이 됩니다.
|
||||
<span class="pjh-ui">크게 열기</span> — 같은 표를 넓은 창으로 열어 씁니다(줄·저장은 그대로, <kbd>Esc</kbd>·×로 닫기). 제목 칸에 작업 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다(완료 프로젝트·완료 섹션은 목록에 나오지 않습니다). 목록 맨 위 <span class="pjh-ui">새 프로젝트</span>(Pro user 이상)·<span class="pjh-ui">새 섹션</span>(그 프로젝트 멤버)을 누르면 이름만 적어 바로 만들고 그 칸에 골라집니다. 새 프로젝트는 섹션 없이 시작하니 섹션 칸에서 <span class="pjh-ui">새 섹션</span>을 만들어 고르세요.</li>
|
||||
<li>프로젝트는 내가 멤버인 프로젝트만 나오고, 고르면 첫 섹션이 자동으로 들어갑니다. 담당자는 그 프로젝트의 멤버·소유자 중에서 고릅니다(프로젝트를 먼저 고르면 정확합니다).</li>
|
||||
<li>맨 오른쪽 <span class="pjh-ui">적용</span>을 누르면 그 프로젝트에 작업이 만들어지고, 줄에 <b>등록됨</b> 링크가 생깁니다. 줄은 이 브라우저에 남아 있어 새로고침해도 사라지지 않습니다. <span class="pjh-ui">+ 줄 추가</span>로 줄을 늘립니다.</li>
|
||||
<li>등록된 줄의 휴지통 아이콘을 누르면 확인 후 <b>그 프로젝트의 작업도 함께 삭제</b>됩니다(휴지통에 3개월 보관). 적용 전 줄의 <span class="pjh-ui">×</span>는 줄만 지웁니다. 작업 삭제는 만든 사람만 할 수 있습니다.</li>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -101,5 +101,5 @@
|
||||
{% include "project/_side_modals.html" %}
|
||||
{% include "project/_member_tasks_modal.html" %}
|
||||
|
||||
<script src="/static/project.js?v=20261012h" defer></script>
|
||||
<script src="/static/project.js?v=20261012i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
|
||||
<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=20261012h" defer></script>
|
||||
<script src="/static/project.js?v=20261012i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -108,5 +108,5 @@
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<script src="/static/project.js?v=20261012h" defer></script>
|
||||
<script src="/static/project.js?v=20261012i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -468,5 +468,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20261012h" defer></script>
|
||||
<script src="/static/project.js?v=20261012i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012d" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012f" />
|
||||
<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=20261012h" defer></script>
|
||||
<script src="/static/project.js?v=20261012i" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user