mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #40718 from nextcloud/backport/40428/stable27
[stable27] Multiple bug fix in users list
This commit is contained in:
commit
a762275dd0
6 changed files with 22 additions and 7 deletions
|
|
@ -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)) : []
|
||||
|
|
|
|||
|
|
@ -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':
|
||||
|
|
|
|||
4
dist/settings-users-8351.js
vendored
4
dist/settings-users-8351.js
vendored
File diff suppressed because one or more lines are too long
2
dist/settings-users-8351.js.map
vendored
2
dist/settings-users-8351.js.map
vendored
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
Loading…
Reference in a new issue