From dfa1a2cd411da756301ed4419244e4150d0a9239 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 3 Aug 2021 12:11:51 +0100 Subject: [PATCH] Azure: Fixes annotations query editor not working properly (#37476) (#37477) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 0965132bff8235201025c23dc51206b59fa2358a) Co-authored-by: Torkel Ödegaard --- .../annotations_query_ctrl.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/annotations_query_ctrl.ts b/public/app/plugins/datasource/grafana-azure-monitor-datasource/annotations_query_ctrl.ts index 0995f69ff20..c8200c3ccc1 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/annotations_query_ctrl.ts +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/annotations_query_ctrl.ts @@ -2,15 +2,20 @@ import { getTemplateSrv, TemplateSrv } from '@grafana/runtime'; export class AzureMonitorAnnotationsQueryCtrl { static templateUrl = 'partials/annotations.editor.html'; - datasource: any; - annotation: any; + declare datasource: any; + declare annotation: any; declare workspaces: any[]; declare subscriptions: Array<{ text: string; value: string }>; + private templateSrv: TemplateSrv = getTemplateSrv(); defaultQuery = '\n| where $__timeFilter() \n| project TimeGenerated, Text=YourTitleColumn, Tags="tag1,tag2"'; - constructor(private templateSrv: TemplateSrv = getTemplateSrv()) { + /** @ngInject */ + constructor($scope: any) { + this.annotation = $scope.ctrl.annotation; + this.datasource = $scope.ctrl.datasource; + this.annotation.queryType = this.annotation.queryType || 'Azure Log Analytics'; this.annotation.rawQuery = this.annotation.rawQuery || this.defaultQuery; this.initDropdowns();