refactor: align document type page with root groups

This commit is contained in:
wren
2026-05-06 14:20:53 +08:00
parent 5366270ad6
commit 63bf3f56ce
6 changed files with 334 additions and 467 deletions
+5 -1
View File
@@ -1032,11 +1032,15 @@ function buildFallbackRoutes(roleKey: string): {
};
}
function isLegacyRuleSetsMenu(path: string | undefined): boolean {
return path === '/rules/sets';
}
function normalizeMenuStructure(menuItems: MenuItem[]): MenuItem[] {
const clonedMenuItems = menuItems.map(item => ({
...item,
children: item.children ? normalizeMenuStructure(item.children) : undefined,
}));
})).filter(item => !isLegacyRuleSetsMenu(item.path));
const collectDescendantPaths = (items: MenuItem[] | undefined): string[] => {
if (!items || items.length === 0) {