Commit graph

6912 commits

Author SHA1 Message Date
Pierre de La Morinerie
859a147c49 api: return error cause on parse error
Currently, when a query can't be parsed, the error is:
- logged to Sentry (which is useless to us),
- returned as a generic 'Internal Server Error' (which is useless to the
  user who made the query).

With this commit, the error is instead ignored from our logs (because it
is a user error), but the parse error details are returned to the user,
with the following format:

> {'errors': [{'message': 'Parse error on ")" (RPAREN) at [3, 23]'}]}
2021-11-19 15:15:10 +01:00
Martin
3d1533dee9 feat(users/dossiers?statut=dossiers-expirant): add dossiers-expirant tab 2021-11-19 15:14:39 +01:00
Martin
a9978fb70b clean(code): move mfo comment to its rightful place 2021-11-19 14:34:20 +01:00
Martin
608a85148f feat(Dossier.close_to_expiration): add method to find any kind of dossier close to expiration [reuse previous scopes], add missing spec to termine_close_to_expiration, complement spec for each kind of expiration scope with general close_to_expiration spec 2021-11-19 14:28:54 +01:00
Martin
d8257284ef tech(refactor): extract states close to expiration within their scope. 2021-11-19 14:07:47 +01:00
Martin
1d721f14a0 fix(spec): get back to stable state 2021-11-19 12:36:03 +01:00
Martin
646459a1da fix(spec): at least let us start from a green suite 2021-11-18 18:15:57 +01:00
Paul Chavard
df474b60cf WIP 2021-11-18 18:58:17 +03:00
Paul Chavard
ae09b37e72 fix(champs): save departement info on champ commune 2021-11-17 14:52:47 +03:00
mfo
82b23b92c0
Merge branch 'main' into 6624/etq-instructeur-je-souhaite-supprimer-des-messages-envoyes-par-erreur 2021-11-17 05:41:56 +01:00
Paul Chavard
716a859c93 fix(profile): prevent crashing on renew token action 2021-11-16 20:01:56 +03:00
Paul Chavard
e74d599042 feat(procedure): remove duree_conservation_dossiers_hors_ds 2021-11-16 19:55:56 +03:00
Paul Chavard
65e59b8dcd fix(procedure): allow to modify duree_conservation_dossiers_dans_ds after publication 2021-11-16 19:55:56 +03:00
Paul Chavard
406c5a61cc fix(dossier): fix dossier traitements display 2021-11-16 19:00:20 +03:00
Paul Chavard
04e67ea20a fix(dossier): add instructeur email to traitements when available 2021-11-16 19:00:20 +03:00
mfo
1d174df2ec
Merge branch 'main' into 6624/etq-instructeur-je-souhaite-supprimer-des-messages-envoyes-par-erreur 2021-11-16 16:37:15 +01:00
Martin
f0950b592b clean(CommentaireService): extract soft delete within controller. returning an instance with an error[:base] is not persisted with validation : avoid poluting stuff 2021-11-16 16:13:11 +01:00
Paul Chavard
3400c4c628 fix(champs): attach piece justificative 2021-11-16 17:57:41 +03:00
Martin
8bbd77f89f refactor(mail.delay): use simplier implementation using after_action to prevent email delivery with delay 2021-11-16 15:12:05 +01:00
Martin
0aecc301c9 refactor(Commentarie.soft_delete): use discard 2021-11-16 14:28:38 +01:00
Paul Chavard
7914775809 feat(routage): administrateur can disable routage
fix #6627
2021-11-16 11:49:51 +03:00
simon lehericey
e3c1e19424 include hidden dossier in merge 2021-11-15 23:14:41 +01:00
mfo
08350f394e
feat(mails): send it on mailer queue 2021-11-15 16:19:46 +01:00
Martin
ddabed0c7e fix(refactor): continue to revert to past implementation. now use a job instead of calling deliver_later(wait: 5.minutes) [was not a satisfying implementation] 2021-11-15 15:45:48 +01:00
Martin
5534c3fbd6 fix(refactor): forgot to cleanup former implementation 2021-11-15 15:43:51 +01:00
Martin
5b6bb5171c tech(lint): rubocopify 2021-11-15 15:42:20 +01:00
Martin
c68fa2d7f3 feat(Commentaire.notify_user): wait 5 minutes before sending email to user when instructor write a commentaire. leaving some space for instructor to destroy his message 2021-11-15 15:38:57 +01:00
Martin
46fc956de3 fix(refactor): forgot to pass var, classy 2021-11-15 15:01:56 +01:00
Martin
a74ca8ad39 fix(spec): scope out time as reference for time comparission, hope not a matter of precision 2021-11-15 14:55:35 +01:00
Martin
f1293814a3 fix(spec): apparently we do store time with zone 2021-11-15 14:35:43 +01:00
Martin
4042d51d1a tech(lint): rubocopify 2021-11-15 14:17:57 +01:00
Martin
d4c74b5621 feat(rc.1): refine with better translations, better design 2021-11-15 14:15:05 +01:00
Martin
3b78a9d81a feat(rc): first stable 2021-11-15 13:53:32 +01:00
simon lehericey
15d4c4c7b0 small fix on profil 2021-11-15 13:51:26 +01:00
Martin
8b931a57d4 feat(CommentairesController#destroy): implement destroy endpoint using CommentaireService 2021-11-15 13:18:10 +01:00
Martin
9a8ec1087c feat(commentaire.soft_delete): wrap deletion behaviour in service 2021-11-15 12:43:53 +01:00
Martin
5b72bdec7e fix(Commentaire.sent_by?): &.email compared to nil could sent by true when nil==nil, avoid this one 2021-11-15 12:01:56 +01:00
Martin
b03dc6ad5d wip(dossiers/messages/_message): poc destroy button with expected ACL support 2021-11-15 11:30:41 +01:00
Paul Chavard
da47f491b3 fix(dossier): nullify close to expiration notice timestamps when changing state 2021-11-11 12:52:58 +01:00
Paul Chavard
faa235d205 fix(dossier): destroy operation logs when destroying an expired dossier 2021-11-11 09:37:09 +01:00
Paul Chavard
71939c650b fix(export): remove wrong columns from repetition spreadsheets
This fix prevent repetition children types de champ from being pulled from cloned procedures. stable_id is stable across revisions but also across cloned procedures.
2021-11-10 20:45:32 +01:00
Peng-Fei DONG
dc560479ec clean css in page deleted_dossiers for show the dossier table 2021-11-09 12:45:41 +01:00
kara Diaby
9ee9389ba1 add the good retry_on StaleObjectError 2021-11-05 13:32:21 +01:00
simon lehericey
17d131b3cc add has_may requested_merge_from 2021-11-04 16:10:09 +01:00
simon lehericey
9041e201e8 one merge at a time 2021-11-04 16:10:09 +01:00
simon lehericey
adfac5fb7b improve ui 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
652b8367be accept or refuse 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
894e8fdd47 move update_email check to before_action 2021-11-04 16:10:09 +01:00
Paul Chavard
ba0211ba52 feat(champ): ask for departement before asking for commune 2021-11-04 11:55:25 +01:00
Paul Chavard
122cdacbc2 fix(avis): destroy avis for discarded en_construction dossiers 2021-11-04 10:12:44 +01:00
Paul Chavard
f6b8689a97 fix(revisions): fix repetitions export with revisions 2021-11-03 18:20:48 +01:00
Paul Chavard
0e2f09dd6f fix(dossiers): wrap dossier discard in a transaction
By doing this we ensure that deleted_dossier are not created when dossier is not discarded
2021-11-02 18:17:35 +01:00
Paul Chavard
7ef73f13e4 fix(grope_instructeur): can not destroy groupe_instructeur with discarded dossiers 2021-11-02 12:15:24 +01:00
Paul Chavard
3c2515ce6d feat(graphql): add graphql_operation to rails logs 2021-11-02 12:02:00 +01:00
kara Diaby
87ed764f9b enlarge procedure title in user dossier 2021-10-29 14:05:49 +02:00
Paul Chavard
da49a6447f refactor(repetition): optimize and add a transaction around repetition add row 2021-10-28 14:54:33 +02:00
Paul Chavard
f9a8fb4ada fix(repetition): prevent rage clicks on add row button 2021-10-28 14:54:32 +02:00
Paul Chavard
c4b93f8d4a fix(groupe_instructeur): unfollow dossiers when removed from groupe instructeur 2021-10-28 14:45:52 +02: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
1393b7b07b fix(rebase): fix repetition champ rebase 2021-10-28 13:27:53 +02:00
Paul Chavard
d659595cde fix(typo): addresse -> adresse 2021-10-27 18:59:18 +02:00
Paul Chavard
6599f9a992 fix(bulk_messages): disable pj on bulk messages 2021-10-27 15:41:53 +02:00
Paul Chavard
7ebc439630 refactor(drop_down_list_champ): other option 2021-10-27 12:01:15 +02:00
Paul Chavard
8154daf847 refactor(drop_down_list_champ): other option 2021-10-27 12:00:39 +02:00
kara Diaby
f1f2b76a3d revisions 2021-10-27 12:00:39 +02:00
kara Diaby
c2fcd3992d add other option for dropdown select 2021-10-26 16:11:15 +02:00
kara Diaby
0e65916e44 add other option for dropdown radio 2021-10-26 16:11:15 +02:00
kara Diaby
dc35d9521f add other option to liste deroulante champ 2021-10-26 16:11:15 +02:00
Paul Chavard
6e8e0c7b6b feat(type_de_champ): reflect changes of secondary labels and descriptions 2021-10-26 12:18:01 +02:00
Paul Chavard
d308448f02 feat(type_de_champ): add secondary label and description do linked drop downs 2021-10-26 12:18:01 +02:00
Paul Chavard
579dce8eb6 refactor(user): wrap user destruction in a transaction 2021-10-26 11:16:29 +02:00
Paul Chavard
d5d3995dad fix(dossier): fix dossier.avis cascade 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
d0e87a08cf services: cache zxcvbn dictionaries per-thread
Before, every time a password was tested, the dictionaries were parsed
again by zxcvbn.

Parsing dictionaries is slow: it may take up to ~1s. This doesn't matter
that much in production, but it makes tests very slow (because we tend
to create a lot of User records).

With this changes, the initializer tester is shared between calls, class
instances and threads. It is lazily loaded on first use, in order not to
slow down the application boot sequence.

This uses ~20 Mo of memory (only once for all threads), but makes tests
more that twice faster.

For instance, model tests go from **8m 21s** to **3m 26s**.

NB:
An additionnal optimization could be to preload the tester on
boot, before workers are forked, to take advantage of Puma copy-on-write
mechanism. In this way all forked workers would use the same cached
instance.

But:

- We're not actually sure this would work properly. What if Ruby updates
  an interval ivar on the class, and this forces the OS to copy the
  whole data structure in each fork?
- Puma phased restarts are not compatible with copy-on-write anyway.

So we're avoiding this optimisation for now, and take the extra 20 Mo
per worker.
2021-10-25 12:04:56 +02:00
Paul Chavard
1561ea82f6 fix(transfer): manually nullify staled transfers references 2021-10-21 13:54:26 +02:00
Paul Chavard
2a3a9dd822 feat(revisions): rebase dossiers brouillons 2021-10-20 17:26:09 +02:00
Paul Chavard
09a09d3fcf feat(revisions): add rebased_at to champs 2021-10-20 17:26:09 +02:00
Paul Chavard
67e98f79c9 feat(revisions): add stable_id to changes 2021-10-20 17:25:34 +02:00
Paul Chavard
1ca8192864 perf(export): load dossiers.champs in batches 2021-10-20 16:52:38 +02:00
lydiasan
6f9c3abfbc i18n: display language selector on non-french accept-languages 2021-10-19 16:41:36 +02:00
simon lehericey
d19ad2840c rename preexisting to targeted, remove duplicated test 2021-10-19 16:12:42 +02:00
simon lehericey
52b7e85954 merge administrateur in user_controller 2021-10-19 16:12:42 +02:00
simon lehericey
866df74706 merge admin 2021-10-19 16:12:42 +02:00
simon lehericey
44c880adc4 allow instructeur and administrateur to change their email to legit domain (#6550) 2021-10-19 15:54:57 +02:00
Paul Chavard
8fa544e176 feat(manager): bring back add administrateur 2021-10-19 12:06:31 +02:00
simon lehericey
f54dfe6ead Do not raise error if user is nil
I do not get when it happens
2021-10-19 11:21:24 +02:00
simon lehericey
46fd15416b add end to end test 2021-10-14 14:47:50 +02:00
simon lehericey
bb83fd2f18 To make an old test work, no idea 2021-10-14 14:47:50 +02:00
simon lehericey
933d7b8c8d merge with another preexisting account 2021-10-14 14:47:50 +02:00
simon lehericey
ce40e1127d merge with another new account 2021-10-14 14:47:50 +02:00
simon lehericey
19f81b594b merge with an existing account by using the password 2021-10-14 14:47:50 +02:00
simon lehericey
218e4633a9 securely retrieve fci 2021-10-14 14:47:50 +02:00
simon lehericey
f7299da1e7 launch merge process if an unlinked DS account with the same email exists 2021-10-14 14:47:50 +02:00