Procházet zdrojové kódy

ux: dashboard settings work progress

Torkel Ödegaard před 8 roky
rodič
revize
97bd00c520

+ 2 - 3
public/app/features/dashboard/settings/settings.html

@@ -89,11 +89,10 @@
   <div ng-if="ctrl.dashboard.meta.canSave">
     <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>
-      <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()">
+      <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()">
     </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>
       Delete
     </button>

+ 2 - 0
public/app/features/dashboard/settings/settings.ts

@@ -46,6 +46,8 @@ export class SettingsCtrl {
       return panel.alert ? 1 : 0;
     });
 
+    this.confirmValid = this.alertCount === 0;
+
     this.onRouteUpdated();
     $rootScope.onAppEvent("$routeUpdate", this.onRouteUpdated.bind(this), $scope);
   }