Types: Adds type safety to appEvents (#19418)

* Types: Add type safety to appEvents
This commit is contained in:
kay delaney
2019-10-14 09:27:47 +01:00
committed by GitHub
parent e7c37cc316
commit 99411bf37a
138 changed files with 991 additions and 508 deletions

View File

@@ -7,6 +7,8 @@ import _ from 'lodash';
import * as queryDef from './query_def';
import { QueryCtrl } from 'app/plugins/sdk';
import { ElasticsearchAggregation } from './types';
import { GrafanaRootScope } from 'app/routes/GrafanaCtrl';
import { CoreEvents } from 'app/types';
export class ElasticQueryCtrl extends QueryCtrl {
static templateUrl = 'partials/query.editor.html';
@@ -15,7 +17,12 @@ export class ElasticQueryCtrl extends QueryCtrl {
rawQueryOld: string;
/** @ngInject */
constructor($scope: any, $injector: auto.IInjectorService, private $rootScope: any, private uiSegmentSrv: any) {
constructor(
$scope: any,
$injector: auto.IInjectorService,
private $rootScope: GrafanaRootScope,
private uiSegmentSrv: any
) {
super($scope, $injector);
this.esVersion = this.datasource.esVersion;
@@ -50,7 +57,7 @@ export class ElasticQueryCtrl extends QueryCtrl {
}
this.rawQueryOld = newJson;
this.$rootScope.appEvent('elastic-query-updated');
this.$rootScope.appEvent(CoreEvents.elasticQueryUpdated);
}
getCollapsedText() {