Skip to content

Commit

Permalink
Merge pull request #2668 from headlamp-k8s/routing-bug
Browse files Browse the repository at this point in the history
frontend: Sidebar: Filter out hidden routes
  • Loading branch information
joaquimrocha authored Dec 13, 2024
2 parents 22688fa + c7ea3a1 commit fcdf8a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/components/Sidebar/prepareRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,14 @@ function prepareRoutes(
const defaultRoutes: SidebarItemProps[] = sidebars[DefaultSidebars.IN_CLUSTER];
for (const route of defaultRoutes) {
const routeFiltered =
filters.length > 0 && filters.filter(f => f(route)).length !== filters.length;
!route.hide && filters.length > 0 && filters.filter(f => f(route)).length !== filters.length;
if (routeFiltered) {
continue;
}

const newSubList = route.subList?.filter(
subRoute =>
!subRoute.hide &&
!(filters.length > 0 && filters.filter(f => f(subRoute)).length !== filters.length)
);
route.subList = newSubList;
Expand Down

0 comments on commit fcdf8a1

Please sign in to comment.