Add a confirmation modal for disabling users
Add a confirmation modal in the user management table when users
are disabled.
Change-Id: I06bb1c96abdc7fa895aec2fe2025e9039577ae1d
Signed-off-by: Farah Rasheed <Farah.Rasheed1@dell.com>
diff --git a/src/views/SecurityAndAccess/UserManagement/UserManagement.vue b/src/views/SecurityAndAccess/UserManagement/UserManagement.vue
index ab31668..944ea25 100644
--- a/src/views/SecurityAndAccess/UserManagement/UserManagement.vue
+++ b/src/views/SecurityAndAccess/UserManagement/UserManagement.vue
@@ -361,16 +361,39 @@
.finally(() => this.endLoader());
break;
case 'disable':
- this.startLoader();
- this.$store
- .dispatch('userManagement/disableUsers', this.selectedRows)
- .then((messages) => {
- messages.forEach(({ type, message }) => {
- if (type === 'success') this.successToast(message);
- if (type === 'error') this.errorToast(message);
- });
- })
- .finally(() => this.endLoader());
+ this.$bvModal
+ .msgBoxConfirm(
+ this.$tc(
+ 'pageUserManagement.modal.batchDisableConfirmMessage',
+ this.selectedRows.length,
+ ),
+ {
+ title: this.$tc(
+ 'pageUserManagement.disableUser',
+ this.selectedRows.length,
+ ),
+ okTitle: this.$tc(
+ 'pageUserManagement.disableUser',
+ this.selectedRows.length,
+ ),
+ cancelTitle: this.$t('global.action.cancel'),
+ autoFocusButton: 'ok',
+ },
+ )
+ .then((disableConfirmed) => {
+ if (disableConfirmed) {
+ this.startLoader();
+ this.$store
+ .dispatch('userManagement/disableUsers', this.selectedRows)
+ .then((messages) => {
+ messages.forEach(({ type, message }) => {
+ if (type === 'success') this.successToast(message);
+ if (type === 'error') this.errorToast(message);
+ });
+ })
+ .finally(() => this.endLoader());
+ }
+ });
break;
}
},