[CLAUDE] FE-Admin: YC-029 W4 — sidebar Designer 7 leaf QT Duyệt HĐ (resolvePath AwV2_Hd*)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@ -6,6 +6,7 @@ import { useAuth } from '@/contexts/AuthContext'
|
|||||||
import { TopBar } from '@/components/TopBar'
|
import { TopBar } from '@/components/TopBar'
|
||||||
import type { MenuNode } from '@/types/menu'
|
import type { MenuNode } from '@/types/menu'
|
||||||
import { cn } from '@/lib/cn'
|
import { cn } from '@/lib/cn'
|
||||||
|
import { findContractWfByTypeCode } from '@/lib/contractWorkflowFamily'
|
||||||
|
|
||||||
function getIcon(name: string | null): LucideIcon {
|
function getIcon(name: string | null): LucideIcon {
|
||||||
if (!name) return Circle
|
if (!name) return Circle
|
||||||
@ -186,6 +187,12 @@ function resolvePath(key: string): string | null {
|
|||||||
// — fe-admin cố ý KHÔNG có `WorkflowMatrixViewPage` (xem ghi chú khối `Pe_*`
|
// — fe-admin cố ý KHÔNG có `WorkflowMatrixViewPage` (xem ghi chú khối `Pe_*`
|
||||||
// bên trên); nới ở đó = đẻ leaf chết rơi vào catch-all "chưa được build".
|
// bên trên); nới ở đó = đẻ leaf chết rơi vào catch-all "chưa được build".
|
||||||
if (/^KhkkN[1-8]$/.test(code)) return `/system/approval-workflows-v2/${code}`
|
if (/^KhkkN[1-8]$/.test(code)) return `/system/approval-workflows-v2/${code}`
|
||||||
|
// [W4 S190 · YC-029] Họ MỚI `AwV2_Hd*` — 7 quy trình duyệt HĐ per-LOẠI (seed @S188,
|
||||||
|
// sidebar Order 11..17). Vẫn là "chỗ thứ 4" Pattern 16-bis: BE seed leaf mà thiếu nhánh
|
||||||
|
// này thì `resolvePath` trả null ⇒ MenuLeaf DROP IM LẶNG khỏi sidebar (gotcha #50).
|
||||||
|
// 🔴 Tra bằng BẢNG (`lib/contractWorkflowFamily.ts`, mirror BE `ContractApprovalWorkflowFamily.cs`),
|
||||||
|
// KHÔNG regex đoán ngược: `HdNTNCC` chẻ ra `NT-NCC` hay `N-TNCC` là hai mã khác nhau.
|
||||||
|
if (findContractWfByTypeCode(code)) return `/system/approval-workflows-v2/${code}`
|
||||||
}
|
}
|
||||||
|
|
||||||
return null
|
return null
|
||||||
|
|||||||
Reference in New Issue
Block a user