Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CalendarObjectInstance: reset attendee participation status on duplication of an event #6302

Merged
merged 1 commit into from
Aug 29, 2024
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
8 changes: 7 additions & 1 deletion src/models/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@
*
* @param {object} eventObject The calendar-object-instance object
* @param {EventComponent} eventComponent The calendar-js EventComponent object
* @param {boolean} resetAttendeeStatus Whether or not to reset the attendee status
*/
const copyCalendarObjectInstanceIntoEventComponent = (eventObject, eventComponent) => {
const copyCalendarObjectInstanceIntoEventComponent = (eventObject, eventComponent, resetAttendeeStatus = false) => {
eventComponent.title = eventObject.title
eventComponent.location = eventObject.location
eventComponent.description = eventObject.description
Expand All @@ -206,6 +207,11 @@
}

for (const attendee of eventObject.attendees) {
if (resetAttendeeStatus) {
attendee.attendeeProperty.participationStatus = 'NEEDS-ACTION'
attendee.attendeeProperty.rsvp = true

Check warning on line 212 in src/models/event.js

View check run for this annotation

Codecov / codecov/patch

src/models/event.js#L211-L212

Added lines #L211 - L212 were not covered by tests
}

eventComponent.addProperty(attendee.attendeeProperty)
}

Expand Down
2 changes: 1 addition & 1 deletion src/store/calendarObjectInstance.js
Original file line number Diff line number Diff line change
Expand Up @@ -1478,7 +1478,7 @@
isAllDay: oldEventComponent.isAllDay(),
})
const eventComponent = getObjectAtRecurrenceId(calendarObject, startDate.jsDate)
copyCalendarObjectInstanceIntoEventComponent(oldCalendarObjectInstance, eventComponent)
copyCalendarObjectInstanceIntoEventComponent(oldCalendarObjectInstance, eventComponent, true)

Check warning on line 1481 in src/store/calendarObjectInstance.js

View check run for this annotation

Codecov / codecov/patch

src/store/calendarObjectInstance.js#L1481

Added line #L1481 was not covered by tests
const calendarObjectInstance = mapEventComponentToEventObject(eventComponent)

await this.setCalendarObjectInstanceForNewEvent({
Expand Down
Loading