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 2500efe
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 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,27 @@ 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
var isMemberOfGroup = this.groups.some(function(group) {
return attendee.member.includes(group.uri) &&
attendee.attendeeProperty.userType === 'INDIVIDUAL'
})
return attendee.uri !== this.calendarObjectInstance.organizer.uri &&
!isMemberOfGroup
})
},
hasOrganizer() {
return this.calendarObjectInstance.organizer !== null
Expand Down

0 comments on commit 2500efe

Please sign in to comment.