Making sure we pass helpNode without Parents to the pathfinder app.

This commit is contained in:
Marcus Andersson 2025-10-01 19:34:27 +02:00
parent 6b5b966a96
commit 6584361f66
No known key found for this signature in database
GPG Key ID: 5E93670261CE6DED
1 changed files with 11 additions and 0 deletions

View File

@ -127,6 +127,9 @@ export const SingleTopBar = memo(function SingleTopBar({
new OpenExtensionSidebarEvent({ new OpenExtensionSidebarEvent({
pluginId: 'grafana-grafanadocsplugin-app', pluginId: 'grafana-grafanadocsplugin-app',
componentTitle: 'Grafana Pathfinder', componentTitle: 'Grafana Pathfinder',
props: {
helpNode: withoutParents(enrichedHelpNode),
},
}) })
); );
} }
@ -154,6 +157,14 @@ export const SingleTopBar = memo(function SingleTopBar({
); );
}); });
function withoutParents(node: NavModelItem): NavModelItem {
const { parentItem, ...rest } = node;
return {
...rest,
children: node.children?.map(withoutParents),
};
}
const getStyles = (theme: GrafanaTheme2, menuDockedAndOpen: boolean) => ({ const getStyles = (theme: GrafanaTheme2, menuDockedAndOpen: boolean) => ({
layout: css({ layout: css({
height: getChromeHeaderLevelHeight(), height: getChromeHeaderLevelHeight(),