Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/components/Editor/Invitees/InviteesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,24 @@

<template>
<div>
<InviteesListSearch v-if="!isReadOnly && hasUserEmailAddress"
<InviteesListSearch v-if="!isReadOnly && !isSharedWithMe && hasUserEmailAddress"
:already-invited-emails="alreadyInvitedEmails"
@add-attendee="addAttendee" />
<OrganizerListItem v-if="hasOrganizer"
:is-read-only="isReadOnly"
:is-read-only="isReadOnly || isSharedWithMe"
:organizer="calendarObjectInstance.organizer" />
<InviteesListItem v-for="invitee in inviteesWithoutOrganizer"
:key="invitee.email"
:attendee="invitee"
:is-read-only="isReadOnly"
:is-read-only="isReadOnly || isSharedWithMe"
:organizer-display-name="organizerDisplayName"
@remove-attendee="removeAttendee" />
<NoAttendeesView v-if="isReadOnly && isListEmpty"
:message="noInviteesMessage" />
<NoAttendeesView v-if="!isReadOnly && isListEmpty && hasUserEmailAddress"
:message="noInviteesMessage" />
<NoAttendeesView v-if="isSharedWithMe"
:message="noOwnerMessage" />
<OrganizerNoEmailError v-if="!isReadOnly && isListEmpty && !hasUserEmailAddress" />

<div class="invitees-list-button-group">
Expand Down Expand Up @@ -101,6 +103,10 @@ export default {
type: Object,
required: true,
},
isSharedWithMe: {
type: Boolean,
required: true,
},
},
data() {
return {
Expand All @@ -115,6 +121,9 @@ export default {
noInviteesMessage() {
return this.$t('calendar', 'No attendees yet')
},
noOwnerMessage() {
return this.$t('calendar', 'You don\'t own this calendar, so you cannot add attendees to this event')
},
invitees() {
return this.calendarObjectInstance.attendees.filter(attendee => {
return !['RESOURCE', 'ROOM'].includes(attendee.attendeeProperty.userType)
Expand All @@ -136,6 +145,7 @@ export default {
hasOrganizer() {
return this.calendarObjectInstance.organizer !== null
},

organizerDisplayName() {
return organizerDisplayName(this.calendarObjectInstance.organizer)
},
Expand Down
12 changes: 12 additions & 0 deletions src/mixins/EditorMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,18 @@ export default {

return calendar.readOnly
},
isSharedWithMe() {
if (!this.calendarObject) {
return true
}

const calendar = this.$store.getters.getCalendarById(this.calendarObject.calendarId)
if (!calendar) {
return true
}

return calendar.isSharedWithMe
},
/**
* Returns whether the user is an attendee of the event
*
Expand Down
3 changes: 2 additions & 1 deletion src/views/EditSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@
<div class="app-sidebar-tab__content">
<InviteesList v-if="!isLoading"
:calendar-object-instance="calendarObjectInstance"
:is-read-only="isReadOnly" />
:is-read-only="isReadOnly"
:is-shared-with-me="isSharedWithMe" />
</div>
<SaveButtons v-if="showSaveButtons"
class="app-sidebar-tab__buttons"
Expand Down