Commit graph

9 commits

Author SHA1 Message Date
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
Pierre de La Morinerie
2532091302 form: improve wording of repetition blocks controls 2020-02-11 17:36:50 +01:00
Pierre de La Morinerie
dc1f3b4220 champs: add a "plus" icon to the "Add row" button 2019-10-24 16:52:29 +02:00
Pierre de La Morinerie
906f0fc468 champs: fix margin of "Add row" button in the Preview 2019-10-24 16:52:29 +02:00
Paul Chavard
5a216b5583 Fix default button type
fix #3924
2019-06-04 17:59:02 +02:00
Paul Chavard
f5c9b55c59 Move remove row button to the right and show button on previews 2019-02-07 13:10:29 +01:00
Paul Chavard
a0a1ce11c8 Add repetition to apercu 2019-02-07 12:29:27 +01:00
Paul Chavard
071448e1d9 Champ Repetition dossier editor 2019-02-04 16:19:07 +01:00
Paul Chavard
5d1c24f3d8 Add type de champ repetition models (with row) 2018-12-19 15:31:11 +01:00