PanelEdit: Update UI if panel plugin changes field config (#29898)

This commit is contained in:
Torkel Ödegaard 2020-12-17 13:30:55 +01:00 committed by GitHub
parent ae575158ed
commit 72736bd2a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -127,12 +127,11 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
};
onFieldConfigChange = (config: FieldConfigSource) => {
const { panel } = this.props;
panel.updateFieldConfig({
// we do not need to trigger force update here as the function call below
// fires PanelOptionsChangedEvent which we subscribe to above
this.props.panel.updateFieldConfig({
...config,
});
this.forceUpdate();
};
onPanelOptionsChanged = (options: any) => {

View File

@ -223,6 +223,7 @@ export class PanelModel implements DataConfigSource {
updateFieldConfig(config: FieldConfigSource) {
this.fieldConfig = config;
this.events.publish(new PanelOptionsChangedEvent());
this.resendLastResult();
this.render();