mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
explore: add some extra time for angular query editors to update query (#16955)
Now when loading a query editor which changes the default query in the constructor this will result in the actual updated query is used in explore when running the query. Without this, the query used is sort of out of sync between query editor and executed query.
This commit is contained in:
parent
6dbaa704bc
commit
e7930a27b5
@ -41,11 +41,15 @@ export default class QueryEditor extends PureComponent<QueryEditorProps, any> {
|
||||
datasource,
|
||||
target,
|
||||
refresh: () => {
|
||||
this.props.onQueryChange(target);
|
||||
this.props.onExecuteQuery();
|
||||
setTimeout(() => {
|
||||
this.props.onQueryChange(target);
|
||||
this.props.onExecuteQuery();
|
||||
}, 1);
|
||||
},
|
||||
onQueryChange: () => {
|
||||
this.props.onQueryChange(target);
|
||||
setTimeout(() => {
|
||||
this.props.onQueryChange(target);
|
||||
}, 1);
|
||||
},
|
||||
events: exploreEvents,
|
||||
panel: { datasource, targets: [target] },
|
||||
@ -54,7 +58,9 @@ export default class QueryEditor extends PureComponent<QueryEditorProps, any> {
|
||||
};
|
||||
|
||||
this.component = loader.load(this.element, scopeProps, template);
|
||||
this.props.onQueryChange(target);
|
||||
setTimeout(() => {
|
||||
this.props.onQueryChange(target);
|
||||
}, 1);
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: QueryEditorProps) {
|
||||
|
Loading…
Reference in New Issue
Block a user