feat(B01): 대시보드 좌측 패널 — 권한별 항목 목록 · 고른 항목 컨테이너만 우측에 · 고른 항목 해시 유지 (99-2)

- 공용 좌측 패널(createWorkflowOverlays · ui-sidebar-list) · 항목 = 권한별 기존 컨테이너 그대로(내 정보 = 기본정보 + 보안)
- 고른 항목 해시 ?tab= 에 남김(hashchange 없이) · 저장 뒤 다시 그려도 유지 · 좁은 화면은 고르면 접음
- 시험 test_b01_side_panel 신규 · test_b01_settings_cards 고침

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MgChuAcyBqUkhHMTXomQC7
This commit is contained in:
2026-10-08 15:03:22 +09:00
co-authored by Claude Sonnet 5.5
parent 1849a11b33
commit d69686a0a8
6 changed files with 288 additions and 87 deletions
+10 -9
View File
@@ -98,14 +98,15 @@ def test_회사_관리자_개인_카드_하나():
def test_모든_역할_한_줄_통째로_접힘():
src = _text(PAGE)
build = _fn(src, "buildPage")
build = _fn(src, "panelItems")
# 세 갈래 모두 한 번씩 · 시스템 관리자는 리소스 현황 아래(29-1) · 프로젝트 위
assert build.count("buildSystemSettingsSection(state)") == 3
sys_part = build.split('} else if (state.user.role === "ADMIN")')[0]
assert "buildSystemSettingsSection(state)" in build
assert len(re.findall(r"^\s+settings,$", build, re.M)) == 3
sys_part = build.split('if (state.user.role === "ADMIN")')[0]
assert (
sys_part.index('L("B01_Dashboard_Resources")')
< sys_part.index("buildSystemSettingsSection(state)")
< sys_part.index('L("B01_Dashboard_Projects")')
sys_part.index('one("resources"')
< sys_part.index(" settings,")
< sys_part.index('one("projects"')
)
assert "StructureManage" not in src and "buildStructurePanel" not in src
assert "top-row" not in src
@@ -132,11 +133,11 @@ def test_회사_알약_시스템_관리자만():
for call in ("fetchAllUsers(companyId)", "fetchCompanyJoinRequests(companyId)",
"fetchCompanyProjects(companyId)"): # fmt: skip
assert call in load, call
build = _fn(src, "buildPage")
build = _fn(src, "panelItems")
# 회사 따라 바뀌는 컨테이너 넷(프로젝트 · 사용자 관리 · 가입 요청 · 회사 관리)마다 알약
sys_part = build.split('} else if (state.user.role === "ADMIN")')[0]
sys_part = build.split('if (state.user.role === "ADMIN")')[0]
assert sys_part.count("withCompanyPill(") == 4
assert "withCompanyPill" not in build.split('} else if (state.user.role === "ADMIN")')[1]
assert "withCompanyPill" not in build.split('if (state.user.role === "ADMIN")')[1]
assert "companyTable(picked, state.user)" in build
assert "openAddMemberModal(undefined, state.adminCompanyId)" in build
+56
View File
@@ -0,0 +1,56 @@
"""B01 대시보드 좌측 패널 시험(99-2) — 권한별 항목 · 해시 유지 · 공용 오버레이. 화면 조작은 ORCA."""
from __future__ import annotations
import re
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
B01 = ROOT / "B01_Dashboard"
def _text(name: str) -> str:
return (B01 / name).read_text(encoding="utf-8")
def _items(role: str) -> list[str]:
"""panelItems 안 권한별 return 목록의 항목 이름(key) 차례."""
body = re.search(r"^function panelItems\([\s\S]*?^}", _text("B01_Dashboard_UI_Page.ts"), re.M)
assert body
lists = re.findall(r"^( *)return \[\n([\s\S]*?)^\1\];", body.group(0), re.M)
part = lists[["SYSTEM_ADMIN", "ADMIN", "USER"].index(role)][1]
found = re.findall(r'one\(\s*"(\w+)"|^ {4,6}(settings|temp|company|myInfo),', part, re.M)
names = [a or b for a, b in found]
return ["profile" if n == "myInfo" else n for n in names]
def test_권한별_항목_차례():
assert _items("SYSTEM_ADMIN") == [
"resources", "settings", "projects", "temp", "users", "requests",
"companies", "profile", "logs",
] # fmt: skip
assert _items("ADMIN") == [
"settings", "projects", "temp", "members", "requests", "company", "profile",
] # fmt: skip
assert _items("USER") == ["settings", "projects", "temp", "company", "profile"]
def test_고른_항목_해시에_남김():
panel = _text("B01_Dashboard_UI_SidePanel.ts")
assert 'currentQuery().get("tab")' in panel
assert "history.replaceState" in panel # hashchange 를 안 일으킴
page = _text("B01_Dashboard_UI_Page.ts")
assert "show(pickActiveKey(items), false)" in page # 다시 그려도 같은 항목
assert 'const ADMIN_COMPANY_KEY = "aislo.adminCompany";' in page
def test_공용_좌측_패널_부품():
page = _text("B01_Dashboard_UI_Page.ts")
assert "createWorkflowOverlays" in page and "showProjectName: false" in page
assert "is-options-open" in page
panel = _text("B01_Dashboard_UI_SidePanel.ts")
assert "ui-sidebar-list" in panel and "ui-sidebar-row" in panel
# 옛 탭 줄 · 해시 탭 부품 없음
assert not (B01 / "B01_Dashboard_UI_Tabs.ts").exists()
# 좁은 화면(≤860) — 고르면 접음
assert "max-width: 860px" in page