From df9b36292df2489ac7e73afc144c6e72a39ab7cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 22 Oct 2025 10:40:06 +0200 Subject: [PATCH] SoloPanel: Fixes issue with solo route and scopes variable (#112769) * SoloPanel: Fixes issue with solo route and scopes variable * fix lint --- .../dashboard-scene/solo/SoloPanelPage.tsx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/public/app/features/dashboard-scene/solo/SoloPanelPage.tsx b/public/app/features/dashboard-scene/solo/SoloPanelPage.tsx index f94152f3b99..306776911de 100644 --- a/public/app/features/dashboard-scene/solo/SoloPanelPage.tsx +++ b/public/app/features/dashboard-scene/solo/SoloPanelPage.tsx @@ -77,6 +77,7 @@ export function SoloPanelRenderer({ dashboard, panelId }: { dashboard: Dashboard return (
+ {renderHiddenVariables(dashboard)} @@ -84,6 +85,28 @@ export function SoloPanelRenderer({ dashboard, panelId }: { dashboard: Dashboard ); } +// Some variables like ScopesVariable needs +// to be rendered for their logic to work even if hidden +function renderHiddenVariables(dashboard: DashboardScene) { + if (!dashboard.state.$variables) { + return null; + } + + const variables = dashboard.state.$variables.state.variables; + + return ( + <> + {variables.map((variable) => { + if (variable.UNSAFE_renderAsHidden) { + return ; + } + + return null; + })} + + ); +} + const getStyles = (theme: GrafanaTheme2) => ({ container: css({ position: 'fixed',