Commit graph

137 commits

Author SHA1 Message Date
Colin Darie
17f9992722
Merge pull request #10040 from colinux/cross-domain-component
Prépare la bannière informant du changement de nom de domaine, avec redirection automatique le cas échéant
2024-03-21 14:58:29 +00:00
Colin Darie
2f4444bd5e
chore: mark preferred domain to new domain when closing notice 2024-03-21 13:15:34 +01:00
simon lehericey
a42f85ef05 remove useless administration_id in invite_admin and invite_administrateur! 2024-03-21 11:54:02 +01:00
Martin
9425f2cc58 fix(user.france_connect_informations): has_many, not has_one 2024-03-08 09:44:21 +01:00
Martin
8488e74bbb review(suggestion): better code with reviews, normalize Champs::EmailChamp.value, simplier default strict validation activation
Co-authored-by: Colin Darie <colin@darie.eu>
2024-02-15 16:41:00 +01:00
Martin
5f77c0cd06 feat(email.validation): expand email validation to Avis, ContactInformation, Invite, DossierTransfert 2024-02-15 16:41:00 +01:00
Martin
05193e1d1e feat(User.validation): validates email when env var is present 2024-02-15 16:41:00 +01:00
Martin
520863d814 amelioration(user.expiration): ajoute une raison specifique a la suppression d'un dossier : user_expired 2023-11-17 11:33:14 +01:00
seb-by-ouidou
44b4b5d0ab feat: rename admins_group_manager to gestionnaire 2023-10-03 13:51:57 +02:00
seb-by-ouidou
e2f792b44b FEAT: init admins group 2023-10-03 13:51:57 +02:00
Paul Chavard
0f6188a542 chore(annotate): remove model comments 2023-08-02 11:43:23 +02:00
simon lehericey
ad7fa39b62 feat(user): block login when .. blocked 2023-07-18 14:10:40 +02:00
simon lehericey
c130f80a7d feat(user): add blocket_at and block_reason columns 2023-07-18 13:46:27 +02:00
Christophe Robillard
b13e77650e update default zones after admin creation 2023-05-24 17:40:00 +02:00
Paul Chavard
e2d5834dc2
Update app/models/user.rb
Co-authored-by: Colin Darie <colin@darie.eu>
2023-04-04 15:02:20 +02:00
Paul Chavard
0864666d0a fix(dossier): an invited user can remove (leave) a dossier 2023-04-03 20:10:44 +02:00
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
simon lehericey
66e9b74121 feat(manager): select team_user base on attribute 2022-11-17 16:29:08 +01:00
simon lehericey
9ed42b316f refactor(user): administration -> super_admin
delete_and_keep_track_dossier_also_delete_user is only called by super admin
2022-11-16 17:52:48 +01:00
simon lehericey
99871b6ba6 refactor(user): introduce method to only delete dossier 2022-11-16 17:52:47 +01:00
simon lehericey
fcfe09f05a refactor(user): rename delete_and_keep_track_dossiers 2022-11-16 17:52:47 +01:00
Martin
c9292e7ba8 amelioration(bdd): mise en place d'un flag pour identifier les anciens comptes d'admin de DS 2022-11-08 09:55:21 +01:00
Paul Chavard
c075a4e415 fix(dossier): we should never detroy user’s dossiers in cascade 2022-10-14 14:14:51 +02:00
Martin
d09c47f5ce correctif(usager.fusion): leve une erreur quand on essaie de fusionner un compte sur lui même 2022-10-13 17:00:20 +02:00
Paul Chavard
48a4e8bec5 chore(db): remove already dropped ignored columns 2022-08-02 15:24:52 +02:00
Martin
cb890343ff feat(targeted_user_link): add targeted user link to wrap expert invitation in order to avoid access issue when the expert is connected with another account
feat(user.merge): ensure to merge user.targeted_user_link

Update app/models/targeted_user_link.rb

Co-authored-by: LeSim <mail@simon.lehericey.net>

Update app/models/targeted_user_link.rb

Co-authored-by: LeSim <mail@simon.lehericey.net>

Update app/models/targeted_user_link.rb

Co-authored-by: LeSim <mail@simon.lehericey.net>

feat(db/create_targeted_user_links): ensure not null with fk
2022-05-31 14:50:31 +02:00
Paul Chavard
1e928a277d chore(devise): drop unmaintained dependencie 2022-04-28 12:28:33 +02:00
Pierre de La Morinerie
6849a73aec models: ignore deprecated User columns 2022-03-22 07:58:44 +01:00
Pierre de La Morinerie
31bd05f835 models: inverse the direction of the User role associations 2022-03-22 07:58:44 +01:00
Pierre de La Morinerie
d4da6502ba models: remove double-write callback on User 2022-03-22 07:58:44 +01:00
Pierre de La Morinerie
ae3e360139 models: double-write to the newly created foreign keys
This code is only used to handle a live system creating new
Administrateurs, Instructeurs or Experts before the migration to the new
foreign keys.
2022-03-15 15:57:22 +01:00
Pierre de La Morinerie
be834ba58d models: reload old_user roles before destroying it
Otherwise ActiveRecord believes that old_user still has roles (although
they have been migrated to the new user), and attempts to delete them.
2022-03-15 15:13:45 +01:00
Paul Chavard
54b559364a feat(dossier): replace discarded with visible_by_administration 2022-03-10 14:29:40 +01:00
Martin
d0ab1711ff fix(profil_controller#update_email): ensure we are not merging same account
fix(profil_controller#update_email): changing email from current_user.email to current_user.email destroy current user. whoops ☠️'

Update config/locales/en.yml

Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>

Update config/locales/fr.yml

Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>

Update spec/controllers/users/profil_controller_spec.rb

Update config/locales/fr.yml

Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>

Update spec/controllers/users/profil_controller_spec.rb

fix(spec): broken due to typo
2021-12-29 13:36:47 +01:00
simon lehericey
e3c1e19424 include hidden dossier in merge 2021-11-15 23:14:41 +01:00
simon lehericey
17d131b3cc add has_may requested_merge_from 2021-11-04 16:10:09 +01:00
simon lehericey
b160086cc5 update update_email to allow merge 2021-11-04 16:10:09 +01:00
simon lehericey
6625c6bac3 add requested_merge_into column in user table 2021-11-04 16:10:09 +01:00
simon lehericey
8fe1e2bf71 wrap merge in transaction 2021-10-28 14:39:13 +02:00
simon lehericey
7935e42109 Add merge log 2021-10-28 14:39:13 +02:00
simon lehericey
3328c9a132 merge move invite as well 2021-10-28 14:39:13 +02:00
simon lehericey
f2ccb39912 merge destroys the old role and account 2021-10-28 14:39:13 +02:00
simon lehericey
1401d163ba add dependent_destroy to user instructeur / admin / expert roles 2021-10-28 14:39:13 +02:00
simon lehericey
c725999582 move merge method to user 2021-10-28 14:39:13 +02:00
Paul Chavard
579dce8eb6 refactor(user): wrap user destruction in a transaction 2021-10-26 11:16:29 +02:00
Paul Chavard
4aa573a75d fix(transfer): remove discarded dossiers from transfers 2021-10-26 10:41:01 +02:00
Pierre de La Morinerie
e97b7164dd models: extract password complexity to a concern 2021-09-09 09:40:39 -05:00
Paul Chavard
f1ff6da81b feat(i18n): add locale to user 2021-09-07 09:47:01 +02:00
Paul Chavard
a4fd629f4a Enable user destruction 2021-05-04 12:05:06 +02:00
Paul Chavard
2a068fb9b0 Remove user feedback buttons 2021-04-22 15:40:40 +01:00