Page: Pages that have hideFromBreadcrumbs set to true should not be added to page Title (#56596)

* Page: Pages that have hideFromBreadcrumbs set to true should not be added to page Title

* Updated test
This commit is contained in:
Torkel Ödegaard
2022-10-10 12:47:04 +02:00
committed by GitHub
parent d405f3a877
commit 462f6b7797
4 changed files with 31 additions and 13 deletions

View File

@ -2,6 +2,7 @@ import { Location as HistoryLocation } from 'history';
import { GrafanaPlugin, NavIndex, NavModel, NavModelItem, PanelPluginMeta, PluginType } from '@grafana/data';
import { config } from '@grafana/runtime';
import { HOME_NAV_ID } from 'app/core/reducers/navModel';
import { getRootSectionForNode } from 'app/core/selectors/navModel';
import { importPanelPluginFromMeta } from './importPanelPlugin';
@ -99,7 +100,7 @@ export function getPluginSection(location: HistoryLocation, navIndex: NavIndex,
// Some plugins like cloud home don't have any precense in the navtree so we need to allow those
const navTreeNodeForPlugin = navIndex[`plugin-page-${pluginId}`];
if (!navTreeNodeForPlugin) {
return { id: 'root-plugin-page', text: 'Root plugin page', hideFromBreadcrumbs: true };
return navIndex[HOME_NAV_ID];
}
if (!navTreeNodeForPlugin.parentItem) {