summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFarah Rasheed <Farah.Rasheed1@dell.com>2024-07-08 18:05:37 +0300
committerSurya Venkatesan <suryav@ami.com>2024-08-29 16:56:38 +0300
commitfb83cd50ae5baca0bc55654f52425b52b1b9d98e (patch)
tree8d630751371fb55064331ae6d75252394a77431c
parent83d70f7e8c83d7f082f2774a793cbee75fb414a0 (diff)
downloadwebui-vue-fb83cd50ae5baca0bc55654f52425b52b1b9d98e.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> Signed-off-by: Surya Venkatesan <suryav@ami.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 81b5d992..cfe04a6f 100644
--- a/src/views/SecurityAndAccess/UserManagement/UserManagement.vue
+++ b/src/views/SecurityAndAccess/UserManagement/UserManagement.vue
@@ -364,16 +364,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(
+ i18n.global.t(
+ 'pageUserManagement.modal.batchDisableConfirmMessage',
+ this.selectedRows.length,
+ ),
+ {
+ title: i18n.global.t(
+ 'pageUserManagement.disableUser',
+ this.selectedRows.length,
+ ),
+ okTitle: i18n.global.t(
+ 'pageUserManagement.disableUser',
+ this.selectedRows.length,
+ ),
+ cancelTitle: i18n.global.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;
}
},