From e0c28cfa4c6daa21341ab4dd9c5a93803668026f Mon Sep 17 00:00:00 2001 From: grafakus Date: Tue, 25 Nov 2025 12:11:37 +0100 Subject: [PATCH] Fix: hide options when multi properties exist on every var options --- .../useVariableSelectionOptionsCategory.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/app/features/dashboard-scene/settings/variables/useVariableSelectionOptionsCategory.tsx b/public/app/features/dashboard-scene/settings/variables/useVariableSelectionOptionsCategory.tsx index d8d0ecfdf28..5f8260ea1b9 100644 --- a/public/app/features/dashboard-scene/settings/variables/useVariableSelectionOptionsCategory.tsx +++ b/public/app/features/dashboard-scene/settings/variables/useVariableSelectionOptionsCategory.tsx @@ -46,8 +46,10 @@ export function useVariableSelectionOptionsCategory(variable: MultiValueVariable ), useShowIf: () => { const state = variable.useState(); - const hasJsonValuesFormat = 'valuesFormat' in state && state.valuesFormat === 'json'; - return hasJsonValuesFormat ? false : (state.includeAll ?? false); + const hasMultiProps = + ('valuesFormat' in state && state.valuesFormat === 'json') || + state.options.every((o) => Boolean(o.properties)); + return hasMultiProps ? false : (state.includeAll ?? false); }, render: (descriptor) => , }) @@ -62,8 +64,10 @@ export function useVariableSelectionOptionsCategory(variable: MultiValueVariable ), useShowIf: () => { const state = variable.useState(); - const hasJsonValuesFormat = 'valuesFormat' in state && state.valuesFormat === 'json'; - return !hasJsonValuesFormat; + const hasMultiProps = + ('valuesFormat' in state && state.valuesFormat === 'json') || + state.options.every((o) => Boolean(o.properties)); + return !hasMultiProps; }, render: (descriptor) => , })