summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFarah Rasheed <Farah.Rasheed1@dell.com>2024-07-08 18:05:37 +0300
committerFarah Rasheed <Farah.Rasheed1@dell.com>2024-08-14 18:13:54 +0300
commitb2acbcaa9cf7b1aa053216ca93ad2ad1f9846544 (patch)
treebec963a2fcf8bfed7ede1e540bf7e8dc616743ec
parent6de03414859a6a37d0d21bb493bd444e4a308f3b (diff)
downloadwebui-vue-b2acbcaa9cf7b1aa053216ca93ad2ad1f9846544.tar.xz
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>
-rw-r--r--src/locales/en-US.json2
-rw-r--r--src/locales/ru-RU.json2
-rw-r--r--src/views/SecurityAndAccess/UserManagement/UserManagement.vue43
3 files changed, 37 insertions, 10 deletions
diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index a4995076..bd820666 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -554,6 +554,7 @@
"accountPolicySettings": "Account policy settings",
"addUser": "Add user",
"deleteUser": "Delete user | Delete users",
+ "disableUser": "Disable user | Disable users",
"editUser": "Edit user",
"viewPrivilegeRoleDescriptions": "View privilege role descriptions",
"modal": {
@@ -561,6 +562,7 @@
"accountStatus": "Account status",
"automaticAfterTimeout": "Automatic after timeout",
"batchDeleteConfirmMessage": "Are you sure you want to delete %{count} user? This action cannot be undone. | Are you sure you want to delete %{count} users? This action cannot be undone.",
+ "batchDisableConfirmMessage": "Are you sure you want to disable %{count} user? | Are you sure you want to disable %{count} users?",
"cannotStartWithANumber": "Cannot start with a number",
"clickSaveToUnlockAccount": "Click \"Save\" to unlock account",
"confirmUserPassword": "Confirm user password",
diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json
index 43854d3b..4a6106de 100644
--- a/src/locales/ru-RU.json
+++ b/src/locales/ru-RU.json
@@ -551,6 +551,7 @@
"accountPolicySettings": "Настройки политики учётной записи",
"addUser": "Добавить пользователя",
"deleteUser": "Удалить пользователя | Удалить пользователей",
+ "disableUser": "Отключить пользователя | Отключить пользователей",
"editUser": "Редактировать пользователя",
"viewPrivilegeRoleDescriptions": "Просмотр описаний привилегий ролей",
"modal": {
@@ -558,6 +559,7 @@
"accountStatus": "Статус учётной записи",
"automaticAfterTimeout": "Автоматически после истечения таймаута",
"batchDeleteConfirmMessage": "Вы уверены, что хотите удалить %{count} пользователя? Это действие нельзя отменить. | Вы уверены, что хотите удалить %{count} пользователей? Это действие нельзя отменить.",
+ "batchDisableConfirmMessage": "Вы уверены, что хотите отключить пользователя %{count}? | Вы уверены, что хотите отключить пользователей %{count}?",
"cannotStartWithANumber": "Не может начинаться с цифры",
"clickSaveToUnlockAccount": "Нажмите \"Сохранить\" для разблокировки учётной записи",
"confirmUserPassword": "Подтвердите пароль пользователя",
diff --git a/src/views/SecurityAndAccess/UserManagement/UserManagement.vue b/src/views/SecurityAndAccess/UserManagement/UserManagement.vue
index ab316688..944ea258 100644
--- a/src/views/SecurityAndAccess/UserManagement/UserManagement.vue
+++ b/src/views/SecurityAndAccess/UserManagement/UserManagement.vue
@@ -361,16 +361,39 @@ export default {
.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;
}
},