diff --git a/client/actions/main.ts b/client/actions/main.ts index 95718be86..c568cebc6 100644 --- a/client/actions/main.ts +++ b/client/actions/main.ts @@ -718,6 +718,11 @@ const openIgnoreCancelSaveModal = ({ selectors.planning.storedPlannings(getState()); const item = get(storedItems, itemId) || {}; + if (itemType === ITEM_TYPE.EVENT) { + // Load associated plannings so they can be used later + dispatch(eventsApi.loadAssociatedPlannings(item)); + } + if (!isExistingItem(item)) { delete item._id; } diff --git a/client/components/IgnoreCancelSaveModal.tsx b/client/components/IgnoreCancelSaveModal.tsx index fe4eb1f45..c03a857f4 100644 --- a/client/components/IgnoreCancelSaveModal.tsx +++ b/client/components/IgnoreCancelSaveModal.tsx @@ -86,7 +86,7 @@ export class IgnoreCancelSaveModalComponent extends React.Component} onEventUpdateMethodChange={this.onEventUpdateMethodChange} onPlanningUpdateMethodChange={this.onPlanningUpdateMethodChange} modalProps={{ diff --git a/client/components/ItemActionConfirmation/forms/updateRecurringEventsForm.tsx b/client/components/ItemActionConfirmation/forms/updateRecurringEventsForm.tsx index 01990e316..6591166d2 100644 --- a/client/components/ItemActionConfirmation/forms/updateRecurringEventsForm.tsx +++ b/client/components/ItemActionConfirmation/forms/updateRecurringEventsForm.tsx @@ -75,10 +75,10 @@ function getRecurringPlanningToUpdate( updates: Partial, plannings: {[planningId: string]: IPlanningItem} ): Array { - const originalCoverages: IPlanningEmbeddedCoverageMap = (original.planning_ids || []) + const originalCoverages: IPlanningEmbeddedCoverageMap = (original.planning_ids ?? []) .map((planningId) => plannings[planningId]) .reduce((planningItems, planningItem) => { - planningItems[planningItem?._id] = (planningItem?.coverages ?? []).reduce( + planningItems[planningItem._id] = (planningItem.coverages ?? []).reduce( (embeddedCoverages, coverage) => { embeddedCoverages[coverage.coverage_id] = eventUtils.convertCoverageToEventEmbedded(coverage);