demarches-normaliennes/app/javascript
Pierre de La Morinerie 96037069ff autosave: remove the repetition row after deletion
Before, when autosaving a draft, removing a repetition row would
send `_destroy` inputs to the controller – but not remove the row
from the DOM. This led to the `_destroy` inputs being sent again
on the next autosave request, which made the controller raise
(because the row fields were already deleted before).

To fix this, we let the controller response remove the deleted
row(s) from the DOM.

Doing it using a controller response avoids the need to keep track
of operations on the Javascript side: the controller can easily
know which row was just deleted, and emit the relevant changes for
the DOM. This keeps the autosave requests robust: even if a request
is skipped (e.g. because of a network interruption), the next request
will still contain the relevant informations to succeed, and not let the
form in an unstable state.

Fix #5470
2020-08-25 14:39:34 +02:00
..
components Put IGN map behind a feature flag 2020-07-30 17:22:28 +02:00
loaders Adapt style for Map reader (point, line) 2020-05-12 17:47:28 +02:00
manager/fields Explicitly import jQuery 2018-08-13 15:17:13 +02:00
new_design autosave: remove the repetition row after deletion 2020-08-25 14:39:34 +02:00
packs Dispatch events from geo areas list view 2020-06-09 18:45:45 +02:00
shared javascript: silence Crisp warning in Javascript console 2020-06-26 15:57:14 +02:00