Skip to content

Commit

Permalink
fixup! fix: respect advanced group sharing settings in frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
st3iny committed Sep 3, 2024
1 parent bc25640 commit fcceac4
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/components/AppNavigation/Settings/SettingsAddressbookShare.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,25 @@ export default {
this.usersOrGroups = []
if (query.length > 0) {
const results = await client.principalPropertySearchByDisplayname(query)
this.usersOrGroups = results.reduce((list, result) => {
if (['GROUP', 'INDIVIDUAL'].indexOf(result.calendarUserType) > -1
&& !this.addressbook.shares.some((share) => share.uri === result.principalScheme)) {
this.usersOrGroups = results
.filter((result) => {
const allowedCalendarUserTypes = ['INDIVIDUAL']
if (this.isGroupSharingEnabled) {
allowedCalendarUserTypes.push('GROUP')
}
return allowedCalendarUserTypes.includes(result.calendarUserType)
&& !this.addressbook.shares.some((share) => share.uri === result.principalScheme)
})
.map((result) => {
const isGroup = result.calendarUserType === 'GROUP'
list.push({
return {
user: urldecode(result[isGroup ? 'groupId' : 'userId']),
displayName: result.displayname,
icon: isGroup ? 'icon-group' : 'icon-user',
uri: urldecode(result.principalScheme),
isGroup,
})
}
return list
}, [])
}
})
this.isLoading = false
this.inputGiven = true
} else {
Expand Down

0 comments on commit fcceac4

Please sign in to comment.