Explorar o código

confirmation box added for user removal

utkarshcmu %!s(int64=10) %!d(string=hai) anos
pai
achega
47b6f01c8b
Modificáronse 1 ficheiros con 12 adicións e 0 borrados
  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) {
+    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)
       .then(() => {
         this.get();