From 8e0bd2527c23711bcd1e0e111731fd0ee528b457 Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Fri, 19 Dec 2025 16:21:17 +0100 Subject: [PATCH] wip --- .../scene/DashboardLinksControls.tsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/public/app/features/dashboard-scene/scene/DashboardLinksControls.tsx b/public/app/features/dashboard-scene/scene/DashboardLinksControls.tsx index 6a9ad667217..d45c51d49e0 100644 --- a/public/app/features/dashboard-scene/scene/DashboardLinksControls.tsx +++ b/public/app/features/dashboard-scene/scene/DashboardLinksControls.tsx @@ -17,22 +17,29 @@ export function DashboardLinksControls({ links, dashboard }: Props) { sceneGraph.getTimeRange(dashboard).useState(); const uid = dashboard.state.uid; const styles = useStyles2(getStyles); + const linksToDisplay = excludeControlMenuLinks(links); - if (!links || !uid || links.length === 0) { + if (!uid || linksToDisplay.length === 0) { return null; } return (
- {links - .filter((link) => link.placement === undefined) - .map((link: DashboardLink, index: number) => ( - - ))} + {linksToDisplay.map((link: DashboardLink, index: number) => ( + + ))}
); } +function excludeControlMenuLinks(links: DashboardLink[]): DashboardLink[] { + if (!links || links.length === 0) { + return []; + } + + return links.filter((link) => link.placement === undefined); +} + function getStyles(theme: GrafanaTheme2) { return { linksContainer: css({