demarches-normaliennes/app/controllers
Sébastien Carceles 20136b7ac8
feat(demarche): create and prefill a dossier with POST request (#8233)
* add base controller for public api

* add dossiers controller with basic checks

* create the dossier

* ensure content-type is json

* prefill dossier with given values

* mark a dossier as prefilled

When a dossier is prefilled, it's allowed not to have a user.

Plus, we add a secure token to the dossier, which we will need later to set a
user after sign in / sign up.

* set user as owner of an orphan prefilled dossier

When a visitor comes from the dossier_url answered by the public api,
the dossier is orphan:
- when the user is already authenticated: they become the owner
- when the user is not authenticated: they can sign in / sign up / france_connect
and then they become the owner

So here is the procedure:
- allow to sign in / sign up / france connect when user is unauthenticated
- set dossier ownership when the dossier is orphan
- check dossier ownership when the dossier is not
- redirect to brouillon path when user is signed in and owner

* mark the dossier as prefilled when it's prefilled
(even with a GET request, because it will be useful later on, for
exmample in order to cleanup the unused prefilled dossiers)

* system spec: prefilling dossier with post request
2023-01-03 14:46:10 +01:00
..
administrateurs Supprime le feature flag pour que tous les administrateurs puissent ajouter des tags sur les démarches 2023-01-02 11:13:31 +01:00
agent_connect check nonce 2022-04-11 14:40:02 +02:00
api feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
application_controller app: use a long-lived cookie for CSRF token 2021-07-20 11:11:52 +02:00
champs feat(piece_justificative): allow user to replace a PJ for dossier en_construction 2022-12-14 09:58:15 +01:00
concerns feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
devise sign_in: extract the procedure context to a ProcedureContextConcern 2019-01-17 11:07:09 +01:00
experts clean(flipper): remove unused expert_not_allowed_to_invite 2022-12-05 12:22:29 +01:00
france_connect refactor(ujs): france_connect controller to use turbo 2022-09-29 16:51:54 +02:00
instructeurs correctif(instructeurs/dossier#telecharger_pjs): ne pas inclure les bills et horodatage quand on telecharge un dossier unitairement 2022-12-26 17:11:10 +01:00
manager manager procedure controller 2022-12-19 15:28:09 +01:00
super_admins devise: use password_strength component in SuperAdmin::PasswordsController 2021-09-09 09:40:39 -05:00
users feat(demarche): create and prefill a dossier with POST request (#8233) 2023-01-03 14:46:10 +01:00
admin_controller.rb clean(admin): remove unused code from old controller 2022-12-14 17:42:27 +01:00
api_controller.rb feat(api_token): api v1 use new token 2022-12-07 18:19:37 +01:00
api_geo_test_controller.rb Update specs 2020-10-08 15:26:15 +02:00
api_tokens_controller.rb feat(api_token): add api token controller 2022-12-07 18:19:37 +01:00
application_controller.rb refactor(piece_justificative): UX follows mockups 2022-12-05 10:47:10 +01:00
attachments_controller.rb refactor(attachment): rename user_can_download -> explicit view_as 2022-12-08 20:36:15 +01:00
graphql_controller.rb fix(graphql): fix playground when admin has no procedures or dossiers 2022-11-24 16:18:08 +01:00
invites_controller.rb fix(invite): do not render menu when invite not found 2022-11-24 09:43:19 +01:00
password_complexity_controller.rb app: add a password_complexity component 2021-09-09 09:40:39 -05:00
ping_controller.rb Fix ping controller in dev 2022-01-05 11:44:32 +01:00
prefill_descriptions_controller.rb feat(demarche): describe procedure prefilling (#8187) 2022-12-19 11:32:09 +00:00
recherche_controller.rb simplify and improve perf by making the feature works only for id search 2022-11-15 10:51:36 +01:00
root_controller.rb fix(patron): dossier should have a procedure and champ should delegate to dossier 2022-11-30 10:54:03 +01:00
saml_idp_controller.rb update saml controller and views 2022-08-23 15:05:20 +02:00
stats_controller.rb fix(stats): exported file should be csv 2022-11-24 15:40:46 +01:00
super_admins_controller.rb super_admin: fix OTP generation 2021-02-11 11:14:14 +01:00
support_controller.rb fix(messages): retry stale blobs 2022-11-02 09:19:51 +01:00
targeted_user_links_controller.rb fix(sentry/3422144920): old email using TargetUserLink creates confusing errors 2022-10-04 11:41:32 +02:00
webhook_controller.rb evolution(helpscout.webhooks): mise en place des rappel web afin de notifier l'equipe tech des bug identifies par le support 2022-11-08 17:00:03 +01:00