mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
stackdriver: broadcasting through $scope doesnt work anymore since query_filter_ctrl is now a sibling directive to query_aggregation_ctrl, so broadcasting is now done using $rootScope
This commit is contained in:
parent
a63877bd4f
commit
5bc6d857a7
@ -32,7 +32,11 @@ export class StackdriverAggregationCtrl {
|
||||
this.alignOptions = options.alignOptions;
|
||||
this.setAggOptions();
|
||||
this.setAlignOptions();
|
||||
$scope.$on('metricTypeChanged', this.setAlignOptions.bind(this));
|
||||
const self = this;
|
||||
$scope.$on('metricTypeChanged', () => {
|
||||
self.setAggOptions();
|
||||
self.setAlignOptions();
|
||||
});
|
||||
}
|
||||
|
||||
setAlignOptions() {
|
||||
|
@ -41,7 +41,7 @@ export class StackdriverFilterCtrl {
|
||||
datasource: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $scope, private uiSegmentSrv, private templateSrv) {
|
||||
constructor(private $scope, private uiSegmentSrv, private templateSrv, private $rootScope) {
|
||||
this.datasource = $scope.datasource;
|
||||
this.target = $scope.target;
|
||||
this.metricType = $scope.defaultDropdownValue;
|
||||
@ -180,7 +180,7 @@ export class StackdriverFilterCtrl {
|
||||
this.target.unit = unit;
|
||||
this.target.valueType = valueType;
|
||||
this.target.metricKind = metricKind;
|
||||
this.$scope.$broadcast('metricTypeChanged');
|
||||
this.$rootScope.$broadcast('metricTypeChanged');
|
||||
}
|
||||
|
||||
async getGroupBys(segment, index, removeText?: string, removeUsed = true) {
|
||||
|
@ -420,7 +420,7 @@ function createCtrlWithFakes(existingFilters?: string[]) {
|
||||
refresh: () => {},
|
||||
};
|
||||
|
||||
return new StackdriverFilterCtrl(scope, fakeSegmentServer, new TemplateSrvStub());
|
||||
return new StackdriverFilterCtrl(scope, fakeSegmentServer, new TemplateSrvStub(), { $broadcast: param => {} });
|
||||
}
|
||||
|
||||
function createTarget(existingFilters?: string[]) {
|
||||
|
Loading…
Reference in New Issue
Block a user