[CLAUDE] FE-Admin+FE-User: Plan CA Chunk C — Sidebar filter 2 app (admin HIDE + user SHOW)
fe-admin/src/components/Layout.tsx: - Add ADMIN_HIDDEN_MASTER_KEYS Set với 9 menu key danh mục - Extend isAdminHidden predicate: hide Ct_* + ADMIN_HIDDEN_MASTER_KEYS - Master/Suppliers/Projects/Departments/Catalogs/4 sub-catalogs giờ ẩn khỏi admin sidebar fe-user/src/components/Layout.tsx: - Remove `Master, Suppliers, Projects, Departments` khỏi USER_HIDDEN_KEYS - Catalogs (root + 4 leaf) auto-visible qua tree-inherit từ Master - Giữ ẩn `System, Users, Roles, Permissions, Forms, Reports` (admin tools) Verify: - npm run build × 2 app PASS 0 TS err - fe-admin bundle `index-BQidGwKU.js` 1,404 KB gz 357 KB (rotate) - fe-user bundle `index-Co8LTtad.js` 1,317 KB gz 342 KB (rotate) - Pattern 5 (mirror 2 app §3.9) applied — cùng 1 plan touch 2 file Layout Plan CA chain: - Chunk A80d39a0BE Role + Seed (em main solo) - Chunk B06a441cFE move 4 pages (Implementer Case 2) - Chunk C (this) sidebar filter (em main solo) - Pending Chunk D: smoke verify + tạo demo user catalog.manager@solutions.com.vn Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -108,8 +108,16 @@ function resolvePath(key: string): string | null {
|
||||
|
||||
// Admin side: hide the per-ContractType contract submenu (Ct_*) — that's a
|
||||
// user-app concern. Keep Wf_* workflow-admin leaves.
|
||||
// [Plan CA S29 2026-05-22] cũng hide "Cấu hình danh mục dùng chung" (Master +
|
||||
// Catalogs) — đã move sang fe-user/eoffice. Admin vẫn phân quyền role × menu ×
|
||||
// CRUD qua /system/permissions (Permission Matrix tự reflect 9 menu key này).
|
||||
const ADMIN_HIDDEN_MASTER_KEYS = new Set([
|
||||
'Master', 'Suppliers', 'Projects', 'Departments',
|
||||
'Catalogs', 'CatalogUnits', 'CatalogMaterials', 'CatalogServices', 'CatalogWorkItems',
|
||||
])
|
||||
|
||||
function isAdminHidden(key: string): boolean {
|
||||
return key.startsWith('Ct_')
|
||||
return key.startsWith('Ct_') || ADMIN_HIDDEN_MASTER_KEYS.has(key)
|
||||
}
|
||||
|
||||
function filterForAdmin(nodes: MenuNode[]): MenuNode[] {
|
||||
|
||||
Reference in New Issue
Block a user