{{ $t('users.forceNsfw') }}
@@ -227,6 +231,9 @@ export default {
message: this.$t('users.completed')
})
this.$emit('apply-action')
+ },
+ requirePasswordReset: () => {
+ this.selectedUsers.map(user => this.$store.dispatch('RequirePasswordReset', user))
}
}
},
@@ -265,6 +272,13 @@ export default {
remove
)
},
+ requirePasswordReset() {
+ const { requirePasswordReset } = this.mappers()
+ this.confirmMessage(
+ this.$t('users.requirePasswordResetConfirmation'),
+ requirePasswordReset
+ )
+ },
addTagForMultipleUsers(tag) {
const { addTag } = this.mappers()
this.confirmMessage(
diff --git a/src/views/users/index.vue b/src/views/users/index.vue
index fd26a993..16160a97 100644
--- a/src/views/users/index.vue
+++ b/src/views/users/index.vue
@@ -133,6 +133,11 @@
@click.native="getPasswordResetToken(scope.row.nickname)">
{{ $t('users.getPasswordResetToken') }}
+
+ {{ $t('users.requirePasswordReset') }}
+
@@ -259,6 +264,9 @@ export default {
this.resetPasswordDialogOpen = true
this.$store.dispatch('GetPasswordResetToken', nickname)
},
+ requirePasswordReset(nickname) {
+ this.$store.dispatch('RequirePasswordReset', { nickname })
+ },
handleDeactivation({ nickname }) {
this.$store.dispatch('ToggleUserActivation', nickname)
},
diff --git a/test/views/users/multipleUsersMenu.test.js b/test/views/users/multipleUsersMenu.test.js
index b4388716..355430e1 100644
--- a/test/views/users/multipleUsersMenu.test.js
+++ b/test/views/users/multipleUsersMenu.test.js
@@ -251,15 +251,15 @@ describe('Apply users actions to multiple users', () => {
const addTagForMultipleUsersStub = jest.fn()
wrapper.setMethods({ addTagForMultipleUsers: addTagForMultipleUsersStub })
- wrapper.find(`.el-dropdown-menu__item:nth-child(8) button:nth-child(1)`).trigger('click')
+ wrapper.find(`.el-dropdown-menu__item:nth-child(9) button:nth-child(1)`).trigger('click')
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalledWith('force_nsfw')
- wrapper.find(`.el-dropdown-menu__item:nth-child(10) button:nth-child(1)`).trigger('click')
+ wrapper.find(`.el-dropdown-menu__item:nth-child(11) button:nth-child(1)`).trigger('click')
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalledWith('force_unlisted')
- wrapper.find(`.el-dropdown-menu__item:nth-child(12) button:nth-child(1)`).trigger('click')
+ wrapper.find(`.el-dropdown-menu__item:nth-child(13) button:nth-child(1)`).trigger('click')
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.addTagForMultipleUsers).toHaveBeenCalledWith('disable_remote_subscription')
@@ -292,15 +292,15 @@ describe('Apply users actions to multiple users', () => {
const removeTagFromMultipleUsersStub = jest.fn()
wrapper.setMethods({ removeTagFromMultipleUsers: removeTagFromMultipleUsersStub })
- wrapper.find(`.el-dropdown-menu__item:nth-child(9) button:nth-child(2)`).trigger('click')
+ wrapper.find(`.el-dropdown-menu__item:nth-child(10) button:nth-child(2)`).trigger('click')
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalledWith('strip_media')
- wrapper.find(`.el-dropdown-menu__item:nth-child(11) button:nth-child(2)`).trigger('click')
+ wrapper.find(`.el-dropdown-menu__item:nth-child(12) button:nth-child(2)`).trigger('click')
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalledWith('sandbox')
- wrapper.find(`.el-dropdown-menu__item:nth-child(13) button:nth-child(2)`).trigger('click')
+ wrapper.find(`.el-dropdown-menu__item:nth-child(14) button:nth-child(2)`).trigger('click')
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalled()
expect(wrapper.vm.removeTagFromMultipleUsers).toHaveBeenCalledWith('disable_any_subscription')