mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
QueryEditors: Fixes issue that happens after moving queries then editing would update other queries (#31193)
This commit is contained in:
parent
5218497a3e
commit
0c3c17592e
@ -75,7 +75,7 @@ export class QueryEditorRow extends PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getAngularQueryComponentScope(): AngularQueryComponentScope {
|
getAngularQueryComponentScope(): AngularQueryComponentScope {
|
||||||
const { query, onChange, onRunQuery, queries } = this.props;
|
const { query, queries } = this.props;
|
||||||
const { datasource } = this.state;
|
const { datasource } = this.state;
|
||||||
const panel = new PanelModel({ targets: queries });
|
const panel = new PanelModel({ targets: queries });
|
||||||
const dashboard = {} as DashboardModel;
|
const dashboard = {} as DashboardModel;
|
||||||
@ -87,8 +87,10 @@ export class QueryEditorRow extends PureComponent<Props, State> {
|
|||||||
dashboard: dashboard,
|
dashboard: dashboard,
|
||||||
refresh: () => {
|
refresh: () => {
|
||||||
// Old angular editors modify the query model and just call refresh
|
// Old angular editors modify the query model and just call refresh
|
||||||
onChange(query);
|
// Important that this use this.props here so that as this fuction is only created on mount and it's
|
||||||
onRunQuery();
|
// important not to capture old prop functions in this closure
|
||||||
|
this.props.onChange(query);
|
||||||
|
this.props.onRunQuery();
|
||||||
},
|
},
|
||||||
render: () => () => console.log('legacy render function called, it does nothing'),
|
render: () => () => console.log('legacy render function called, it does nothing'),
|
||||||
events: new EventBusSrv(),
|
events: new EventBusSrv(),
|
||||||
|
Loading…
Reference in New Issue
Block a user