mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
PanelEdit: Update UI if panel plugin changes field config (#29898)
This commit is contained in:
@@ -127,12 +127,11 @@ export class PanelEditorUnconnected extends PureComponent<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onFieldConfigChange = (config: FieldConfigSource) => {
|
onFieldConfigChange = (config: FieldConfigSource) => {
|
||||||
const { panel } = this.props;
|
// we do not need to trigger force update here as the function call below
|
||||||
|
// fires PanelOptionsChangedEvent which we subscribe to above
|
||||||
panel.updateFieldConfig({
|
this.props.panel.updateFieldConfig({
|
||||||
...config,
|
...config,
|
||||||
});
|
});
|
||||||
this.forceUpdate();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onPanelOptionsChanged = (options: any) => {
|
onPanelOptionsChanged = (options: any) => {
|
||||||
|
|||||||
@@ -223,6 +223,7 @@ export class PanelModel implements DataConfigSource {
|
|||||||
|
|
||||||
updateFieldConfig(config: FieldConfigSource) {
|
updateFieldConfig(config: FieldConfigSource) {
|
||||||
this.fieldConfig = config;
|
this.fieldConfig = config;
|
||||||
|
this.events.publish(new PanelOptionsChangedEvent());
|
||||||
|
|
||||||
this.resendLastResult();
|
this.resendLastResult();
|
||||||
this.render();
|
this.render();
|
||||||
|
|||||||
Reference in New Issue
Block a user