From 0dcea161fac0d31bc60cb9d6e9cc3db5d3fa9b8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Tue, 16 Nov 2021 13:48:07 +0100 Subject: [PATCH] Variables: Exclude adhoc variables from the impacted by logic (#41717) --- public/app/features/variables/state/actions.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/app/features/variables/state/actions.ts b/public/app/features/variables/state/actions.ts index 45c88555a2a..392da119971 100644 --- a/public/app/features/variables/state/actions.ts +++ b/public/app/features/variables/state/actions.ts @@ -47,6 +47,7 @@ import { hasLegacyVariableSupport, hasOptions, hasStandardVariableSupport, + isAdHoc, isMulti, isQuery, } from '../guard'; @@ -517,7 +518,9 @@ export const variableUpdated = ( const variables = getVariables(state); const g = createGraph(variables); const panels = state.dashboard?.getModel()?.panels ?? []; - const affectedPanelIds = getAllAffectedPanelIdsForVariableChange(variableInState.id, variables, panels); + const affectedPanelIds = isAdHoc(variableInState) + ? undefined // for adhoc variables we don't know which panels that will be impacted + : getAllAffectedPanelIdsForVariableChange(variableInState.id, variables, panels); const node = g.getNode(variableInState.name); let promises: Array> = [];