Merge pull request #40718 from nextcloud/backport/40428/stable27

[stable27] Multiple bug fix in users list
This commit is contained in:
Arthur Schiwon 2023-10-09 22:51:37 +02:00 committed by GitHub
commit a762275dd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 7 deletions

View file

@ -221,9 +221,11 @@
:user-select="true"
:options="possibleManagers"
:placeholder="t('settings', 'Select manager')"
:loading="loadingPossibleManagers || loading.manager"
class="multiselect-vue"
label="displayname"
track-by="id"
@open="searchInitialUserManager"
@search-change="searchUserManager"
@remove="updateUserManager"
@select="updateUserManager">
@ -336,6 +338,7 @@ export default {
rand: parseInt(Math.random() * 1000),
openedMenu: false,
feedbackMessage: '',
loadingPossibleManagers: false,
possibleManagers: [],
currentManager: '',
editing: false,
@ -387,7 +390,6 @@ export default {
},
},
async beforeMount() {
await this.searchUserManager()
if (this.user.manager) {
await this.initManager(this.user.manager)
}
@ -431,11 +433,19 @@ export default {
filterManagers(managers) {
return managers.filter((manager) => manager.id !== this.user.id)
},
async initManager(userId) {
await this.$store.dispatch('getUser', userId).then(response => {
this.currentManager = response?.data.ocs.data
})
},
async searchInitialUserManager() {
this.loadingPossibleManagers = true
await this.searchUserManager()
this.loadingPossibleManagers = false
},
async searchUserManager(query) {
await this.$store.dispatch('searchUsers', { offset: 0, limit: 10, search: query }).then(response => {
const users = response?.data ? this.filterManagers(Object.values(response?.data.ocs.data.users)) : []

View file

@ -159,6 +159,11 @@ const mutations = {
},
// update active/disabled counts, groups counts
updateUserCounts(state, { user, actionType }) {
// 0 is a special value
if (state.userCount === 0) {
return
}
const disabledGroup = state.groups.find(group => group.id === 'disabled')
switch (actionType) {
case 'enable':

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long