From e55d96b85686fd2618718c16fbbfc9dc604d0f3b Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Fri, 22 May 2026 11:38:10 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20FE-User:=20Plan=20CA=20Hotfix=201=20?= =?UTF-8?q?=E2=80=94=20Add=207=20master/catalog=20leaf=20routes=20v=C3=A0o?= =?UTF-8?q?=20resolvePath=20staticMap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug UAT bro screenshot 2026-05-22: eoffice sidebar group "DANH MỤC" expand chỉ thấy "Danh mục chi tiết" (Catalogs sub-group), 3 leaf Suppliers/Projects/ Departments + 4 sub-catalog leaves KHÔNG render. Root cause: fe-user/src/components/Layout.tsx:238 `MenuLeaf` component `if (!path) return null` → silent drop khi resolvePath(key) trả null. Implementer Chunk B (06a441c) thêm Routes vào App.tsx + 4 page + menuKeys.ts NHƯNG QUÊN mirror staticMap resolvePath (line 55-94) — fe-admin có sẵn 7 entries nhưng fe-user chỉ có 7 entries Dashboard/Contracts/PE/Budget. Fix: thêm 7 entries vào fe-user staticMap mirror fe-admin EXACT route: - Suppliers: '/master/suppliers' - Projects: '/master/projects' - Departments: '/master/departments' - CatalogUnits: '/master/catalogs/units' - CatalogMaterials: '/master/catalogs/materials' - CatalogServices: '/master/catalogs/services' - CatalogWorkItems: '/master/catalogs/work-items' Verify: - npm run build PASS 9.68s 0 TS err - BE /api/menus/me admin token return CORRECT tree (Master + 4 children + Catalogs sub-tree 4 children) — verified curl pre-fix - Permissions OK: Admin 9/9 CRUD + CatalogManager 9/9 CRUD (verified sqlcmd) - fe-admin parity already correct (Layout.tsx:33-47 staticMap có 7 entries từ trước Plan CA) Pattern reusable: Khi Implementer Case 2 cookie-cutter mirror page move cross-app, MUST also mirror Layout.tsx resolvePath staticMap entries — KHÔNG chỉ Routes + menuKeys.ts. Gotcha discovery thêm vào MEMORY post-deploy. Plan CA chain (6 commits cumulative): - A 80d39a0 BE Role + Seed - B 06a441c FE move 4 master pages (missed resolvePath mirror) - C c995f42 Sidebar filter 2 app - D 4a592cf Seed demo user - D2 68bcedd Password ≥12 chars hotfix - HF1 (this) Mirror resolvePath staticMap 7 entries Co-Authored-By: Claude Opus 4.7 (1M context) --- fe-user/src/components/Layout.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fe-user/src/components/Layout.tsx b/fe-user/src/components/Layout.tsx index 4abd94b..070c6f8 100644 --- a/fe-user/src/components/Layout.tsx +++ b/fe-user/src/components/Layout.tsx @@ -61,6 +61,18 @@ function resolvePath(key: string): string | null { Bg_List: '/budgets', Bg_Create: '/budgets/new', Bg_Pending: '/budgets?phase=Pending', + // [Plan CA Hotfix 1 S29 2026-05-22] 4 master + 4 catalog leaf moved từ + // fe-admin → fe-user. resolvePath PHẢI có route mapping nếu không + // MenuLeaf line 238 `if (!path) return null` → sidebar drop silent. + // Implementer Chunk B (06a441c) thêm Routes vào App.tsx + 4 page + + // menuKeys.ts nhưng quên mirror staticMap resolvePath → bug UAT bro. + Suppliers: '/master/suppliers', + Projects: '/master/projects', + Departments: '/master/departments', + CatalogUnits: '/master/catalogs/units', + CatalogMaterials: '/master/catalogs/materials', + CatalogServices: '/master/catalogs/services', + CatalogWorkItems: '/master/catalogs/work-items', } if (staticMap[key]) return staticMap[key]