mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user