From 2bb7eb18d1c06b20db63d9e0a9aeca3a8adbb97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 20 Apr 2021 21:22:58 +0200 Subject: [PATCH] PanelEdit: Fixes showIf for panel level options, fixes configRev when switching panels (#33173) --- .../components/PanelEditor/getVizualizationOptions.tsx | 4 ++++ public/app/features/dashboard/state/PanelModel.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/public/app/features/dashboard/components/PanelEditor/getVizualizationOptions.tsx b/public/app/features/dashboard/components/PanelEditor/getVizualizationOptions.tsx index 0600f143b4a..cce260e7393 100644 --- a/public/app/features/dashboard/components/PanelEditor/getVizualizationOptions.tsx +++ b/public/app/features/dashboard/components/PanelEditor/getVizualizationOptions.tsx @@ -41,6 +41,10 @@ export function getVizualizationOptions(props: OptionPaneRenderProps): OptionsPa * Panel options */ for (const pluginOption of plugin.optionEditors.list()) { + if (pluginOption.showIf && !pluginOption.showIf(currentOptions, data?.series)) { + continue; + } + const category = getOptionsPaneCategory(pluginOption.category); const Editor = pluginOption.editor; diff --git a/public/app/features/dashboard/state/PanelModel.ts b/public/app/features/dashboard/state/PanelModel.ts index 52008c4bde6..0e757bcdbd8 100644 --- a/public/app/features/dashboard/state/PanelModel.ts +++ b/public/app/features/dashboard/state/PanelModel.ts @@ -105,6 +105,7 @@ const mustKeepProps: { [str: string]: boolean } = { replaceVariables: true, libraryPanel: true, getDisplayTitle: true, + configRev: true, }; const defaults: any = {