Graphite: Pass date range to auto-complete for metrics (#33707)

This commit is contained in:
Piotr Jamróz
2021-05-05 16:21:40 +02:00
committed by GitHub
parent 8f210db17a
commit 06c24476dc

View File

@@ -29,7 +29,7 @@ export default class QueryEditor extends PureComponent<QueryEditorProps, any> {
return;
}
const { datasource, initialQuery, exploreEvents } = this.props;
const { datasource, initialQuery, exploreEvents, range } = this.props;
const loader = getAngularLoader();
const template = '<plugin-component type="query-ctrl"> </plugin-component>';
@@ -38,6 +38,7 @@ export default class QueryEditor extends PureComponent<QueryEditorProps, any> {
ctrl: {
datasource,
target,
range,
refresh: () => {
setTimeout(() => {
// the "hide" attribute of the quries can be changed from the "outside",
@@ -79,6 +80,10 @@ export default class QueryEditor extends PureComponent<QueryEditorProps, any> {
this.angularScope.toggleEditorMode();
}
if (this.angularScope) {
this.angularScope.range = this.props.range;
}
if (hasNewError || hasToggledEditorMode) {
// Some query controllers listen to data error events and need a digest
// for some reason this needs to be done in next tick