mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Dashboard: Only show Starred
as parent breadcrumb for starred dashboards (#87145)
don't update pageNav to have folder if sectionNav is starred
This commit is contained in:
parent
5cee521dc9
commit
f15f21a13f
@ -458,19 +458,6 @@ function updateStatePageNavFromProps(props: Props, state: State): State {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const { folderUid } = dashboard.meta;
|
|
||||||
if (folderUid && pageNav) {
|
|
||||||
const folderNavModel = getNavModel(navIndex, `folder-dashboards-${folderUid}`).main;
|
|
||||||
// If the folder hasn't loaded (maybe user doesn't have permission on it?) then
|
|
||||||
// don't show the "page not found" breadcrumb
|
|
||||||
if (folderNavModel.id !== 'not-found') {
|
|
||||||
pageNav = {
|
|
||||||
...pageNav,
|
|
||||||
parentItem: folderNavModel,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (props.route.routeName === DashboardRoutes.Path) {
|
if (props.route.routeName === DashboardRoutes.Path) {
|
||||||
sectionNav = getRootContentNavModel();
|
sectionNav = getRootContentNavModel();
|
||||||
const pageNav = getPageNavFromSlug(props.match.params.slug!);
|
const pageNav = getPageNavFromSlug(props.match.params.slug!);
|
||||||
@ -485,6 +472,19 @@ function updateStatePageNavFromProps(props: Props, state: State): State {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { folderUid } = dashboard.meta;
|
||||||
|
if (folderUid && pageNav && sectionNav.main.id !== 'starred') {
|
||||||
|
const folderNavModel = getNavModel(navIndex, `folder-dashboards-${folderUid}`).main;
|
||||||
|
// If the folder hasn't loaded (maybe user doesn't have permission on it?) then
|
||||||
|
// don't show the "page not found" breadcrumb
|
||||||
|
if (folderNavModel.id !== 'not-found') {
|
||||||
|
pageNav = {
|
||||||
|
...pageNav,
|
||||||
|
parentItem: folderNavModel,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (state.editPanel || state.viewPanel) {
|
if (state.editPanel || state.viewPanel) {
|
||||||
pageNav = {
|
pageNav = {
|
||||||
...pageNav,
|
...pageNav,
|
||||||
|
Loading…
Reference in New Issue
Block a user