demarches-normaliennes/app/javascript/new_design/dossiers
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
..
auto-save-controller.js autosave: remove the repetition row after deletion 2020-08-25 14:39:34 +02:00
auto-save.js autosave: factorize some javascript code 2020-08-25 14:39:34 +02:00
auto-upload-controller.js javascript: human-readable message for reading errors during upload 2020-05-14 13:29:54 +02:00
auto-upload.js fix new prettier defaults 2020-05-12 18:18:37 +02:00
auto-uploads-controllers.js javascript: remove debug code for FileReader errors 2020-05-14 13:29:54 +02:00