feat(project): Project 옵션 시스템 전체 적용 + 모달 안 말풍선 가림 수정
- 프로젝트 화면(처음 여는 탭)·보드(카드 표지)는 서버 저장(project_db.project_options, 마이그레이션 029) → 수퍼관리자·Admin 이 바꾸면 모든 사용자에게 적용. 일반(폰트)은 그대로 이 브라우저(localStorage). - GET/PUT /project/api/options(쓰기는 Admin 이상, 보낸 키만, 029 미적용 503). 검사·기본값은 store.normalize/validate_project_options 한 곳. 프로젝트 화면은 data-default-view·data-board-cover 로 받음 (읽기 실패해도 기본값으로 열림). - 옵션 창: 열 때 서버 최신값 읽기(실패 시 시스템 칸 잠금·폰트만 저장), 바뀐 키만 PUT, 실패면 창 유지. 분류 제목 옆 적용 범위 배지(이 브라우저에만 / 모든 사용자에게). - 공용 말풍선: 모달 대화창(showModal) 안에서는 popover(top layer)로 띄워 대화창 뒤에 가려지지 않게. - 테스트: tests/test_project_options_api.py, jsdom 옵션 테스트 갱신. 도움말·문서·DEPLOYMENT(029) 갱신. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+36
-16
@@ -937,10 +937,6 @@
|
||||
coverCache.set(s, src);
|
||||
return src;
|
||||
}
|
||||
// Project 옵션 "카드 표지 이미지"(project-options.js) — "0" 일 때만 끔, 기본은 켬
|
||||
function boardCoverOn() {
|
||||
try { return localStorage.getItem("pj_board_cover") !== "0"; } catch (_) { return true; }
|
||||
}
|
||||
function hasDescription(html) {
|
||||
const s = String(html || "");
|
||||
if (/<img\b/i.test(s)) return true;
|
||||
@@ -3420,10 +3416,12 @@
|
||||
const projectId = parseInt(root.dataset.projectId, 10);
|
||||
const canManage = root.dataset.canManage === "true";
|
||||
// 등급(2026-10-12) — isPro = Pro user 이상(프로젝트 수정·멤버 배정·전체 보기·담당자별 합계·남의 댓글 수정),
|
||||
// isPAdmin = Admin 이상(남이 만든 섹션도 삭제, Project 옵션의 처음 여는 탭·보드 카드 표지 —
|
||||
// 그 밖은 브라우저에 남은 값과 무관하게 기본값: 보드·표지 켬).
|
||||
// isPAdmin = Admin 이상(남이 만든 섹션도 삭제).
|
||||
const isPro = root.dataset.isPro === "true";
|
||||
const isPAdmin = root.dataset.isPadmin === "true";
|
||||
// 시스템 Project 옵션(서버 project_options, 수퍼관리자·Admin 이 바꾸면 모든 사용자에게) — 보드 카드 표지 켬/끔.
|
||||
// 옵션 창에서 저장하면 pj-options-change 로 바로 바뀐다(아래).
|
||||
let boardCover = root.dataset.boardCover !== "0";
|
||||
const me = (root.dataset.me || "").toLowerCase();
|
||||
// 섹션 삭제 — Admin 이상은 누구 것이든, 그 밖은 만든 사람만. created_by 없으면 서버가 최종 판정.
|
||||
function canDelete(createdBy) {
|
||||
@@ -3580,7 +3578,7 @@
|
||||
}
|
||||
|
||||
let timeline = null;
|
||||
// 기본 보기는 Project 옵션의 "처음 여는 탭"(pj_default_view, 없으면 보드) —
|
||||
// 기본 보기는 시스템 Project 옵션의 "처음 여는 탭"(서버 project_options → data-default-view, 없으면 보드) —
|
||||
// 왼쪽 프로젝트 클릭 등으로 들어오면 그 탭.
|
||||
// 예외: 달력 이전/다음달 이동은 페이지를 통째로 새로고침하므로(?y=&m=),
|
||||
// 그때만 마지막으로 보던 뷰를 되살린다 — 안 그러면 달력을 넘기다가
|
||||
@@ -3592,10 +3590,10 @@
|
||||
try {
|
||||
const qs = new URLSearchParams(location.search);
|
||||
const saved = localStorage.getItem(VIEW_KEY);
|
||||
const preferred = localStorage.getItem("pj_default_view");
|
||||
const preferred = root.dataset.defaultView; // 시스템 옵션(서버가 넣어 줌)
|
||||
if ((qs.has("y") || qs.has("m")) && saved && VIEWS.indexOf(saved) >= 0) currentView = saved;
|
||||
else if (isPro && qs.get("scope") === "all") currentView = "dashboard";
|
||||
else if (isPAdmin && qs.get("embed") !== "1" && VIEWS.indexOf(preferred) >= 0) currentView = preferred; // 업무 창 패널(iframe)은 그대로 보드
|
||||
else if (qs.get("embed") !== "1" && VIEWS.indexOf(preferred) >= 0) currentView = preferred; // 업무 창 패널(iframe)은 그대로 보드
|
||||
} catch (_) {}
|
||||
|
||||
// ── 프로젝트 스코프 — 아사나처럼 기본은 "이 프로젝트만", "전체 프로젝트"로
|
||||
@@ -3714,10 +3712,13 @@
|
||||
if (!btn) return;
|
||||
selectView(btn.dataset.view);
|
||||
});
|
||||
// Project 옵션 저장 — 보드 표지 켜기/끄기는 보고 있는 보드에 바로 반영
|
||||
// Project 옵션 저장 — 보드 표지 켜기/끄기는 보고 있는 보드에 바로 반영(다른 사용자는 다음에 화면을 열 때)
|
||||
window.addEventListener("pj-options-change", function (e) {
|
||||
const changed = (e.detail && e.detail.changed) || [];
|
||||
if (changed.indexOf("board_cover") >= 0 && currentView === "board") renderBoard();
|
||||
const d = e.detail || {}, changed = d.changed || [], opts = d.options || {};
|
||||
if (typeof opts.default_view === "string") root.dataset.defaultView = opts.default_view;
|
||||
if (changed.indexOf("board_cover") < 0 || typeof opts.board_cover !== "boolean") return;
|
||||
boardCover = opts.board_cover;
|
||||
if (currentView === "board") renderBoard();
|
||||
});
|
||||
// 서버가 그린 기본 탭(보드)과 기억된 탭이 다르면 화면을 맞춰준다.
|
||||
if (currentView !== "board") {
|
||||
@@ -5949,7 +5950,7 @@
|
||||
// 카드 윗부분(배지·제목·담당자/마감일/세부 작업 줄)은 .pj-card-head 로 묶는다 —
|
||||
// 세부 작업을 펼쳐 컬럼을 스크롤하면 이 부분이 컬럼 맨 위에 고정된다(CSS sticky).
|
||||
// 설명에 이미지가 있으면 첫 이미지를 카드 위에(아사나 카드 표지) — Project 옵션 "카드 표지 이미지"로 끌 수 있다
|
||||
const cover = !isPAdmin || boardCoverOn() ? cardCoverSrc(t.description) : "";
|
||||
const cover = boardCover ? cardCoverSrc(t.description) : "";
|
||||
card.classList.toggle("has-cover", !!cover);
|
||||
card.innerHTML =
|
||||
(cover ? '<div class="pj-card-cover"><img src="' + escapeHtml(cover) + '" alt="" loading="lazy" draggable="false"></div>' : "") +
|
||||
@@ -9818,7 +9819,25 @@
|
||||
function initHoverTips() {
|
||||
let tipEl = null;
|
||||
let shown = false;
|
||||
function show(text, x, y) {
|
||||
// 모달 대화창(dialog.showModal — Project 옵션 등)은 브라우저 맨 위 층(top layer)에 떠서 body 의 말풍선이
|
||||
// z-index 와 상관없이 그 뒤에 가려진다. 그 안에서는 말풍선을 popover 로 띄워 같은 층, 대화창보다 위에 둔다.
|
||||
function inModal(target) {
|
||||
const dlg = target.closest("dialog[open]");
|
||||
if (!dlg) return false;
|
||||
try { return dlg.matches(":modal"); } catch (_) { return true; }
|
||||
}
|
||||
function topLayer(on) {
|
||||
if (typeof tipEl.showPopover !== "function") return; // popover 미지원 브라우저 — 예전처럼
|
||||
const open = tipEl.hasAttribute("popover") && tipEl.matches(":popover-open");
|
||||
if (on) {
|
||||
if (!tipEl.hasAttribute("popover")) tipEl.setAttribute("popover", "manual");
|
||||
if (!open) tipEl.showPopover();
|
||||
} else if (tipEl.hasAttribute("popover")) {
|
||||
if (open) tipEl.hidePopover();
|
||||
tipEl.removeAttribute("popover");
|
||||
}
|
||||
}
|
||||
function show(text, x, y, modal) {
|
||||
if (!tipEl) {
|
||||
tipEl = document.createElement("div");
|
||||
tipEl.className = "pj-hovertip";
|
||||
@@ -9826,6 +9845,7 @@
|
||||
}
|
||||
tipEl.textContent = text;
|
||||
tipEl.hidden = false;
|
||||
topLayer(!!modal);
|
||||
// 화면 가장자리 보정 — 좌우로 넘치면 말풍선만 안쪽으로 밀고 꼬리는
|
||||
// 커서를 계속 가리키게(--pj-tip-shift).
|
||||
// 늘 커서 **위**에 — 마우스 화살표(핫스팟에서 아래로 약 20px)에 가려지지 않게. 화면 맨 위(회의록 머리 버튼 등)라
|
||||
@@ -9842,7 +9862,7 @@
|
||||
tipEl.style.left = cx + "px";
|
||||
tipEl.style.top = (below ? y + 28 : roomy ? y - 10 : y - 2) + "px";
|
||||
}
|
||||
function hide() { shown = false; if (tipEl) tipEl.hidden = true; }
|
||||
function hide() { shown = false; if (tipEl) { topLayer(false); tipEl.hidden = true; } }
|
||||
document.addEventListener("mouseover", function (e) {
|
||||
const el = e.target.closest ? e.target.closest("[title]") : null;
|
||||
if (!el) return;
|
||||
@@ -9854,7 +9874,7 @@
|
||||
const target = e.target.closest ? e.target.closest("[data-tip]") : null;
|
||||
if (!target || !target.dataset.tip) { if (shown) hide(); return; }
|
||||
shown = true;
|
||||
show(target.dataset.tip, e.clientX, e.clientY);
|
||||
show(target.dataset.tip, e.clientX, e.clientY, inModal(target));
|
||||
});
|
||||
// 누르거나 스크롤하면 숨긴다 — 클릭으로 요소가 다시 그려지면 말풍선만
|
||||
// 허공에 남는 일이 없게.
|
||||
|
||||
Reference in New Issue
Block a user