Procházet zdrojové kódy

confirmation box added for user removal

utkarshcmu před 10 roky
rodič
revize
47b6f01c8b
1 změnil soubory, kde provedl 12 přidání a 0 odebrání
  1. 12 0
      public/app/features/org/org_users_ctrl.ts

+ 12 - 0
public/app/features/org/org_users_ctrl.ts

@@ -37,6 +37,18 @@ export class OrgUsersCtrl {
   }
   }
 
 
   removeUser(user) {
   removeUser(user) {
+    this.$scope.appEvent('confirm-modal', {
+      title: 'Confirm delete user',
+      text: 'Are you sure you want to delete user ' + user.login + '?',
+      yesText: "Delete",
+      icon: "fa-warning",
+      onConfirm: () => {
+        this.removeUserConfirmed(user);
+      }
+    });
+  }
+
+  removeUserConfirmed(user) {
     this.backendSrv.delete('/api/org/users/' + user.userId)
     this.backendSrv.delete('/api/org/users/' + user.userId)
       .then(() => {
       .then(() => {
         this.get();
         this.get();