Browse Source

feat(alerting): added confirm text when removing panel with alert rule

Torkel Ödegaard 9 years ago
parent
commit
d56b9a720a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      public/app/features/dashboard/row/row_model.ts

+ 8 - 0
public/app/features/dashboard/row/row_model.ts

@@ -86,10 +86,18 @@ export class DashboardRow {
 
 
   removePanel(panel, ask?) {
   removePanel(panel, ask?) {
     if (ask !== false) {
     if (ask !== false) {
+      var text2, confirmText;
+      if (panel.alert) {
+        text2 = "Panel includes an alert rule, removing panel will also remove alert rule";
+        confirmText = "YES";
+      }
+
       appEvents.emit('confirm-modal', {
       appEvents.emit('confirm-modal', {
         title: 'Remove Panel',
         title: 'Remove Panel',
         text: 'Are you sure you want to remove this panel?',
         text: 'Are you sure you want to remove this panel?',
+        text2: text2,
         icon: 'fa-trash',
         icon: 'fa-trash',
+        confirmText: confirmText,
         yesText: 'Remove',
         yesText: 'Remove',
         onConfirm: () => {
         onConfirm: () => {
           this.removePanel(panel, false);
           this.removePanel(panel, false);