diff options
-rw-r--r-- | src/locales/en-US.json | 2 | ||||
-rw-r--r-- | src/locales/ru-RU.json | 2 | ||||
-rw-r--r-- | src/views/SecurityAndAccess/UserManagement/UserManagement.vue | 43 |
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; } }, |