diff --git a/fe-admin/src/components/Layout.tsx b/fe-admin/src/components/Layout.tsx index 6f7c2d8..3a841fc 100644 --- a/fe-admin/src/components/Layout.tsx +++ b/fe-admin/src/components/Layout.tsx @@ -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[] { diff --git a/fe-user/src/components/Layout.tsx b/fe-user/src/components/Layout.tsx index c3b800e..4abd94b 100644 --- a/fe-user/src/components/Layout.tsx +++ b/fe-user/src/components/Layout.tsx @@ -96,8 +96,12 @@ function resolvePath(key: string): string | null { // Menu entries not applicable to user app — filtered out client-side so the // sidebar only shows what matters to a contract drafter/approver. +// [Plan CA S29 2026-05-22] REMOVED `Master, Suppliers, Projects, Departments` +// khỏi hidden set — "Cấu hình danh mục dùng chung" giờ ở fe-user/eoffice cho +// role CatalogManager (admin tạo + gán qua Permission Matrix). Catalogs (root +// + 4 leaf) tree-inherit từ Master nên auto-visible. Forms/Reports/System/ +// Users/Roles/Permissions vẫn ẩn (admin tools only). const USER_HIDDEN_KEYS = new Set([ - 'Master', 'Suppliers', 'Projects', 'Departments', 'System', 'Users', 'Roles', 'Permissions', 'Forms', 'Reports', ])