mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Types: Adds type safety to appEvents (#19418)
* Types: Add type safety to appEvents
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user