demarches-normaliennes/app/views/shared/dossiers/editable_champs
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
..
_address.html.haml Revert "Revert "Merge pull request #4552 from tchak/champ-communes"" 2020-01-14 18:46:07 +01:00
_carte.html.haml Put IGN map behind a feature flag 2020-07-30 17:22:28 +02:00
_champ_label.html.haml fix heading order by removing useless h4 2020-07-20 11:36:55 +02:00
_champ_label_content.html.haml replace html labels with h2 elements 2020-03-24 16:54:35 +00:00
_checkbox.html.haml editable_champs: move the label near the checkbox 2018-06-18 18:12:11 +02:00
_civilite.html.haml ajout d'un fieldset sur le champ civilité 2020-03-24 16:54:35 +00:00
_communes.html.haml Revert "Revert "Merge pull request #4552 from tchak/champ-communes"" 2020-01-14 18:46:07 +01:00
_date.html.haml date champs: adding a placeholder for IE and Safari (which do not support the input type date) 2020-08-19 14:10:58 +00:00
_datetime.html.haml datetime type de champ: changed the years range from [1950;2100] to [to current year - 1; 2020-08-13 13:41:45 +00:00
_decimal_number.html.haml Add DecimalNumberChamp 2018-11-06 11:28:44 +01:00
_departements.html.haml Revert "Revert "Merge pull request #4552 from tchak/champ-communes"" 2020-01-14 18:46:07 +01:00
_dossier_link.html.haml Fix procedures with multiple dossier link champs 2018-10-24 10:44:28 +02:00
_drop_down_list.html.haml views: add a "None" option to optional radio lists 2020-08-25 11:42:30 +02:00
_editable_champ.html.haml dossiers: allow auto upload of attachments 2020-03-31 13:09:44 +02:00
_email.html.haml editable_champ: move partials path 2018-02-27 18:36:29 +01:00
_engagement.html.haml editable_champ: move partials path 2018-02-27 18:36:29 +01:00
_etablissement_titre.html.haml siret: make etablissement styled and visible 2018-07-30 17:49:00 +02:00
_explication.html.haml [Fix #1801] use the new string_to_html method 2018-05-24 18:05:41 +02:00
_header_section.html.haml form: don't display index if the libelle already starts with a number 2020-02-13 11:21:30 +01:00
_integer_number.html.haml Add IntegerNumberChamp 2018-11-06 11:28:44 +01:00
_linked_drop_down_list.html.haml Store drop_down_list values as jsonb 2020-06-25 13:14:17 +02:00
_multiple_drop_down_list.html.haml Store drop_down_list values as jsonb 2020-06-25 13:14:17 +02:00
_number.html.haml editable_champ: move partials path 2018-02-27 18:36:29 +01:00
_pays.html.haml Revert "Revert "Merge pull request #4552 from tchak/champ-communes"" 2020-01-14 18:46:07 +01:00
_phone.html.haml very light client-side validation for phone 2020-08-20 15:33:03 +02:00
_piece_justificative.html.haml views: refactor the attachment/edit view 2019-10-31 10:27:19 +01:00
_regions.html.haml Revert "Revert "Merge pull request #4552 from tchak/champ-communes"" 2020-01-14 18:46:07 +01:00
_repetition.html.haml autosave: remove the repetition row after deletion 2020-08-25 14:39:34 +02:00
_siret.html.haml form: fix the bottom margin of the siret element 2020-02-11 17:36:50 +01:00
_text.html.haml Use aria-describedby to link notice and input again 2019-11-21 15:34:59 +01:00
_textarea.html.haml minor typo in textareas 2019-12-03 10:13:16 +01:00
_yes_no.html.haml ajout d'un fieldset sur le champ civilité 2020-03-24 16:54:35 +00:00