Commit graph

109 commits

Author SHA1 Message Date
seb-by-ouidou
564c3c04fa feat: US4.3.8 administrateur management 2023-12-06 14:47:39 +01:00
Christophe Robillard
0b7d4452fd remove admin from manager 2023-10-19 09:14:44 +02: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
e9cb50d09c feat(api): add last_authenticated_at timestamp to api requests 2023-08-02 13:22:18 +02:00
Paul Chavard
0f6188a542 chore(annotate): remove model comments 2023-08-02 11:43:23 +02:00
seb-by-ouidou
243b8c239a feat(administrateur): add environment variable for Administrateur::UNUSED_ADMIN_THRESHOLD 2023-07-24 15:55:33 +00:00
Christophe Robillard
18f5c2a9ad merge only v3 api tokens 2023-07-17 16:35:07 +02:00
Christophe Robillard
faecefe405 merge admin api tokens 2023-06-28 13:37:33 +02:00
Christophe Robillard
34540d34e9 create default_zones_administrateurs 2023-05-16 09:40:53 +02:00
Colin Darie
a413d2fa9c fix(admin): can delete an admin without published procedure 2023-04-07 16:10:10 +02:00
Martin
75657b5484 correctif(administrateur.merge): la fusion de compte entre admin devrait dissocie les services des procedures supprimées 2023-04-04 16:29:24 +02:00
Paul Chavard
dad393355b chore(db): remove unused columns 2023-01-17 12:49:22 +01:00
Paul Chavard
7929b7d0d7 clean(api_token): remove administrateur token support 2022-12-08 17:35:21 +01:00
Paul Chavard
ebbada752f feat(api_token): add APIToken model 2022-12-07 18:19:37 +01:00
simon lehericey
4babee2591 fix(admin): ignore active column
the attribut should be retrieve from the user model as the administrateur is no more a devise model
2022-11-22 16:41:20 +01:00
simon lehericey
1760ccbc01 fix(merge): transfers hidden procedures 2022-11-07 14:11:05 +01:00
Christophe Robillard
f9f31b721a get zones of an admin 2022-10-31 16:12:02 +01:00
simon lehericey
4c98b8f01c fix(merge): ensure service transfert always works 2022-10-27 12:44:02 +02:00
simon lehericey
44aff1a293 fix(silent_error_in_merge): raise if merge update fail 2022-10-26 23:27:53 +02:00
simon lehericey
5fa5d46d8c fix(admin_merge): a case where 2 admins have the same service 2022-10-19 16:54:34 +02:00
Paul Chavard
df47f4a7ab feat(graphql): new tokens should carry administrateur_id 2022-09-29 11:58:58 +02:00
Martin
dc524cf615 fix(spec): broken spec due to TDD and refacto on former code 2022-08-23 13:28:10 +02:00
Martin
ef67958324 feat(manager): add #add_administrateur_with_confirmation and #confirm_add_administrateur so SuperAdmin requires another SuperAdmin approval to add an administrator to a procedure. Add #add_administrateur_and_instructeur for SuperAdmin willing to be administrateur/instructeur for 24 2022-08-23 13:28:10 +02:00
simon lehericey
a2947751e2 add scope to query old admins 2022-05-03 12:14:02 +02:00
Pierre de La Morinerie
017625207e db: add constraints to role tables 2022-03-29 14:52:38 +02: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
48ea53b90d db: add foreign keys to Administrateur, Instructeur and Expert 2022-03-15 15:15:51 +01:00
Pierre de La Morinerie
71e1b6c973 models: delete AdministrateursProcedure when destroying Administrateur
By default, `has_and_belongs_to_many` properly deletes the record in
the join table.

However, as the association is declared manually with a
`has_many / through`, it doesn't delete the joined record automatically.

As we also lack a foreign-key contraint on the join table, that means
a dangling record remains in the join table.

To fix this, let's declare it a proper `has_and_belongs_to_many`
association, which will let the join record be deleted automatically
on destroy.
2022-03-01 16:58:04 +01:00
simon lehericey
866df74706 merge admin 2021-10-19 16:12:42 +02:00
clemkeirua
5a8fbde0e7 remove dead code in admin model 2020-09-18 11:16:34 +02:00
Pierre de La Morinerie
6d28069539 models: generate annotations 2020-08-12 11:45:53 +02:00
clemkeirua
8c2f589cbf fix admin deletion of empty service with archived procedures 2020-04-10 20:01:40 +02:00
Paul Chavard
c763679b54 Remove non-existant columns from manager dashboards 2020-03-26 16:17:07 +01:00
simon lehericey
378443eb5b Fix admin/new manager page 2020-03-24 15:52:37 +01:00
Christophe Robillard
d8d9b0922d remove orphan services when destroying admin 2020-03-16 21:40:05 +01:00
Christophe Robillard
9f7b78ff8b supprime les colonnes ignorées 2020-02-17 19:03:43 +01:00
Christophe Robillard
6e0d1eaee3 remove email ignored column for admin and instructeur 2020-02-17 15:01:40 +01:00
Christophe Robillard
91f1722088 admin: always eager load the user relationship
Now that `Administrateur.email` is merely an alias to
`administrateur.user.email`,
and we changed every occurence of `administrateurs.pluck(:email)` to
`administrateurs.map(&:email)`, the new version using `map` may cause N+1
queries if the users have not been preloaded.

  It makes sense to always preload the user when fetching an
  Administrateur:

  - Administrateur and User have a strongly coupled relationship
  - It avoids N+1 queries everywhere in the app

  Of course fetching an administrateur without needing its user will now do
  an unecessary fetch of the associated user. But it seems better than
  leaving a risk of N+1 queries in many places.
2020-02-04 16:21:42 +01:00
Christophe Robillard
4a1980e95a admin: disable the email column 2020-02-04 16:21:42 +01:00
Christophe Robillard
2bb161c3cb admin: alias Administrateur.email 2020-02-04 16:21:42 +01:00
Christophe Robillard
055918aabc admin: replace calls to Administrateur.find_by(email: ...) 2020-02-04 16:21:42 +01:00
Christophe Robillard
c137917396 fix typo 2020-02-04 16:07:01 +01:00
Christophe Robillard
deb11f281f remove useless relation between administrateur and dossiers 2020-02-04 16:07:01 +01:00
Christophe Robillard
5a46effcbc remove useless condition to admin that can be deleted
administrateur can be deleted only if he/she has a procedure where
he/she is the only admin
2020-02-04 16:07:01 +01:00
Christophe Robillard
cee4c5b8fb Revert "Revert "4127 fix superadmin supprime compte usager""
This reverts commit 751f24f7bb.
2020-02-04 16:07:01 +01:00
Pierre de La Morinerie
751f24f7bb
Revert "4127 fix superadmin supprime compte usager" 2020-01-21 18:57:54 +01:00
Christophe Robillard
675bbdad15 transfere les services lors de suppression admin
Lorsqu'un administrateur est supprimé, ses services sont transférés à un
autre administrateur pour chacune de ses procédures
2020-01-21 15:05:33 +01:00
Christophe Robillard
696a058280 delete adminis with procs managed by other admins 2020-01-13 10:06:43 +01:00
Paul Chavard
fa2eea81aa Cleanup demarche archivee state 2020-01-07 11:13:42 +01:00