Skip to content

Commit

Permalink
calendar-ui: Hide attendees which are part of invited group
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Heinrich committed Aug 16, 2023
1 parent be643ac commit b55077d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/components/Editor/Invitees/InviteesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<OrganizerListItem v-if="hasOrganizer"
:is-read-only="isReadOnly"
:organizer="calendarObjectInstance.organizer" />
<InviteesListItem v-for="invitee in inviteesWithoutOrganizer"
<InviteesListItem v-for="invitee in inviteesWithoutOrganizerAndGroupMembership"
:key="invitee.email"
:attendee="invitee"
:is-read-only="isReadOnly"
Expand Down Expand Up @@ -120,13 +120,26 @@ export default {
return !['RESOURCE', 'ROOM'].includes(attendee.attendeeProperty.userType)
})
},
inviteesWithoutOrganizer() {
groups() {
return this.calendarObjectInstance.attendees.filter(attendee => {
return attendee.attendeeProperty.userType === 'GROUP'
})
},
inviteesWithoutOrganizerAndGroupMembership() {
if (!this.calendarObjectInstance.organizer) {
return this.invitees
}

return this.invitees
.filter(attendee => attendee.uri !== this.calendarObjectInstance.organizer.uri)
.filter(attendee => {
// Filter attendees which are part of an invited group
return !(this.groups.some(function(group) {
return group.uri === attendee.member &&
attendee.attendeeProperty.userType === 'INDIVIDUAL'
}))

return attendee.uri !== this.calendarObjectInstance.organizer.uri
})
},
hasOrganizer() {
return this.calendarObjectInstance.organizer !== null
Expand Down

0 comments on commit b55077d

Please sign in to comment.