[CLAUDE] FE-User: Plan CA Hotfix 1 — Add 7 master/catalog leaf routes vào resolvePath staticMap
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m24s

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) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-05-22 11:38:10 +07:00
parent 68bceddabb
commit e55d96b856

View File

@ -61,6 +61,18 @@ function resolvePath(key: string): string | null {
Bg_List: '/budgets', Bg_List: '/budgets',
Bg_Create: '/budgets/new', Bg_Create: '/budgets/new',
Bg_Pending: '/budgets?phase=Pending', 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] if (staticMap[key]) return staticMap[key]