mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user