mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
prettier: ran on all files again, sorry. now settings are defined in package.json
This commit is contained in:
@@ -14,13 +14,7 @@ export class SettingsCtrl {
|
||||
sections: any[];
|
||||
|
||||
/** @ngInject */
|
||||
constructor(
|
||||
private $scope,
|
||||
private $location,
|
||||
private $rootScope,
|
||||
private backendSrv,
|
||||
private dashboardSrv
|
||||
) {
|
||||
constructor(private $scope, private $location, private $rootScope, private backendSrv, private dashboardSrv) {
|
||||
// temp hack for annotations and variables editors
|
||||
// that rely on inherited scope
|
||||
$scope.dashboard = this.dashboard;
|
||||
@@ -36,11 +30,7 @@ export class SettingsCtrl {
|
||||
this.buildSectionList();
|
||||
this.onRouteUpdated();
|
||||
|
||||
$rootScope.onAppEvent(
|
||||
'$routeUpdate',
|
||||
this.onRouteUpdated.bind(this),
|
||||
$scope
|
||||
);
|
||||
$rootScope.onAppEvent('$routeUpdate', this.onRouteUpdated.bind(this), $scope);
|
||||
}
|
||||
|
||||
buildSectionList() {
|
||||
@@ -139,12 +129,10 @@ export class SettingsCtrl {
|
||||
makeEditable() {
|
||||
this.dashboard.editable = true;
|
||||
|
||||
return this.dashboardSrv
|
||||
.saveDashboard({ makeEditable: true, overwrite: false })
|
||||
.then(() => {
|
||||
// force refresh whole page
|
||||
window.location.href = window.location.href;
|
||||
});
|
||||
return this.dashboardSrv.saveDashboard({ makeEditable: true, overwrite: false }).then(() => {
|
||||
// force refresh whole page
|
||||
window.location.href = window.location.href;
|
||||
});
|
||||
}
|
||||
|
||||
deleteDashboard() {
|
||||
@@ -176,10 +164,7 @@ export class SettingsCtrl {
|
||||
|
||||
deleteDashboardConfirmed() {
|
||||
this.backendSrv.deleteDashboard(this.dashboard.meta.slug).then(() => {
|
||||
appEvents.emit('alert-success', [
|
||||
'Dashboard Deleted',
|
||||
this.dashboard.title + ' has been deleted',
|
||||
]);
|
||||
appEvents.emit('alert-success', ['Dashboard Deleted', this.dashboard.title + ' has been deleted']);
|
||||
this.$location.url('/');
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user