Skip to content

Commit

Permalink
fix(ux): Show initial loading state of managers
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <chrng8@gmail.com>
  • Loading branch information
Pytal committed Sep 15, 2023
1 parent 617a9e8 commit 50ddc68
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/settings/src/components/Users/UserRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@
:input-id="'manager' + uniqueId"
:close-on-select="true"
:disabled="isLoadingField"
:loading="idState.loading.manager"
:loading="idState.loadingPossibleManagers || idState.loading.manager"
label="displayname"
:options="idState.possibleManagers"
:placeholder="managerLabel"
class="select-vue"
@open="searchUserManager"
@open="searchInitialUserManager"
@search="searchUserManager"
@option:selected="updateUserManager"
@input="updateUserManager" />
Expand Down Expand Up @@ -360,6 +360,7 @@ export default {
return {
selectedQuota: false,
rand: Math.random().toString(36).substring(2),
loadingPossibleManagers: false,
possibleManagers: [],
currentManager: '',
editing: false,
Expand Down Expand Up @@ -550,6 +551,12 @@ export default {
})
},

async searchInitialUserManager() {
this.idState.loadingPossibleManagers = true
await this.searchUserManager()
this.idState.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)) : []
Expand Down

0 comments on commit 50ddc68

Please sign in to comment.