From 6584361f664feb9c2cf9bc8a3192d2df1f92c85c Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Wed, 1 Oct 2025 19:34:27 +0200 Subject: [PATCH] Making sure we pass helpNode without Parents to the pathfinder app. --- .../core/components/AppChrome/TopBar/SingleTopBar.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/public/app/core/components/AppChrome/TopBar/SingleTopBar.tsx b/public/app/core/components/AppChrome/TopBar/SingleTopBar.tsx index 2ce16f87417..7de5542b783 100644 --- a/public/app/core/components/AppChrome/TopBar/SingleTopBar.tsx +++ b/public/app/core/components/AppChrome/TopBar/SingleTopBar.tsx @@ -127,6 +127,9 @@ export const SingleTopBar = memo(function SingleTopBar({ new OpenExtensionSidebarEvent({ pluginId: 'grafana-grafanadocsplugin-app', 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) => ({ layout: css({ height: getChromeHeaderLevelHeight(),