added this:any to functions and changed functions to arrowfunctions

This commit is contained in:
Patrick O'Carroll
2018-08-30 10:49:18 +02:00
parent 80d6ef535d
commit a8547ae36e
18 changed files with 53 additions and 62 deletions

View File

@@ -140,15 +140,12 @@ export class DashboardMigrator {
}
// ensure query refIds
panelUpgrades.push(function(panel) {
_.each(
panel.targets,
function(target) {
if (!target.refId) {
target.refId = this.dashboard.getNextQueryLetter(panel);
}
}.bind(this)
);
panelUpgrades.push(panel => {
_.each(panel.targets, target => {
if (!target.refId) {
target.refId = this.dashboard.getNextQueryLetter(panel);
}
});
});
}

View File

@@ -2,7 +2,7 @@ import angular from 'angular';
import { ChangeTracker } from './change_tracker';
/** @ngInject */
export function unsavedChangesSrv($rootScope, $q, $location, $timeout, contextSrv, dashboardSrv, $window) {
export function unsavedChangesSrv(this: any, $rootScope, $q, $location, $timeout, contextSrv, dashboardSrv, $window) {
this.init = function(dashboard, scope) {
this.tracker = new ChangeTracker(dashboard, scope, 1000, $location, $window, $timeout, contextSrv, $rootScope);
return this.tracker;

View File

@@ -3,7 +3,7 @@ import { VariableSrv } from '../variable_srv';
import moment from 'moment';
import $q from 'q';
describe('VariableSrv', function() {
describe('VariableSrv', function(this: any) {
const ctx = <any>{
datasourceSrv: {},
timeSrv: {

View File

@@ -4,7 +4,7 @@ import _ from 'lodash';
import { VariableSrv } from '../variable_srv';
import $q from 'q';
describe('VariableSrv init', function() {
describe('VariableSrv init', function(this: any) {
const templateSrv = {
init: vars => {
this.variables = vars;