Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1759e00213 | |||
| fa6e7066ae | |||
| 7cdca852bd | |||
| ee09e8bfd1 | |||
| ae6b6ec603 |
@@ -3320,6 +3320,29 @@ class ProjectStore:
|
||||
for n, x in enumerate(ids):
|
||||
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
|
||||
|
||||
def move_meeting_section(self, *, item_id: int, direction: int) -> None:
|
||||
"""구역(표 첫 열 "구분") 통째로 한 칸 위/아래 — item_id 가 든 구역 묶음(이어진 같은 구역 줄)과 옆 구역 묶음의
|
||||
자리를 바꾼다. 묶음 안 줄 순서·세로 병합(content_row_span)은 그대로 따라간다. 맨 위/맨 아래면 그대로."""
|
||||
with self._pool.connection() as conn:
|
||||
with conn.transaction():
|
||||
self._require_meetings(conn)
|
||||
rows = self._locked_meeting_items(conn, item_id)
|
||||
ids = [int(r["id"]) for r in rows]
|
||||
blocks: list[list[int]] = [] # 이어진 같은 구역 줄 묶음(화면의 tbody 하나)
|
||||
for i, r in enumerate(rows):
|
||||
if i and r["section"] == rows[i - 1]["section"]:
|
||||
blocks[-1].append(ids[i])
|
||||
else:
|
||||
blocks.append([ids[i]])
|
||||
b = next(n for n, blk in enumerate(blocks) if item_id in blk)
|
||||
j = b + (1 if direction > 0 else -1)
|
||||
if not 0 <= j < len(blocks):
|
||||
return
|
||||
blocks[b], blocks[j] = blocks[j], blocks[b]
|
||||
order = [x for blk in blocks for x in blk]
|
||||
for n, x in enumerate(order):
|
||||
conn.execute("UPDATE goal_meeting_items SET sort_order = %s WHERE id = %s", (n, x))
|
||||
|
||||
def goal_month_targets(self, *, year: int, month: int) -> dict[str, Any]:
|
||||
"""회의록 머리 — 그 달 매출 목표·실적, 로아스 목표(목표 표 숫자), 매출 단위. 목표 표가 없으면 빈 값."""
|
||||
with self._pool.connection() as conn:
|
||||
|
||||
@@ -3737,3 +3737,19 @@ def api_move_meeting_item(request: Request, item_id: int, payload: dict[str, Any
|
||||
st = _db_or_503(request)
|
||||
_goal_call(st.move_meeting_item, item_id=item_id, direction=int(payload.get("direction") or 0))
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
|
||||
@router.post("/api/goals/meeting-items/{item_id}/move-section")
|
||||
def api_move_meeting_section(request: Request, item_id: int, payload: dict[str, Any] = Body(...)) -> JSONResponse:
|
||||
"""구역(첫 열 "구분") 통째로 위/아래 {direction: -1|1} — item_id = 그 구역의 아무 줄. 줄 순서와 같은 권한(누구나,
|
||||
회의 완료 전까지). 다음 회의록은 이 순서를 이어받는다."""
|
||||
_require_user(request)
|
||||
st = _db_or_503(request)
|
||||
try:
|
||||
direction = int(payload.get("direction") or 0)
|
||||
except (TypeError, ValueError):
|
||||
raise HTTPException(status_code=400, detail="direction 이 올바르지 않습니다.")
|
||||
if direction not in (-1, 1):
|
||||
raise HTTPException(status_code=400, detail="direction 은 -1(위) 또는 1(아래)입니다.")
|
||||
_goal_call(st.move_meeting_section, item_id=item_id, direction=direction)
|
||||
return JSONResponse({"ok": True})
|
||||
|
||||
@@ -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=20261012a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -227,7 +227,8 @@
|
||||
<tr data-item="{{ it.id }}" data-section="{{ sec.name }}" data-market="{{ it.marketplace_code }}" data-target-amount="{{ it.target_amount if it.target_amount is not none else '' }}"{% if p %} data-prev="{{ p.id }}" data-prev-target="{{ p.target_amount if p.target_amount is not none else '' }}"{% endif %}>
|
||||
{% if loop.first %}
|
||||
<th class="pj-meet-c-sec" rowspan="{{ sec.rows | length }}">{{ sec.name }}
|
||||
{% if edit %}<button type="button" class="pj-meet-sec-add" data-meet-act="sec-add" title="{{ sec.name }} 구역 끝에 줄 추가">+</button>{% endif %}
|
||||
{% if edit %}<button type="button" class="pj-icon-btn pj-meet-more pj-meet-sec-more" data-meet-act="sec-menu" title="구역 메뉴(위로·아래로) · 우클릭도 됩니다"><span class="material-symbols-outlined">more_horiz</span></button>
|
||||
<button type="button" class="pj-meet-sec-add" data-meet-act="sec-add" title="{{ sec.name }} 구역 끝에 줄 추가">+</button>{% endif %}
|
||||
</th>
|
||||
{% endif %}
|
||||
<th class="pj-meet-c-label">
|
||||
@@ -291,5 +292,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=20261012b" defer></script>
|
||||
<script src="/static/project.js?v=20261012d" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012b" />
|
||||
<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=20261012b" defer></script>
|
||||
<script src="/static/project.js?v=20261012d" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012b" />
|
||||
<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,7 @@
|
||||
<h3 id="meetings-kpis">위쪽 3칸 — 월 계획·숫자, 결정 사항, 작업 등록</h3>
|
||||
<p>제목 아래 세 칸은 표를 스크롤해도 그대로 보입니다. 왼쪽은 <b>월 계획</b>이고 그 머리 줄 오른쪽에 숫자 4개(월 목표 · 누적 목표 · 누적 실적 · 목표 대비)가 작게 한 줄로 나옵니다(목표 표 매출 단위, 예: 백만원 — 숫자에 마우스를 올리면 원 단위 금액과 뜻). 가운데는 <b>결정사항</b>(진행상황 수시 공유 및 완료 되어야 할 것), 오른쪽은 <b>작업 등록</b> 표입니다.</p>
|
||||
<ol class="pjh-steps">
|
||||
<li><b>작업 등록</b> — 제목 칸에 작업 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다.</li>
|
||||
<li><b>작업 등록</b> — 제목 칸에 작업 이름을 씁니다. 담당자·프로젝트·섹션 칸을 누르면 고를 수 있는 목록이 나옵니다. 목록 맨 위 <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>
|
||||
@@ -697,6 +697,7 @@
|
||||
<ul>
|
||||
<li>구역 이름 옆 <span class="pjh-ui">+</span>는 그 구역 끝에 줄을 추가합니다. 표 아래 <span class="pjh-ui">+ 구역 추가</span>로 새 구역을 만듭니다.</li>
|
||||
<li>항목 이름을 클릭하면 그 자리에서 고칩니다. 우클릭 또는 ⋯ 메뉴에서 <span class="pjh-ui">위에 줄 추가 · 아래에 줄 추가 · 위로 · 아래로 · 줄 삭제</span>를 사용합니다. 순서 이동은 같은 구역 안에서 합니다.</li>
|
||||
<li><b>구역 순서</b> — 첫 열 <b>구분</b> 칸을 우클릭하거나 마우스를 올려 나오는 <span class="pjh-ui">⋯</span>를 누르면 <span class="pjh-ui">구역 위로 · 구역 아래로 · 구역 끝에 줄 추가</span>가 나옵니다. 구역 안의 줄 순서·병합은 그대로 함께 옮겨지고, 다음에 만드는 회의록도 바뀐 순서를 이어받습니다(회의 완료 전까지, 누구나).</li>
|
||||
<li>줄을 삭제하면 주요 업무·정량 목표도 함께 삭제됩니다. 새 줄은 지난주에 이어진 항목이 없으면 지난주 리뷰가 비어 있습니다.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012b" />
|
||||
<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=20261012b" defer></script>
|
||||
<script src="/static/project.js?v=20261012d" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012b" />
|
||||
<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=20261012b" defer></script>
|
||||
<script src="/static/project.js?v=20261012d" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012b" />
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
{% endblock %}
|
||||
|
||||
@@ -108,5 +108,5 @@
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
<script src="/static/project.js?v=20261012b" defer></script>
|
||||
<script src="/static/project.js?v=20261012d" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012b" />
|
||||
<!-- 구글 머티리얼 심볼(담당자 아이콘 등) — self-host -->
|
||||
<link rel="stylesheet" href="/static/vendor/material-symbols/material-symbols.css" />
|
||||
<!-- 타임라인 vis-timeline — self-host -->
|
||||
@@ -488,5 +488,5 @@
|
||||
</script>
|
||||
|
||||
<script src="/static/vendor/vis-timeline/vis-timeline-graph2d.min.js"></script>
|
||||
<script src="/static/project.js?v=20261012b" defer></script>
|
||||
<script src="/static/project.js?v=20261012d" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012a" />
|
||||
<link rel="stylesheet" href="/static/project.css?v=20261012b" />
|
||||
<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=20261012b" defer></script>
|
||||
<script src="/static/project.js?v=20261012d" defer></script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -2811,6 +2811,8 @@ th.pj-meet-c-label { position: relative; font-weight: 600; color: #3b4048; text-
|
||||
.pj-meet-more { position: absolute; top: 3px; right: 2px; width: 24px; height: 24px; opacity: 0; transition: opacity .12s; }
|
||||
.pj-meet-more .material-symbols-outlined { font-size: 18px; }
|
||||
th.pj-meet-c-label:hover .pj-meet-more, .pj-meet-more:focus { opacity: 1; }
|
||||
/* 구분(구역) 칸 ⋮ — 구역 위로·아래로(줄 메뉴와 같은 모양) */
|
||||
th.pj-meet-c-sec:hover .pj-meet-sec-more { opacity: 1; }
|
||||
textarea.pj-meet-text, textarea.pj-meet-rnote, .pj-meet-notes textarea {
|
||||
display: block; width: 100%; box-sizing: border-box; min-height: 38px; padding: 6px; border: none; background: transparent;
|
||||
font: inherit; line-height: var(--pj-text-leading); color: inherit; resize: none; overflow: hidden;
|
||||
|
||||
+86
-21
@@ -9092,15 +9092,20 @@
|
||||
tipEl.textContent = text;
|
||||
tipEl.hidden = false;
|
||||
// 화면 가장자리 보정 — 좌우로 넘치면 말풍선만 안쪽으로 밀고 꼬리는
|
||||
// 커서를 계속 가리키게(--pj-tip-shift). 위가 모자라면 커서 아래로 뒤집는다.
|
||||
// 커서를 계속 가리키게(--pj-tip-shift).
|
||||
// 늘 커서 **위**에 — 마우스 화살표(핫스팟에서 아래로 약 20px)에 가려지지 않게. 화면 맨 위(회의록 머리 버튼 등)라
|
||||
// 여유가 적으면 꼬리 간격을 줄여서라도 위에(말풍선 아래 끝 = 커서 8px 위), 그래도 안 들어갈 때만 아래로 뒤집되
|
||||
// 화살표 길이만큼 띄운다(예전엔 위 여백 20px 미만이면 커서 바로 아래 22px — 화살표가 글자를 가렸다).
|
||||
const w = tipEl.offsetWidth, h = tipEl.offsetHeight;
|
||||
const vw = document.documentElement.clientWidth;
|
||||
const cx = Math.min(Math.max(x, 8 + w / 2), vw - 8 - w / 2);
|
||||
const below = y - 16 - h < 4;
|
||||
// CSS 기본 위치: 말풍선 아래 끝 = top − 6px(transform). top = y−10 → 커서 16px 위, top = y−2 → 커서 8px 위.
|
||||
const roomy = y - 16 - h >= 2;
|
||||
const below = !roomy && y - 8 - h < 0;
|
||||
tipEl.classList.toggle("is-below", below);
|
||||
tipEl.style.setProperty("--pj-tip-shift", (x - cx) + "px");
|
||||
tipEl.style.left = cx + "px";
|
||||
tipEl.style.top = (below ? y + 22 : y - 10) + "px";
|
||||
tipEl.style.top = (below ? y + 28 : roomy ? y - 10 : y - 2) + "px";
|
||||
}
|
||||
function hide() { shown = false; if (tipEl) tipEl.hidden = true; }
|
||||
document.addEventListener("mouseover", function (e) {
|
||||
@@ -10724,23 +10729,41 @@
|
||||
const r = btn.getBoundingClientRect();
|
||||
showContextMenu(r.left, r.bottom + 2, items.length ? items : [{ label: "고를 항목이 없습니다", onClick: function () {} }]);
|
||||
}
|
||||
async function chooseProject(r, p) {
|
||||
if (r.projectId !== p.id) { r.stageId = null; r.stageName = ""; }
|
||||
r.projectId = p.id; r.projectName = p.name;
|
||||
try {
|
||||
const [mem, stages] = await Promise.all([membersOf(p.id), stagesOf(p.id)]);
|
||||
if (r.assignee && mem.indexOf(r.assignee.toLowerCase()) < 0) {
|
||||
showToast(nameOf(r.assignee) + "님은 이 프로젝트 멤버가 아니어서 담당자를 비웠습니다.");
|
||||
r.assignee = "";
|
||||
}
|
||||
if (!r.stageId && stages.length) { r.stageId = stages[0].id; r.stageName = stages[0].name; }
|
||||
} catch (e) { showToast("프로젝트 정보를 읽지 못했습니다: " + e.message, "error"); }
|
||||
save(); render();
|
||||
}
|
||||
// 목록 맨 위 "+ 새 프로젝트" — 새 프로젝트는 Pro user 이상(서버 POST /api/projects 도 같은 기준), 만든 사람이 소유자.
|
||||
// 새 프로젝트는 섹션 없이 시작하므로 섹션 칸은 비워 둔다(섹션 칸 맨 위 "+ 새 섹션"으로 바로 만들 수 있다).
|
||||
async function addProject(r) {
|
||||
const name = await prompt("새 프로젝트 이름", "");
|
||||
if (name == null || !String(name).trim()) return;
|
||||
try {
|
||||
const res = await api("POST", "/project/api/projects", { name: String(name).trim() });
|
||||
const p = res.project;
|
||||
if (projects) projects.push(p);
|
||||
memberCache[p.id] = [String(p.owner_email || "").toLowerCase()].filter(Boolean);
|
||||
stageCache[p.id] = [];
|
||||
showToast("프로젝트 ‘" + p.name + "’를 만들었습니다.");
|
||||
await chooseProject(r, p);
|
||||
} catch (e) { showToast("프로젝트 만들기 실패: " + e.message, "error"); }
|
||||
}
|
||||
async function pickProject(r, btn) {
|
||||
const list = await loadProjects();
|
||||
menuAt(btn, list.map(function (p) {
|
||||
return { label: p.name, icon: menuIcon("folder"), checked: r.projectId === p.id, onClick: async function () {
|
||||
if (r.projectId !== p.id) { r.stageId = null; r.stageName = ""; }
|
||||
r.projectId = p.id; r.projectName = p.name;
|
||||
try {
|
||||
const [mem, stages] = await Promise.all([membersOf(p.id), stagesOf(p.id)]);
|
||||
if (r.assignee && mem.indexOf(r.assignee.toLowerCase()) < 0) {
|
||||
showToast(nameOf(r.assignee) + "님은 이 프로젝트 멤버가 아니어서 담당자를 비웠습니다.");
|
||||
r.assignee = "";
|
||||
}
|
||||
if (!r.stageId && stages.length) { r.stageId = stages[0].id; r.stageName = stages[0].name; }
|
||||
} catch (e) { showToast("프로젝트 정보를 읽지 못했습니다: " + e.message, "error"); }
|
||||
save(); render();
|
||||
} };
|
||||
}));
|
||||
const pro = el("pj-meet-pane") && el("pj-meet-pane").dataset.pro === "true";
|
||||
const head = pro ? [{ label: "새 프로젝트", icon: menuIcon("add"), onClick: function () { addProject(r); } }, null] : [];
|
||||
menuAt(btn, head.concat(list.map(function (p) {
|
||||
return { label: p.name, icon: menuIcon("folder"), checked: r.projectId === p.id, onClick: function () { chooseProject(r, p); } };
|
||||
})));
|
||||
}
|
||||
async function pickAssignee(r, btn) {
|
||||
// 프로젝트를 골랐으면 그 프로젝트 멤버·소유자만(작업을 볼 수 있는 사람), 아니면 프로젝트 권한이 있는 전체 직원
|
||||
@@ -10754,9 +10777,21 @@
|
||||
async function pickStage(r, btn) {
|
||||
if (!r.projectId) { showToast("프로젝트를 먼저 고르세요."); return; }
|
||||
const stages = await stagesOf(r.projectId);
|
||||
menuAt(btn, stages.map(function (st) {
|
||||
const pid = r.projectId;
|
||||
// 목록 맨 위 "+ 새 섹션" — 그 프로젝트 멤버 누구나(서버 POST …/stages). 만든 섹션을 바로 고른다.
|
||||
const head = [{ label: "새 섹션", icon: menuIcon("add"), onClick: async function () {
|
||||
const name = await prompt("‘" + r.projectName + "’에 만들 섹션 이름", "");
|
||||
if (name == null || !String(name).trim()) return;
|
||||
try {
|
||||
const res = await api("POST", "/project/api/projects/" + pid + "/stages", { name: String(name).trim() });
|
||||
(stageCache[pid] = stageCache[pid] || []).push(res.stage);
|
||||
if (r.projectId === pid) { r.stageId = res.stage.id; r.stageName = res.stage.name; save(); render(); }
|
||||
showToast("섹션 ‘" + res.stage.name + "’를 만들었습니다.");
|
||||
} catch (e) { showToast("섹션 만들기 실패: " + e.message, "error"); }
|
||||
} }, null];
|
||||
menuAt(btn, head.concat(stages.map(function (st) {
|
||||
return { label: st.name, icon: menuIcon("view_column"), checked: r.stageId === st.id, onClick: function () { r.stageId = st.id; r.stageName = st.name; save(); render(); } };
|
||||
}));
|
||||
})));
|
||||
}
|
||||
async function apply(r, btn) {
|
||||
if (!r.title.trim()) { showToast("작업 제목을 쓰세요."); return; }
|
||||
@@ -11197,6 +11232,26 @@
|
||||
} },
|
||||
].concat(cellGrid ? [null].concat(cellGrid.widthItems(tr.querySelector("th.pj-meet-c-label"))) : []));
|
||||
}
|
||||
// ── 구역 메뉴(구분 칸 ⋯ · 우클릭) — 구역을 통째로 위/아래(그 안의 줄 순서·병합은 그대로), 구역 끝에 줄 추가 ──
|
||||
function secMenu(x, y, tbody) {
|
||||
const blocks = Array.prototype.slice.call(table.querySelectorAll("tbody.pj-meet-sec"));
|
||||
const i = blocks.indexOf(tbody);
|
||||
const first = tbody.querySelector("tr[data-item]");
|
||||
if (!first) return;
|
||||
const mv = function (dir) {
|
||||
return function () {
|
||||
run(async function () { await api("POST", itemUrl(first.dataset.item) + "/move-section", { direction: dir }); return true; });
|
||||
};
|
||||
};
|
||||
const items = [];
|
||||
if (i > 0) items.push({ label: "구역 위로", icon: menuIcon("arrow_upward"), onClick: mv(-1) });
|
||||
if (i < blocks.length - 1) items.push({ label: "구역 아래로", icon: menuIcon("arrow_downward"), onClick: mv(1) });
|
||||
if (items.length) items.push(null);
|
||||
items.push({ label: "구역 끝에 줄 추가", icon: menuIcon("add_row_below"), onClick: function () {
|
||||
run(function () { return addRow(tbody.dataset.section, null, "below"); });
|
||||
} });
|
||||
showContextMenu(x, y, items);
|
||||
}
|
||||
table.addEventListener("click", function (e) {
|
||||
const b = e.target.closest("[data-meet-act]");
|
||||
if (!b) return;
|
||||
@@ -11204,13 +11259,23 @@
|
||||
if (b.dataset.meetAct === "menu") {
|
||||
const r = b.getBoundingClientRect();
|
||||
rowMenu(r.left, r.bottom + 4, tr);
|
||||
} else if (b.dataset.meetAct === "sec-menu") {
|
||||
const r = b.getBoundingClientRect();
|
||||
secMenu(r.left, r.bottom + 4, b.closest("tbody"));
|
||||
} else if (b.dataset.meetAct === "sec-add") {
|
||||
run(function () { return addRow(b.closest("tbody").dataset.section, null, "below"); });
|
||||
}
|
||||
});
|
||||
table.addEventListener("contextmenu", function (e) {
|
||||
if (e.target.closest(".is-editing")) return;
|
||||
const sec = e.target.closest("tbody.pj-meet-sec th.pj-meet-c-sec");
|
||||
if (sec && canEdit) {
|
||||
e.preventDefault();
|
||||
secMenu(e.clientX, e.clientY, sec.closest("tbody"));
|
||||
return;
|
||||
}
|
||||
const th = e.target.closest("th.pj-meet-c-label");
|
||||
if (!th || e.target.closest(".is-editing")) return;
|
||||
if (!th) return;
|
||||
e.preventDefault();
|
||||
rowMenu(e.clientX, e.clientY, th.closest("tr"));
|
||||
});
|
||||
|
||||
@@ -1191,6 +1191,17 @@ Windows 트레이 프로그램 **DBX 알림**(`desktop/notifier/`, C# .NET Frame
|
||||
잠근 트랜잭션 안에서 DB 연결을 더 빌리지 않음). 기본 담당자 지정도 같은 기준. 협업자 추가는 담당자 후보와 같은 `access.can_assign`
|
||||
(예전엔 관리자는 멤버가 아니어도 넣을 수 있었다).
|
||||
|
||||
- **회의록 구역 순서**(2026-10-12): 첫 열 "구분" 칸 우클릭·⋯ = 구역 위로·아래로·구역 끝에 줄 추가.
|
||||
`POST /api/goals/meeting-items/{item_id}/move-section {direction: -1|1}`(그 구역의 아무 줄) → `move_meeting_section` 이 회의록
|
||||
행 잠금 안에서 이어진 같은 구역 줄 묶음과 옆 묶음의 자리를 바꾼다(묶음 안 줄 순서·세로 병합 그대로, 맨 끝이면 그대로). 줄 이동과 같은
|
||||
권한(누구나, 회의 완료면 409). 다음 회의록은 `create_meeting` 이 이 순서를 이어받는다. 마이그레이션 없음.
|
||||
|
||||
- **회의록 작업 등록 — 새 프로젝트·새 섹션**(2026-10-12): 프로젝트 칸 목록 맨 위 "새 프로젝트"(Pro user 이상만 보임 — `POST /api/projects`,
|
||||
만든 사람이 소유자), 섹션 칸 맨 위 "새 섹션"(그 프로젝트 멤버 — `POST /api/projects/{id}/stages`). 이름만 묻고 만든 뒤 바로 그 칸에 고른다.
|
||||
- **말풍선 위치**(`initHoverTips`, 2026-10-12): 늘 커서 위 — 위 여유가 적으면(화면 맨 위 회의록 머리 버튼 등) 꼬리 간격을 줄여(커서 8px 위)
|
||||
위에 두고, 그래도 안 들어갈 때만 아래로 뒤집되 마우스 화살표에 가리지 않게 커서 28px 아래. 예전엔 위 여백이 말풍선 높이+20px 보다
|
||||
작으면 커서 바로 아래(22px)로 뒤집혀 화살표가 글자를 가렸다.
|
||||
|
||||
정책 결정이 필요한 것(바꾸지 않음): 배정·완료 **메일**은 `PROJECT_NOTIFY_EMAIL`(없으면 Admin 전원)에게 프로젝트·작업 제목·담당자가
|
||||
간다 — 화면에선 비멤버 Admin 이 그 프로젝트를 못 보지만 메일로는 제목을 받는다(4장 관리자 보고 정책).
|
||||
|
||||
|
||||
@@ -352,6 +352,29 @@ function meetServer(env, st) {
|
||||
{ nav: env.navigations });
|
||||
});
|
||||
|
||||
// 첫 열(구분) — 구역 통째로 위/아래(우클릭·⋯), 맨 위는 "위로" 없음, 구역 첫 줄 id 로 요청
|
||||
await section(async function () {
|
||||
const env = makeEnv(PAGE.meeting_admin, MEET_URL);
|
||||
meetServer(env);
|
||||
await boot(env);
|
||||
const blocks = Array.from(env.d.querySelectorAll("tbody.pj-meet-sec"));
|
||||
blocks[0].querySelector("th.pj-meet-c-sec").dispatchEvent(new env.w.MouseEvent("contextmenu", { bubbles: true, cancelable: true, clientX: 5, clientY: 5 }));
|
||||
let labels = Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).map(itemLabel);
|
||||
check("[1e] 첫 구역 우클릭 — 구역 아래로·구역 끝에 줄 추가(위로 없음)",
|
||||
labels.indexOf("구역 아래로") >= 0 && labels.indexOf("구역 위로") < 0 && labels.indexOf("구역 끝에 줄 추가") >= 0, labels);
|
||||
Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).find(function (b) { return itemLabel(b) === "구역 아래로"; }).click();
|
||||
await settle(); await wait(20); await settle();
|
||||
const firstId = blocks[0].querySelector("tr[data-item]").dataset.item;
|
||||
const call = env.calls.find(function (c) { return /\/move-section$/.test(c.url); });
|
||||
check("[1e] 구역 아래로 → 그 구역 첫 줄로 move-section(direction 1) 후 새로고침",
|
||||
!!call && call.method === "POST" && call.url.indexOf("/meeting-items/" + firstId + "/move-section") >= 0 &&
|
||||
call.body.direction === 1 && env.navigations === 1, [call, env.navigations]);
|
||||
const last = blocks[blocks.length - 1];
|
||||
last.querySelector('[data-meet-act="sec-menu"]').click();
|
||||
labels = Array.from(env.d.querySelectorAll(".pj-ctxmenu-item")).map(itemLabel);
|
||||
check("[1e] 마지막 구역 ⋯ — 구역 위로(아래로 없음)", labels.indexOf("구역 위로") >= 0 && labels.indexOf("구역 아래로") < 0, labels);
|
||||
});
|
||||
|
||||
// ════════════════════ [2] 숫자 — 늦은 응답이 최신 입력을 덮지 않음 ════════════════════
|
||||
await section(async function () {
|
||||
const env = makeEnv(PAGE.goals_admin, GOALS_URL);
|
||||
@@ -518,7 +541,7 @@ function meetServer(env, st) {
|
||||
return items.map(itemLabel);
|
||||
};
|
||||
const projLabels = await pickItem("project", "브랜드");
|
||||
check("[2g] 프로젝트 목록 = 최상위 프로젝트", JSON.stringify(projLabels) === JSON.stringify(["브랜드"]), projLabels);
|
||||
check("[2g] 프로젝트 목록 = 맨 위 '새 프로젝트'(Pro user) + 최상위 프로젝트", JSON.stringify(projLabels) === JSON.stringify(["새 프로젝트", "브랜드"]), projLabels);
|
||||
const row = d.querySelector("#pj-meet-quick tbody tr");
|
||||
check("[2g] 프로젝트 고르면 첫 섹션 자동", row.querySelector('[data-pick="stage"]').textContent === "할 일", row.querySelector('[data-pick="stage"]').textContent);
|
||||
const people = await pickItem("assignee", "Kim");
|
||||
@@ -541,6 +564,53 @@ function meetServer(env, st) {
|
||||
check("[2g] 적용 전 줄 × → 줄만 지움", d.querySelectorAll("#pj-meet-quick tbody tr").length === n - 1 && env.calls.length === calls);
|
||||
}, { notifyOnFail: true });
|
||||
|
||||
// ════════════════════ [2g2] 작업 등록 — 프로젝트·섹션 목록 맨 위에서 바로 만들기 ════════════════════
|
||||
await section(async function () {
|
||||
const env = makeEnv(PAGE.meeting_admin, MEET_URL, { promptAnswer: "신규 브랜드" });
|
||||
meetServer(env);
|
||||
let madeProject = null, madeStage = null;
|
||||
env.route("GET", /\/project\/api\/projects$/, function () { return { body: { projects: [{ id: 7, name: "브랜드", parent_id: null }] } }; });
|
||||
env.route("POST", /\/project\/api\/projects$/, function (u, body) {
|
||||
madeProject = body;
|
||||
return { status: 201, body: { project: { id: 9, name: body.name, parent_id: null, owner_email: "me@test.local" } } };
|
||||
});
|
||||
env.route("POST", /\/project\/api\/projects\/9\/stages$/, function (u, body) {
|
||||
madeStage = body;
|
||||
return { status: 201, body: { stage: { id: 91, project_id: 9, name: body.name, sort_order: 0 } } };
|
||||
});
|
||||
await boot(env);
|
||||
const d = env.d;
|
||||
const open = async function (kind) {
|
||||
d.querySelector('#pj-meet-quick tbody tr [data-pick="' + kind + '"]').click(); await settle(); await wait(5); await settle();
|
||||
return Array.from(d.querySelectorAll(".pj-ctxmenu-item"));
|
||||
};
|
||||
const click = async function (items, label) {
|
||||
items.find(function (n) { return itemLabel(n) === label; }).click(); await settle(); await wait(5); await settle();
|
||||
};
|
||||
await click(await open("project"), "새 프로젝트");
|
||||
const row = function () { return d.querySelector("#pj-meet-quick tbody tr"); };
|
||||
check("[2g2] 새 프로젝트 → 이름 묻고 만들어 바로 고름(섹션은 비움)",
|
||||
madeProject && madeProject.name === "신규 브랜드" && row().querySelector('[data-pick="project"]').textContent === "신규 브랜드" &&
|
||||
row().querySelector('[data-pick="stage"]').classList.contains("is-empty"), [madeProject, row().textContent]);
|
||||
const stageItems = await open("stage");
|
||||
check("[2g2] 섹션 목록 맨 위 '새 섹션'", itemLabel(stageItems[0]) === "새 섹션", stageItems.map(itemLabel));
|
||||
await click(stageItems, "새 섹션");
|
||||
check("[2g2] 새 섹션 → 그 프로젝트에 만들고 바로 고름", madeStage && madeStage.name === "신규 브랜드" &&
|
||||
row().querySelector('[data-pick="stage"]').textContent === "신규 브랜드", [madeStage, row().textContent]);
|
||||
});
|
||||
await section(async function () {
|
||||
const env = makeEnv(PAGE.meeting_member, MEET_URL);
|
||||
meetServer(env);
|
||||
env.route("GET", /\/project\/api\/projects$/, function () { return { body: { projects: [{ id: 7, name: "브랜드", parent_id: null }] } }; });
|
||||
await boot(env);
|
||||
const d = env.d;
|
||||
const box = d.querySelector('#pj-meet-quick tbody tr [data-pick="project"]');
|
||||
if (!box) { check("[2g2] 직원 화면 작업 등록 표", false); return; }
|
||||
box.click(); await settle(); await wait(5); await settle();
|
||||
const labels = Array.from(d.querySelectorAll(".pj-ctxmenu-item")).map(itemLabel);
|
||||
check("[2g2] 직원(User)에겐 '새 프로젝트' 없음(새 프로젝트는 Pro user 이상)", labels.indexOf("새 프로젝트") < 0 && labels.indexOf("브랜드") >= 0, labels);
|
||||
});
|
||||
|
||||
// ════════════════════ [2h] 회의록은 누구나 수정 · [회의 완료](관리자)면 잠금 ════════════════════
|
||||
await section(async function () {
|
||||
const env = makeEnv(PAGE.meeting_member, MEET_URL);
|
||||
|
||||
@@ -32,6 +32,10 @@ class LockConnection(Connection):
|
||||
if params[0] not in self.meetings:
|
||||
return Result([])
|
||||
return Result([{"completed_at": "done" if params[0] in self.completed else None}])
|
||||
if sql.startswith("SELECT id, week_start") and "FROM goal_meeting_items" in sql and "ORDER BY sort_order" in sql:
|
||||
self.calls.append((sql, params)) # 실제 쿼리처럼 sort_order 순으로(기본 모형은 ORDER BY 를 무시한다)
|
||||
return Result(dict(r) for r in sorted(self.rows.values(), key=lambda r: (r["sort_order"], r["id"]))
|
||||
if r["week_start"] == params[0])
|
||||
if sql.startswith("UPDATE goal_meetings SET"):
|
||||
assert self.locked and self.depth > 0, "머리 변경은 회의록 행을 잠근 트랜잭션 안에서"
|
||||
self.calls.append((sql, params))
|
||||
@@ -95,6 +99,38 @@ class MeetingLockTests(unittest.TestCase):
|
||||
self.st.update_meeting(week_start=date(2026, 9, 28), fields={"notes": "잠김"})
|
||||
self.assertEqual(sum(1 for s, _ in self.conn.calls if s.startswith("UPDATE goal_meetings SET")), 1)
|
||||
|
||||
def order(self):
|
||||
return [r["id"] for r in sorted(self.conn.rows.values(), key=lambda r: r["sort_order"])]
|
||||
|
||||
def test_move_section_swaps_whole_blocks(self):
|
||||
# 1·2·3 = 상품, 4 = 유통 → 유통을 위로 = 4,1,2,3 (상품 안 순서·병합은 그대로 따라감)
|
||||
self.conn.rows[1]["content_row_span"] = 2
|
||||
self.st.move_meeting_section(item_id=4, direction=-1)
|
||||
self.assertEqual(self.order(), [4, 1, 2, 3])
|
||||
self.assertEqual(self.conn.rows[1]["content_row_span"], 2)
|
||||
self.st.move_meeting_section(item_id=4, direction=-1) # 맨 위 — 그대로
|
||||
self.assertEqual(self.order(), [4, 1, 2, 3])
|
||||
self.st.move_meeting_section(item_id=2, direction=1) # 상품(이제 맨 아래)의 아무 줄로 아래로 — 그대로
|
||||
self.assertEqual(self.order(), [4, 1, 2, 3])
|
||||
self.st.move_meeting_section(item_id=4, direction=1)
|
||||
self.assertEqual(self.order(), [1, 2, 3, 4])
|
||||
|
||||
def test_move_section_locked_after_completion(self):
|
||||
self.conn.completed.add(date(2026, 9, 28))
|
||||
with self.assertRaises(store.MeetingLocked):
|
||||
self.st.move_meeting_section(item_id=4, direction=-1)
|
||||
|
||||
def test_move_section_api(self):
|
||||
app = FastAPI()
|
||||
app.include_router(api.router)
|
||||
app.state.project_store = self.st
|
||||
client = TestClient(app)
|
||||
with patch.object(api, "_require_user", return_value=dict(role="user", email="member@test.local")):
|
||||
self.assertEqual(client.post("/project/api/goals/meeting-items/4/move-section", json={"direction": 0}).status_code, 400)
|
||||
self.assertEqual(client.post("/project/api/goals/meeting-items/4/move-section", json={"direction": -1}).status_code, 200)
|
||||
self.assertEqual(self.order(), [4, 1, 2, 3])
|
||||
self.assertEqual(client.post("/project/api/goals/meeting-items/99/move-section", json={"direction": 1}).status_code, 404)
|
||||
|
||||
def test_anyone_edits_but_only_admin_completes(self):
|
||||
app = FastAPI()
|
||||
app.include_router(api.router)
|
||||
|
||||
@@ -1166,6 +1166,36 @@ def test_review_meeting_result_lock_rules():
|
||||
_drop_meetings([w1, w2])
|
||||
|
||||
|
||||
def test_review_meeting_section_move():
|
||||
"""구역(첫 열) 통째로 위/아래 — 묶음 안 줄 순서 그대로, 다음 주 회의록이 바뀐 순서를 이어받는다."""
|
||||
from app.modules.project import store
|
||||
|
||||
w1 = store.month_weeks(2031, 11)[1][0] # 11월 2주차 시작일(주차 시작일이어야 회의록을 만든다)
|
||||
w2 = store.week_period(w1)[1] + timedelta(days=1)
|
||||
_drop_meetings([w1, w2])
|
||||
try:
|
||||
_create_meeting(w1)
|
||||
secs = lambda w: [s for i, s in enumerate(r["section"] for r in ST.get_meeting(week_start=w)["items"])
|
||||
if i == 0 or s != ST.get_meeting(week_start=w)["items"][i - 1]["section"]]
|
||||
before = secs(w1)
|
||||
assert len(before) >= 2, before
|
||||
items = ST.get_meeting(week_start=w1)["items"]
|
||||
second = next(r for r in items if r["section"] == before[1])
|
||||
labels_second = [r["label"] for r in items if r["section"] == before[1]]
|
||||
r = req("POST", f"/project/api/goals/meeting-items/{second['id']}/move-section", BOB, json={"direction": -1})
|
||||
assert r.status_code == 200, r.text
|
||||
after = secs(w1)
|
||||
assert after[:2] == [before[1], before[0]] and after[2:] == before[2:], (before, after)
|
||||
assert [r["label"] for r in ST.get_meeting(week_start=w1)["items"] if r["section"] == before[1]] == labels_second
|
||||
_create_meeting(w2)
|
||||
assert secs(w2) == after # 다음 회의록은 바뀐 구역 순서를 이어받는다
|
||||
ST.set_meeting_completed(week_start=w1, done=True, by=ADMIN)
|
||||
assert req("POST", f"/project/api/goals/meeting-items/{second['id']}/move-section", BOB,
|
||||
json={"direction": 1}).status_code == 409 # 회의 완료 뒤 잠금
|
||||
finally:
|
||||
_drop_meetings([w1, w2])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not ENABLED:
|
||||
print("SKIP: PROJECT_TEST_DB_URL(localhost) not set")
|
||||
|
||||
Reference in New Issue
Block a user