Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show loading spinner while searching or filtering users in the admin … #10874

Merged
merged 4 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Enhancement: Show loading spinner while searching or filtering users

While searching or filtering users in the admin settings, there will be shown a loading spinner,
to indicate the request is processing.

https://github.com/owncloud/web/pull/10874
https://github.com/owncloud/web/issues/10821
12 changes: 11 additions & 1 deletion packages/web-app-admin-settings/src/views/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</div>
</template>
<template #mainContent>
<app-loading-spinner v-if="loadResourcesTask.isRunning || !loadResourcesTask.last" />
<app-loading-spinner v-if="isLoading" />
<div v-else>
<users-list :roles="roles" :class="{ 'users-table-squashed': isSideBarOpen }">
<template #contextMenu>
Expand Down Expand Up @@ -279,6 +279,15 @@ export default defineComponent({
userSettingsStore.setUsers(usersResponse.data.value || [])
})

const isLoading = computed(() => {
return (
loadUsersTask.isRunning ||
!loadUsersTask.last ||
loadResourcesTask.isRunning ||
!loadResourcesTask.last
)
})

const loadResourcesTask = useTask(function* (signal) {
yield loadUsersTask.perform()
yield loadGroupsTask.perform()
Expand Down Expand Up @@ -473,6 +482,7 @@ export default defineComponent({
users,
roles,
groups,
isLoading,
loadResourcesTask,
loadAdditionalUserDataTask,
clientService,
Expand Down