From 06c24476dca2a65aee76a8d7534cf2bb2d5858c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Jamr=C3=B3z?= Date: Wed, 5 May 2021 16:21:40 +0200 Subject: [PATCH] Graphite: Pass date range to auto-complete for metrics (#33707) --- public/app/features/explore/QueryEditor.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/public/app/features/explore/QueryEditor.tsx b/public/app/features/explore/QueryEditor.tsx index 6e3cf533cc5..f8176d41bc4 100644 --- a/public/app/features/explore/QueryEditor.tsx +++ b/public/app/features/explore/QueryEditor.tsx @@ -29,7 +29,7 @@ export default class QueryEditor extends PureComponent { return; } - const { datasource, initialQuery, exploreEvents } = this.props; + const { datasource, initialQuery, exploreEvents, range } = this.props; const loader = getAngularLoader(); const template = ' '; @@ -38,6 +38,7 @@ export default class QueryEditor extends PureComponent { 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 { 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