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

Fix users list doesn't load if user has no role #7332

Merged
merged 2 commits into from
Jul 26, 2022
Merged
Show file tree
Hide file tree
Changes from all 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,6 @@
Bugfix: Users list not loading if user has no role

We've fixed a bug where the users list in the user management app was not loading if a user has no assigned role.

https://github.com/owncloud/web/pull/7332
https://github.com/owncloud/web/issues/7326
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
<template #avatar="{ item }">
<avatar-image :width="32" :userid="item.id" :user-name="item.displayName" />
</template>
<template #role="{ item }"> {{ item.role.displayName }} </template>
<template #role="{ item }">
<template v-if="item.role">{{ item.role.displayName }}</template>
</template>
<template #actions="{ item }">
<oc-button
v-oc-tooltip="$gettext('Details')"
Expand Down
6 changes: 5 additions & 1 deletion packages/web-app-user-management/src/views/Users.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ export default defineComponent({
yield loadRolesTask.perform()

for (const user of users.value) {
yield loadUserRoleTask.perform({ user })
try {
yield loadUserRoleTask.perform({ user })
} catch (e) {
console.error(`Failed to load role for user '${user.displayName}'`)
}
}
})

Expand Down