Skip to content

Commit a762275

Browse files
authored
Merge pull request #40718 from nextcloud/backport/40428/stable27
[stable27] Multiple bug fix in users list
2 parents 35d7351 + 617f5ae commit a762275

File tree

6 files changed

+22
-7
lines changed

6 files changed

+22
-7
lines changed

apps/settings/src/components/UserList/UserRow.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,11 @@
221221
:user-select="true"
222222
:options="possibleManagers"
223223
:placeholder="t('settings', 'Select manager')"
224+
:loading="loadingPossibleManagers || loading.manager"
224225
class="multiselect-vue"
225226
label="displayname"
226227
track-by="id"
228+
@open="searchInitialUserManager"
227229
@search-change="searchUserManager"
228230
@remove="updateUserManager"
229231
@select="updateUserManager">
@@ -336,6 +338,7 @@ export default {
336338
rand: parseInt(Math.random() * 1000),
337339
openedMenu: false,
338340
feedbackMessage: '',
341+
loadingPossibleManagers: false,
339342
possibleManagers: [],
340343
currentManager: '',
341344
editing: false,
@@ -387,7 +390,6 @@ export default {
387390
},
388391
},
389392
async beforeMount() {
390-
await this.searchUserManager()
391393
if (this.user.manager) {
392394
await this.initManager(this.user.manager)
393395
}
@@ -431,11 +433,19 @@ export default {
431433
filterManagers(managers) {
432434
return managers.filter((manager) => manager.id !== this.user.id)
433435
},
436+
434437
async initManager(userId) {
435438
await this.$store.dispatch('getUser', userId).then(response => {
436439
this.currentManager = response?.data.ocs.data
437440
})
438441
},
442+
443+
async searchInitialUserManager() {
444+
this.loadingPossibleManagers = true
445+
await this.searchUserManager()
446+
this.loadingPossibleManagers = false
447+
},
448+
439449
async searchUserManager(query) {
440450
await this.$store.dispatch('searchUsers', { offset: 0, limit: 10, search: query }).then(response => {
441451
const users = response?.data ? this.filterManagers(Object.values(response?.data.ocs.data.users)) : []

apps/settings/src/store/users.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ const mutations = {
159159
},
160160
// update active/disabled counts, groups counts
161161
updateUserCounts(state, { user, actionType }) {
162+
// 0 is a special value
163+
if (state.userCount === 0) {
164+
return
165+
}
166+
162167
const disabledGroup = state.groups.find(group => group.id === 'disabled')
163168
switch (actionType) {
164169
case 'enable':

dist/settings-users-8351.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-users-8351.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-apps-users-management.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/settings-vue-settings-apps-users-management.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)