PanelEdit: Fixes showIf for panel level options, fixes configRev when switching panels (#33173)

This commit is contained in:
Torkel Ödegaard 2021-04-20 21:22:58 +02:00 committed by GitHub
parent af46bbf654
commit 2bb7eb18d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -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;

View File

@ -105,6 +105,7 @@ const mustKeepProps: { [str: string]: boolean } = {
replaceVariables: true,
libraryPanel: true,
getDisplayTitle: true,
configRev: true,
};
const defaults: any = {