Skip to content

Commit

Permalink
Fix users list doesn't load if user has no role (#7332)
Browse files Browse the repository at this point in the history
Fix users list doesn't load if user has no role
  • Loading branch information
Jan committed Jul 26, 2022
1 parent a9320b6 commit 4986a2c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
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 @@ -34,7 +34,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

0 comments on commit 4986a2c

Please sign in to comment.