NestedFolders: Show Dashboard and Folder full breadcrumb hierarchy (#68308)

* update FolderDTO to match backend struct

* hacky way to get folder page breadcrumbs working

* hacky way to get dashboard nested breadcrumbs working

* undo route changes, get url from folder

* fix breadcrumbs in dashboard settings

* add parent pages to navIndex

* adjust getRootSectionForNode to just return the parent of a leaf node

* undo changes to generated files

* undo changes to toggles_gen.go

* feature toggle dashboardInit code

* remove unnecessary code in home dashboard

* build navModel directly, don't use getNavModel

* don't need fallback here

* remove getLoadingNav since it's not used anymore

* don't need to hide tabs from breadcrumbs anymore

* use id to find dashboards tab
This commit is contained in:
Ashley Harrison
2023-05-16 13:54:44 +01:00
committed by GitHub
parent 0db397b8be
commit 82114cb316
12 changed files with 114 additions and 44 deletions

View File

@@ -170,6 +170,13 @@ function getSettingsPages(dashboard: DashboardModel) {
return pages;
}
function applySectionAsParent(node: NavModelItem, parent: NavModelItem): NavModelItem {
return {
...node,
parentItem: node.parentItem ? applySectionAsParent(node.parentItem, parent) : parent,
};
}
function getSectionNav(
pageNav: NavModelItem,
sectionNav: NavModel,
@@ -194,22 +201,9 @@ function getSectionNav(
subTitle: page.subTitle,
}));
if (pageNav.parentItem) {
pageNav = {
...pageNav,
parentItem: {
...pageNav.parentItem,
parentItem: sectionNav.node,
},
};
} else {
pageNav = {
...pageNav,
parentItem: sectionNav.node,
};
}
const pageNavWithSectionParent = applySectionAsParent(pageNav, sectionNav.node);
main.parentItem = pageNav;
main.parentItem = pageNavWithSectionParent;
return {
main,