Commit graph

29 commits

Author SHA1 Message Date
Pierre de La Morinerie
0800bf68d0 views: allow unselecting all values from a multiple dropdown
Currently, deselecting all values from a multiple dropdown rendered as
checkboxes doesn't have any effect when submitting the form (the
previous values are still there, instead of being deselected).

This is because unchecked checkboxes are not sent by the browser – so
the "empty selection" never gets sent.

Rails `form.check_box` usually works around this by inserting an empty
hidden checkbox element, that will be sent even if all others are
de-selected. But the documentation warns that this is not possible when
iterating over an array (rather than a model). Which is our case here.

To fix this, this commit uses `collection_check_boxes` instead. It will
insert the proper hidden checkboxes in all cases, and fix our use case.

See https://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#method-i-collection_check_boxes
2020-08-27 11:13:40 +02:00
Pierre de La Morinerie
4bba1f0660 views: add a "None" option to optional radio lists
After clicking on a radio button option, it is impossible to revert to
the "None of the values selected" state.

However on non-mandatory fields, reverting to the no-selection value
should be possible.

To fix this, add an explicit "N/A" option.
2020-08-25 11:42:30 +02:00
Pierre de La Morinerie
6328011f60 models: require belong_to associations on champ
- Make `champ.dossier` a requirement;
- Move the dossier_id assignation to `before_validation` (otherwise
the record is invalid, and never gets saved);
- Allow specs to only build the champ (instead of saving it to the
database), which bypasses the requirement to have a dossier.
2020-08-18 15:57:37 +02:00
clemkeirua
de1df85462 suppression du message d'alerte suite aux problèmes d'upload 2020-07-27 10:32:03 +02:00
clemkeirua
77101208a4 Anonymisation de l'instructeur dans la messagerie 2020-05-18 12:56:30 +00:00
Christophe Robillard
8e7f210216 affiche infos entreprise uniquement si diffusable
le champ de type siret affiche les infos d'une entreprise dont les infos sont diffusables uniquement aux instructeurs
2020-03-17 15:57:02 +00:00
Christophe Robillard
924702699f highlight routing criteria label when updated 2020-03-04 14:56:59 +01:00
Pierre de La Morinerie
d4574bade1 dossier: add a custom message for the dossier owner 2020-02-12 11:49:33 +01:00
Pierre de La Morinerie
7ba76c6658 dossier: add a notice when some attachments of the dossier were lost
On the 22/01/2020, a technical error on the demarches-simplifees.fr
instance made us delete some files attached to some dossiers.

This PR adds a warning when browsing a dossier containing attachments
that were deleted.
2020-02-12 11:49:33 +01:00
simon lehericey
18de25fac7 Display the dossier.groupe_instructeur.label on various screens 2019-10-17 15:48:14 +02:00
Paul Chavard
e7ed408e08 Auto-link valeur des champs
closes #2865
2019-10-07 21:20:24 +02:00
simon lehericey
ad31822a68 Spec: sign_in with instructeur.user 2019-08-13 15:15:16 +02:00
simon lehericey
3fde2a6f70 Rename gestionnaire in code to instructeur 2019-08-12 13:47:01 +02:00
Pierre de La Morinerie
f825f62ce5 dossier: remove UI for viewing old pieces justificatives 2019-07-30 16:11:16 +02:00
Pierre de La Morinerie
92dd91a31b messagerie: add a reply button next to the latest message 2019-07-17 11:43:21 +02:00
Nicolas Bouilleaud
fac20ed190 Fix Commentaire factory so that the default case creates a valid object 2019-07-08 16:13:43 +02:00
pedong
7ef1a558f4 change date format for all, use try_format_date of helper 2019-06-12 17:48:12 +02:00
Paul Chavard
a4a421a91a Champ Repetition dossier display 2019-02-04 15:46:39 +01:00
Pierre de La Morinerie
6a0996c5f3 specs: refactor a view spec to be clearer and faster 2019-01-10 11:26:43 +01:00
Pierre de La Morinerie
5719107cbc views: fix misnamed textarea template 2019-01-10 11:26:43 +01:00
Paul Chavard
c6ef30f3e1 Remove unused carto from instructeur interface 2018-11-27 16:11:25 +01:00
gregoirenovel
3a973999a3 [Ref #2738] Hide exercices if not gestionnaire 2018-10-17 15:07:29 +02:00
Paul Chavard
38091963c1 Update carto tests 2018-10-14 12:34:44 +02:00
Pierre de La Morinerie
aae1a22b3b dossier spec: add tests to demande view 2018-09-25 16:47:16 +02:00
Pierre de La Morinerie
613900a053 dossier spec: mutualize demande view specs 2018-09-25 16:47:16 +02:00
gregoirenovel
c1bec7cf0b Pass the connected_user object instead of its email 2018-09-11 18:17:40 +02:00
Pierre de La Morinerie
63472f00e6 messagerie: generalize the current user email 2018-09-05 13:56:12 +02:00
Pierre de La Morinerie
4e2a5f0b9b messagerie: move templates to a shared location 2018-09-05 13:56:12 +02:00
Pierre de La Morinerie
86539413ee gestionnaire: move dossier partials to a shared location 2018-08-14 15:06:44 +02:00