Babel: Updates babel dependencies to latest version (#32534)

* Babel: Updates babel dependencies to latest version

* Fixed problem introduced by babel where calling super with prefedefined this is not supported

* fixing test

* Fixed tests

* Improve fix for QueryCtrl

* Fixed more tests

* Updated tests
This commit is contained in:
Torkel Ödegaard
2021-03-31 17:03:07 +02:00
committed by GitHub
parent f456c32f92
commit d92145be28
9 changed files with 906 additions and 976 deletions

View File

@@ -32,6 +32,8 @@ export class PanelCtrl {
timing: any;
constructor($scope: any, $injector: auto.IInjectorService) {
this.panel = this.panel ?? $scope.$parent.panel;
this.dashboard = this.dashboard ?? $scope.$parent.dashboard;
this.$injector = $injector;
this.$location = $injector.get('$location');
this.$scope = $scope;

View File

@@ -11,7 +11,10 @@ export class QueryCtrl {
isLastQuery: boolean;
constructor(public $scope: any, public $injector: auto.IInjectorService) {
this.panel = this.panelCtrl.panel;
this.panelCtrl = this.panelCtrl ?? $scope.ctrl.panelCtrl;
this.target = this.target ?? $scope.ctrl.target;
this.datasource = this.datasource ?? $scope.ctrl.datasource;
this.panel = this.panelCtrl?.panel ?? $scope.ctrl.panelCtrl.panel;
this.isLastQuery = _.indexOf(this.panel.targets, this.target) === this.panel.targets.length - 1;
}

View File

@@ -57,9 +57,11 @@ function setupController({ hasAccessToExplore } = { hasAccessToExplore: false })
onAppEvent: jest.fn(),
$on: jest.fn(),
colors: [],
$parent: {
panel: new PanelModel({ type: 'test' }),
dashboard: {},
},
};
MetricsPanelCtrl.prototype.panel = new PanelModel({ type: 'test' });
return new MetricsPanelCtrl(scope, injectorStub);
}