mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
StatPanels: Fixes to palette color scheme is not cleared when loading panel (#31126)
This commit is contained in:
@@ -313,11 +313,12 @@ export class PanelModel implements DataConfigSource {
|
||||
this.fieldConfig = restoreCustomOverrideRules(this.fieldConfig, prevOptions.fieldConfig);
|
||||
}
|
||||
|
||||
applyPluginOptionDefaults(plugin: PanelPlugin) {
|
||||
applyPluginOptionDefaults(plugin: PanelPlugin, isAfterPluginChange: boolean) {
|
||||
const options = getPanelOptionsWithDefaults({
|
||||
plugin,
|
||||
currentOptions: this.options,
|
||||
currentFieldConfig: this.fieldConfig,
|
||||
isAfterPluginChange: isAfterPluginChange,
|
||||
});
|
||||
|
||||
this.fieldConfig = options.fieldConfig;
|
||||
@@ -336,7 +337,7 @@ export class PanelModel implements DataConfigSource {
|
||||
}
|
||||
}
|
||||
|
||||
this.applyPluginOptionDefaults(plugin);
|
||||
this.applyPluginOptionDefaults(plugin, false);
|
||||
this.resendLastResult();
|
||||
}
|
||||
|
||||
@@ -389,7 +390,7 @@ export class PanelModel implements DataConfigSource {
|
||||
|
||||
// For some reason I need to rebind replace variables here, otherwise the viz repeater does not work
|
||||
this.replaceVariables = this.replaceVariables.bind(this);
|
||||
this.applyPluginOptionDefaults(newPlugin);
|
||||
this.applyPluginOptionDefaults(newPlugin, true);
|
||||
|
||||
if (newPlugin.onPanelMigration) {
|
||||
this.pluginVersion = getPluginVersion(newPlugin);
|
||||
|
||||
Reference in New Issue
Block a user