Browse Source

stackdriver: typescriptifying controller

Erik Sundell 7 years ago
parent
commit
7f43909390

+ 3 - 3
public/app/plugins/datasource/stackdriver/query_aggregation_ctrl.ts

@@ -22,7 +22,7 @@ export class StackdriverAggregationCtrl {
   aggOptions: any[];
   aggOptions: any[];
   refresh: () => void;
   refresh: () => void;
 
 
-  constructor(private $scope) {
+  constructor($scope) {
     this.aggOptions = options.aggOptions;
     this.aggOptions = options.aggOptions;
     this.alignOptions = options.alignOptions;
     this.alignOptions = options.alignOptions;
     $scope.alignmentPeriods = options.alignmentPeriods;
     $scope.alignmentPeriods = options.alignmentPeriods;
@@ -33,14 +33,14 @@ export class StackdriverAggregationCtrl {
     this.refresh = $scope.refresh;
     this.refresh = $scope.refresh;
   }
   }
 
 
-  onAlignmentChange(newVal) {
+  onAlignmentChange(newVal: string) {
     if (newVal === 'ALIGN_NONE') {
     if (newVal === 'ALIGN_NONE') {
       this.target.aggregation.crossSeriesReducer = 'REDUCE_NONE';
       this.target.aggregation.crossSeriesReducer = 'REDUCE_NONE';
     }
     }
     this.refresh();
     this.refresh();
   }
   }
 
 
-  onAggregationChange(newVal) {
+  onAggregationChange(newVal: string) {
     if (newVal !== 'REDUCE_NONE') {
     if (newVal !== 'REDUCE_NONE') {
       const newAlignmentOption = options.alignOptions.find(o => o.value !== 'ALIGN_NONE');
       const newAlignmentOption = options.alignOptions.find(o => o.value !== 'ALIGN_NONE');
       this.target.aggregation.perSeriesAligner = newAlignmentOption ? newAlignmentOption.value : '';
       this.target.aggregation.perSeriesAligner = newAlignmentOption ? newAlignmentOption.value : '';