@@ -54,16 +54,20 @@
@@ -171,12 +175,15 @@ export default {
handlePageChange(page) {
this.$store.dispatch('FetchReports', page)
},
- isValid(account) {
- return account.nickname && account.id
- },
parseTimestamp(timestamp) {
return moment(timestamp).format('L HH:mm')
},
+ propertyExists(account, property, _secondProperty) {
+ if (_secondProperty) {
+ return account[property] && account[_secondProperty]
+ }
+ return account[property]
+ },
showStatuses(statuses = []) {
return statuses.length > 0
}
@@ -262,6 +269,10 @@ export default {
font-style: italic;
color: gray;
}
+ .report-account-name {
+ font-size: 15px;
+ font-weight: 500;
+ }
.report-row-key {
font-size: 14px;
font-weight: 500;
diff --git a/src/views/users/components/MultipleUsersMenu.vue b/src/views/users/components/MultipleUsersMenu.vue
index 70883598..8af223fd 100644
--- a/src/views/users/components/MultipleUsersMenu.vue
+++ b/src/views/users/components/MultipleUsersMenu.vue
@@ -165,33 +165,33 @@ export default {
}
return {
grantRight: (right) => () => {
- const filterUsersFn = user => this.isValid(user) && user.local && !user.roles[right] && this.$store.state.user.id !== user.id
+ const filterUsersFn = user => this.isLocalUser(user) && !user.roles[right] && this.$store.state.user.id !== user.id
const addRightFn = async(users) => await this.$store.dispatch('AddRight', { users, right })
const filtered = this.selectedUsers.filter(filterUsersFn)
applyAction(filtered, addRightFn)
},
revokeRight: (right) => () => {
- const filterUsersFn = user => this.isValid(user) && user.local && user.roles[right] && this.$store.state.user.id !== user.id
+ const filterUsersFn = user => this.isLocalUser(user) && user.roles[right] && this.$store.state.user.id !== user.id
const deleteRightFn = async(users) => await this.$store.dispatch('DeleteRight', { users, right })
const filtered = this.selectedUsers.filter(filterUsersFn)
applyAction(filtered, deleteRightFn)
},
activate: () => {
- const filtered = this.selectedUsers.filter(user => this.isValid(user) && user.deactivated && this.$store.state.user.id !== user.id)
+ const filtered = this.selectedUsers.filter(user => user.nickname && user.deactivated && this.$store.state.user.id !== user.id)
const activateUsersFn = async(users) => await this.$store.dispatch('ActivateUsers', { users })
applyAction(filtered, activateUsersFn)
},
deactivate: () => {
- const filtered = this.selectedUsers.filter(user => this.isValid(user) && !user.deactivated && this.$store.state.user.id !== user.id)
+ const filtered = this.selectedUsers.filter(user => user.nickname && !user.deactivated && this.$store.state.user.id !== user.id)
const deactivateUsersFn = async(users) => await this.$store.dispatch('DeactivateUsers', { users })
applyAction(filtered, deactivateUsersFn)
},
remove: () => {
- const filtered = this.selectedUsers.filter(user => this.isValid(user) && this.$store.state.user.id !== user.id)
+ const filtered = this.selectedUsers.filter(user => user.nickname && this.$store.state.user.id !== user.id)
const deleteAccountFn = async(users) => await this.$store.dispatch('DeleteUsers', { users })
applyAction(filtered, deleteAccountFn)
@@ -199,42 +199,42 @@ export default {
addTag: (tag) => () => {
const filtered = this.selectedUsers.filter(user =>
tag === 'disable_remote_subscription' || tag === 'disable_any_subscription'
- ? this.isValid(user) && user.local && !user.tags.includes(tag)
- : this.isValid(user) && !user.tags.includes(tag))
+ ? this.isLocalUser(user) && !user.tags.includes(tag)
+ : user.nickname && !user.tags.includes(tag))
const addTagFn = async(users) => await this.$store.dispatch('AddTag', { users, tag })
applyAction(filtered, addTagFn)
},
removeTag: (tag) => async() => {
const filtered = this.selectedUsers.filter(user =>
tag === 'disable_remote_subscription' || tag === 'disable_any_subscription'
- ? this.isValid(user) && user.local && user.tags.includes(tag)
- : this.isValid(user) && user.tags.includes(tag))
+ ? this.isLocalUser(user) && user.tags.includes(tag)
+ : user.nickname && user.tags.includes(tag))
const removeTagFn = async(users) => await this.$store.dispatch('RemoveTag', { users, tag })
applyAction(filtered, removeTagFn)
},
requirePasswordReset: () => {
- const filtered = this.selectedUsers.filter(user => this.isValid(user) && user.local)
+ const filtered = this.selectedUsers.filter(user => this.isLocalUser(user))
const requirePasswordResetFn = async(users) => await this.$store.dispatch('RequirePasswordReset', users)
applyAction(filtered, requirePasswordResetFn)
},
confirmAccounts: () => {
- const filtered = this.selectedUsers.filter(user => this.isValid(user) && user.local && user.confirmation_pending)
+ const filtered = this.selectedUsers.filter(user => this.isLocalUser(user) && user.confirmation_pending)
const confirmAccountFn = async(users) => await this.$store.dispatch('ConfirmUsersEmail', { users })
applyAction(filtered, confirmAccountFn)
},
resendConfirmation: () => {
- const filtered = this.selectedUsers.filter(user => this.isValid(user) && user.local && user.confirmation_pending)
+ const filtered = this.selectedUsers.filter(user => this.isLocalUser(user) && user.confirmation_pending)
const resendConfirmationFn = async(users) => await this.$store.dispatch('ResendConfirmationEmail', users)
applyAction(filtered, resendConfirmationFn)
}
}
},
- isValid(user) {
- return user.nickname && user.id
+ isLocalUser(user) {
+ return user.nickname && user.local
},
grantRightToMultipleUsers(right) {
const { grantRight } = this.mappers()
diff --git a/src/views/users/index.vue b/src/views/users/index.vue
index d2f5d00c..91893560 100644
--- a/src/views/users/index.vue
+++ b/src/views/users/index.vue
@@ -76,11 +76,14 @@
- {{ $t('users.invalidUser') }}
+
+ {{ $t('users.moderation') }}
+
+
@@ -217,12 +220,12 @@ export default {
handleSelectionChange(value) {
this.$data.selectedUsers = value
},
- isValid(user) {
- return user.nickname && user.id
- },
openResetPasswordDialog() {
this.resetPasswordDialogOpen = true
},
+ propertyExists(account, property) {
+ return account[property]
+ },
showDeactivatedButton(id) {
return this.$store.state.user.id !== id
}
@@ -262,7 +265,7 @@ export default {
.create-account > .el-icon-plus {
margin-right: 5px;
}
-.invalid-user {
+.invalid-account {
color: gray;
}
.users-header-container {
diff --git a/src/views/users/show.vue b/src/views/users/show.vue
index c8a71b08..ff8fd75e 100644
--- a/src/views/users/show.vue
+++ b/src/views/users/show.vue
@@ -2,13 +2,13 @@