Commit 97bd00c5 by Torkel Ödegaard

ux: dashboard settings work progress

parent 008b9bb3
...@@ -89,11 +89,10 @@ ...@@ -89,11 +89,10 @@
<div ng-if="ctrl.dashboard.meta.canSave"> <div ng-if="ctrl.dashboard.meta.canSave">
<div class="p-b-2" ng-if="ctrl.alertCount > 1"> <div class="p-b-2" ng-if="ctrl.alertCount > 1">
<h5>This dashboard contains {{ctrl.alertCount}} alerts. Deleting this dashboard will also delete those alerts</h5> <h5>This dashboard contains {{ctrl.alertCount}} alerts. Deleting this dashboard will also delete those alerts</h5>
<input type="text" class="gf-form-input width-16" style="display: inline-block;" placeholder="Type DELETE to confirm" <input type="text" class="gf-form-input width-16" style="display: inline-block;" placeholder="Type DELETE to confirm" ng-model="ctrl.confirmText" ng-change="ctrl.confirmTextChanged()">
ng-model="ctrl.confirmText" ng-change="ctrl.confirmTextChanged()">
</div> </div>
<button class="btn btn-danger" ng-click="ctrl.deleteDashboard()" ng-disabled="ctrl.confirmValid" > <button class="btn btn-danger" ng-click="ctrl.deleteDashboard()" ng-disabled="!ctrl.confirmValid" >
<i class="fa fa-trash"></i> <i class="fa fa-trash"></i>
Delete Delete
</button> </button>
......
...@@ -46,6 +46,8 @@ export class SettingsCtrl { ...@@ -46,6 +46,8 @@ export class SettingsCtrl {
return panel.alert ? 1 : 0; return panel.alert ? 1 : 0;
}); });
this.confirmValid = this.alertCount === 0;
this.onRouteUpdated(); this.onRouteUpdated();
$rootScope.onAppEvent("$routeUpdate", this.onRouteUpdated.bind(this), $scope); $rootScope.onAppEvent("$routeUpdate", this.onRouteUpdated.bind(this), $scope);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment