Commit graph

176 commits

Author SHA1 Message Date
Paul Chavard
ec72fdd164 Remove migration service 2020-09-02 11:26:26 +02:00
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
clemkeirua
c772c3454c update dossier after saving champ
update last_champ_updated_at without hook
update last_champ_private_updated_at without hook

Co-authored-by: Christophe Robillard <christophe.robillard@beta.gouv.fr>
2020-07-30 10:18:44 +02:00
clemkeirua
f3a675c3bc update dossier after saving commentaire
update last_commentaire_updated_at without hook

Co-authored-by: Christophe Robillard <christophe.robillard@beta.gouv.fr>
2020-07-30 10:18:44 +02:00
Paul Chavard
d18a9c8162 Migrate procedures “on demand” 2020-07-21 19:35:30 +02:00
Christophe Robillard
f631acd118 update state date in aasm after callbacks
call aasm event methods, not state methods directly
2020-07-08 18:15:15 +02:00
Christophe Robillard
eebfb5ee5b update dossiers_controller when updating siret
now, `ApiEntrepriseService` does'nt return a hash anymore but an
etablissement which is already persisted.
2020-05-20 11:09:54 +02:00
Christophe Robillard
3ddb5a4cb4 store attestation fiscale and display 2020-04-30 11:39:54 +02:00
Christophe Robillard
158b4802ab store attestation sociale and display 2020-04-29 16:25:47 +02:00
Christophe Robillard
339066778d send notif only to the right instructeurs
after a dossier creation, only the instructeurs that belong to the group
instructeur of the dossier, and who want notif will be notified by mail
2020-04-23 13:01:57 +02:00
Christophe Robillard
f683b850c3 Notifie instructeurs le souhaitant lors depot dossier
Notifie par mail uniquement les instructeurs qui le souhaitent à chaque dépôt de dossier
2020-04-09 15:02:05 +02:00
Christophe Robillard
ae18ff6627 Notifie tous les instructeurs lors dépôt dossier
- envoie un mail à tous les instructeurs d'une procédure après le dépôt
d'un nouveau dossier
2020-04-09 14:33:56 +02:00
Christophe Robillard
969478b706 Envoie une notif aux followers_instructeurs le souhaitant
après chaque message déposé par l'usager
2020-04-09 14:17:07 +02:00
Christophe Robillard
415d5c765e envoie une notification à chaque follower_instructeur après un commentaire déposé 2020-04-09 14:17:07 +02:00
clemkeirua
76139dbc71 recherche usager full-text avec plusieurs resultats 2020-04-09 09:42:31 +02:00
clemkeirua
98337f2334 recherche usager full-text avec 1 resultat 2020-04-09 09:42:31 +02:00
clemkeirua
34188c432c refactor _new_header so that user and instructeur search share similar signature 2020-04-09 09:42:31 +02:00
Paul Chavard
c707a21f97 Rename delete_and_keep_track -> discard_and_keep_track 2020-03-26 14:23:23 +01:00
clemkeirua
5896aedeeb added extension bouton to en_construction dossiers bound to expire 2020-03-24 18:10:51 +01:00
Paul Chavard
5c2eba1dd1 Always add a reason to dossier deletion 2020-03-24 09:30:11 +01:00
Christophe Robillard
775cc11d30 include store_location_extension for all controllers 2020-03-20 10:41:36 +01:00
Paul Chavard
c281347da1 Remove restclient 2020-03-17 11:12:14 +01:00
Paul Chavard
c46e012c10 Use dossier.assign_to_groupe_instructeur 2020-03-03 10:30:49 +01:00
clemkeirua
1c3573c7db fix DoubleRender error for brouillon pdf 2020-01-29 14:24:23 +01:00
clemkeirua
bc506bf693 ajout d'un lien d'export pdf usager 2020-01-14 09:29:29 +01:00
Paul Chavard
785a09b326 Use service_url instead of blob_url on secure attachments 2020-01-08 14:43:05 +01:00
Pierre de La Morinerie
b3558c497d dossiers: make build_default_individual explicit
It avoid the use of callbacks, and may avoid situations where an empty
individual is implicitely created.
2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
5e05556ee8 dossiers: add a validation on dossier individual
Validate that a dossier on a `for_individual?` procedure always has
an `individual` associated record.

For this, the individual needs to be built before the record is
validated (i.e. even before the `before_create` callback is run).

This should help with #4596: now if a dossier is created without an
`individual`, or if the `invividual` record is later removed, the
validation will fail.
2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
e32a42cfe6 dossiers: split the dossier creation on several lines 2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
5b2311c851 dossiers: rescue RecordNotFound only for procedures
This ensures that we won't rescue an `ActiveRecord::RecordNotFound`
exception related to another object.
2020-01-08 10:48:21 +01:00
Pierre de La Morinerie
f58f9f9950 dossiers: render a valid response after an autosave
This helps Firefox DevTools to mark the request as valid and completed
successfuly.
2019-11-27 10:37:33 +00:00
Pierre de La Morinerie
5f9a9d059e dossiers: render JSON if needed
When receiving a request that expects JSON, return a simple '200'.

This avoids the unecessary work of rendering all the HTML page (which
ultimately will not be used).
2019-11-20 11:30:27 +01:00
Pierre de La Morinerie
8b8a96abda dossiers: save draft by default (instead of submitting)
Make the default behavior of `update_brouillon` be to update the draft,
instead of submitting the dossier.

This makes all requests made to `update_brouillon` without specifying
an extra `submit_draft` parameter to just save the draft. It will make
autosaving the draft easier and safer.
2019-11-20 11:24:31 +01:00
Paul Chavard
f5c80f211d Guard for missing attestation on dossier 2019-11-06 12:54:07 +01:00
simon lehericey
b7434c3132 User can choose its gi 2019-10-17 15:48:14 +02:00
Paul Chavard
8fcf1353f3 Remove duplicated attachments 2019-09-17 18:12:53 +02:00
Paul Chavard
347f03d2a9 Redirect to pdf attachement old name if not attached 2019-09-10 15:06:47 +02:00
simon lehericey
4da12ed3e8 User/DossierController: dossier are linked to default group by default 2019-09-03 06:47:02 +02:00
benjaminhenkel
73d643d1be Update flash message for test demarche 2019-08-28 14:54:17 +02:00
Paul Chavard
32563c3675 Redirect to active_storage files when available 2019-08-27 17:43:33 +02:00
clemkeirua
707e8a0004 dossier_controller#new uses info from FC if any 2019-08-01 17:42:32 +02:00
Pierre de La Morinerie
5502f2e42e dossier: remove UI for uploading old pieces justificatives 2019-07-30 16:11:16 +02:00
Pierre de La Morinerie
a8354bd103 dossiers: unify deletion of dossiers between manager and user
The code paths for deleting a dossier were different, depending on
whether the dossier was deleted by the user, or from the Manager.

This commit unifies the two code paths into one.

This has the effect of:

- An operation log is now recorded when an user deletes its own dossier;
- Gestionnaires are now notified even when the dossier is deleted from
  the Manager;
- The `support:delete_user_account` task now requires the email address
  of the author.
2019-07-16 16:22:20 +02:00
Paul Chavard
3cb39c2840 Refactor message attachements to use active_storage 2019-07-10 15:35:29 +02:00
Paul Chavard
ff44b7a600 Refactor purge pj to be more generic 2019-05-29 15:54:51 +02:00
Paul Chavard
4a9ef5d12e Always use purge_later 2019-05-21 14:05:33 +02:00
Pierre de La Morinerie
e06e32238c api_entreprise: display a specific error message on network errors 2019-05-02 11:24:38 +02:00
Paul Chavard
1c71355574 Better warnings in test mode 2019-04-30 11:03:24 +02:00
Pierre de La Morinerie
ded5b70444 app: rename new_user to users 2019-03-25 10:56:39 +01:00
Paul Chavard
cfd1950e17 Migrate commencer to new_user 2018-11-01 13:10:41 +01:00