apostrophecms / apostrophe-events

10 stars 5 forks source link

repeat events after updating them #51

Closed ETLaurent closed 2 years ago

ETLaurent commented 2 years ago

Summary

Replicate recurring events after updating them, not only after their first insertion into the database.

What are the specific steps to test this change?

image

What kind of change does this PR introduce?

(Check at least one)

Make sure the PR fulfills these requirements:

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

linear[bot] commented 2 years ago
PRO-2756 [Recurring Events] As an editor, I should easily be able to manage recurring events so that I don't have to enter the same info multiple times.

This is for the A2 Kimpton instance. There are some issues with the recurring events option, perhaps a bug or might be an incomplete feature. For the kind of event that occurs regularly, they want to make sure they only have to enter the details once with multiple dates. Here's the functionality that is needed: * When adding an event, the user selects "recurring" and then can select from weekly, monthly, ~or custom.~ * When selecting weekly, the user should be able to pick a date and time such as "Friday at 5PM" * After saving, this event should appear on the grid calendar on all of its dates. This could be solved by [https://linear.app/apostrophecms/issue/PRO-2827/error-occurs-when-i-try-to-save-a-recurring-event](https://linear.app/apostrophecms/issue/PRO-2827/error-occurs-when-i-try-to-save-a-recurring-event)

ETLaurent commented 2 years ago

What happens if the event was repeated properly the first time? If that inserted 5 events the first time, does saving it again insert 5 more or do the relevant fields get cleared after each repeat to prevent that in some way? I don't see any indication of that.

@boutell Indeed it will insert 5 more events. Thing is when we edit a single day event to change it to recursive, it won't create the expected events if we use afterInsert (which seems to be problematic). We could avoid creating new replicated events when children events exist (using parentId field), and we could also update the "children" events with the new values of the parent one. Wdyt?