Skip to content

Commit fafc93c

Browse files
NikolausDemmelnextcloud-command
authored andcommitted
fix(settings): Initialize group display names from store
When editing a user, if groups have display names different from their IDs (e.g., long group names that get hashed), the group selector was showing the group ID instead of the display name after page reload. This happened because the `data()` function initialized `userGroups` with `{ id, name: id }`, setting both fields to the group ID. The fix adds a `created()` lifecycle hook that looks up the actual group names from the Vuex store. Fixes #55785 Signed-off-by: Claude <noreply@anthropic.com> Co-Authored-By: Nikolaus Demmel <nikolaus@nikolaus-demmel.de> Signed-off-by: Nikolaus Demmel <nikolaus@nikolaus-demmel.de>
1 parent 7ac1f60 commit fafc93c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

apps/settings/src/mixins/UserRowMixin.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ export default {
4949
userSubAdminGroups: this.user.subadmin.map((id) => ({ id, name: id })),
5050
}
5151
},
52+
created() {
53+
// Initialize group names from store
54+
// This fixes the issue where group IDs were shown instead of names in the NcSelect
55+
this.userGroups = this.user.groups.map(id => {
56+
const group = this.$store.state.users.groups.find(g => g.id === id)
57+
return group ? { id: group.id, name: group.name } : { id, name: id }
58+
})
59+
this.userSubAdminGroups = this.user.subadmin.map(id => {
60+
const group = this.$store.state.users.groups.find(g => g.id === id)
61+
return group ? { id: group.id, name: group.name } : { id, name: id }
62+
})
63+
},
5264
computed: {
5365
showConfig() {
5466
return this.$store.getters.getShowConfig

0 commit comments

Comments
 (0)