Commit graph

747 commits

Author SHA1 Message Date
Pierre de La Morinerie
d855468cb6 dossiers: display the estimate of the entire processing time
Displaying separate estimations for en_construction and en_instruction
doesn't really make sense for the users: they want to know how
long it is going to take overall, not the petty details of our workflow.
2019-04-30 15:56:27 +02:00
Nicolas Bouilleaud
1c2e93ed41 Fix “nearing_end_of_retention” test
The `nearing_end_of_retention` test creates a `just_expired_dossier` “six months ago”, which is 29 Oct 2018. The autumn DST change was on October 28; this is the first time this test runs under these conditions. We workaround the time offset by creating the dossier one hour earlier.

This is technically a workaround, not a fix: the date arithmetics in `nearing_end_of_retention` are probably wrong. It looks like it’s comparing intervals, which seems error-prone, while it should be comparing dates. For now, I’m just making the tests pass.
2019-04-29 15:41:52 +02:00
Paul Chavard
8d093bd9ba Fix missing dossier_id on champs inside repetition 2019-04-18 16:55:35 +02:00
simon lehericey
e65e21a72f Email notification: use the right method for procedures 2019-04-18 15:07:01 +02:00
Nicolas Bouilleaud
c5122ee7f5 Allow filtering ProcedurePresentation by followers_gestionnaires
fixes #3464
2019-04-10 14:32:51 +02:00
Pierre de La Morinerie
e34c556f29 procedure: fix specs
When the time computations are done accross a Daylight Saving Time
change, they may be off by one hour.

It doesn't matter, as the estimated delay is counted in days, not
hours.
2019-04-08 15:24:44 +02:00
Paul Chavard
639facaf2a Add new types_de_champ#move api 2019-04-03 14:38:07 +02:00
Mathieu Magnin
71e0969bc0 [Fix #3692] Ensure SIRET is correct on server 2019-03-28 18:03:53 +01:00
Mathieu Magnin
27c8e9dcb8 Use the same clone_attachment method for all attributes on procedure.clone 2019-03-28 17:17:29 +01:00
Mathieu Magnin
4e27872a25 [Fix #3650] when cloning a procedure, do not forget pj_templates 2019-03-26 15:31:09 +01:00
Pierre de La Morinerie
b1a7018d30 procedure: ignore bad data when computing usual_instruction_time
Fix #3655
2019-03-20 17:48:54 +01:00
Mathieu Magnin
6570bed09c [Fix #3641] Do not change PJ value in API if PJ is safe 2019-03-20 11:37:31 +01:00
Paul Chavard
69a51e3296 Save SIRET data on search 2019-03-19 16:22:42 +01:00
Pierre de La Morinerie
ed1f6ec38d procedure: fix verification delay
The verification delay was ignoring all dossiers not closed yet.
2019-03-19 15:51:51 +01:00
simon lehericey
6607de4827 Notification: add service to send notifications 2019-03-18 16:37:51 +01:00
Paul Chavard
bb8ba75d22 Explicitly pass current_administrateur on publish 2019-03-12 11:59:01 +01:00
Paul Chavard
c37f649453 Update specs to use multiple administrateurs 2019-03-12 11:59:01 +01:00
Mathieu Magnin
44f28ec565 Remove feature flag for publish draft 2019-03-12 11:26:07 +01:00
Frederic Merizen
efa71284fc [#3477] Test eager_load_displayed_fields 2019-03-11 17:14:17 +01:00
Frederic Merizen
70bf6aecf6 [#3477] Filter by mutliple values 2019-03-11 17:14:17 +01:00
Frederic Merizen
5d01e37d70 [#3477] Make filters stand out a little more in spec 2019-03-11 17:14:17 +01:00
Frederic Merizen
b428406fc7 [Fix #3578] No tags for champs that cannot have user input anyway 2019-03-11 10:26:27 +01:00
Frederic Merizen
1d0156f9c6 [#3572] Add tests 2019-03-08 18:32:35 +01:00
clemkeirua
71bff0812c ajout d'un test pour caractériser le cas service = null 2019-02-21 12:34:53 +01:00
clemkeirua
236f73f838 ajout d'une balise pour le nom du service 2019-02-21 12:18:44 +01:00
Paul Chavard
84383fc3c1 Assigne admins to procedure.administrateurs 2019-02-20 17:10:57 +01:00
Paul Chavard
a7ba01a02a Fix champ spec
fix #3257
2019-02-20 16:26:12 +01:00
Mathieu Magnin
f7650135f4 [Fix #3375] on the API display safe files only 2019-02-19 18:10:35 +01:00
simon lehericey
0b8619be77 Gestionnaire: login_token! -> create_trusted_device_token 2019-02-18 17:21:46 +01:00
simon lehericey
d664f130fd trustedDeviceToken: move token youth 2019-02-18 17:20:49 +01:00
simon lehericey
23db8a160c move token validity to trusted_device_token 2019-02-18 17:20:49 +01:00
simon lehericey
9d92e43d8d [fix #3315] Migrate service organisme 2019-02-18 16:50:44 +01:00
simon lehericey
a7e068003a [fix #3427] Administration can soft delete a dossier 2019-02-14 18:09:08 +01:00
Frederic Merizen
eb7cd28504 Fix undefined method for nil:NilClass 2019-02-13 19:22:38 +01:00
Frederic Merizen
41ab7246cf [#3424] Improve formatting of addresses with missing components 2019-02-13 09:57:33 +01:00
Paul Chavard
6b39128be3 Clone nested types_de_champ 2019-02-06 10:05:27 +01:00
simon lehericey
5715cdaa4c [fix #3363] use organisation_name in dossier summary 2019-02-05 17:41:51 +01:00
Frederic Merizen
a255e61556 [#3356] Improve formatting for menus that only have a primary value 2019-02-05 17:35:30 +01:00
Frederic Merizen
a3d7c8de55 [Fix #3356] Add tags for primary menu only / secondary menu only 2019-02-05 17:35:30 +01:00
Paul Chavard
071448e1d9 Champ Repetition dossier editor 2019-02-04 16:19:07 +01:00
Frederic Merizen
5e37400834 [#2180] Only retain old PJ API when cloning for same admin 2019-01-17 17:40:40 +01:00
Frederic Merizen
530079e464 [#2180] Make sure that old_pj is kept through successive clones 2019-01-17 17:40:40 +01:00
Frederic Merizen
8cb509d192 [#2180] Keep information that this type de champ was cloned from a PJ 2019-01-17 17:40:40 +01:00
Frederic Merizen
651fd6149b [#2180] When cloning a procedure, convert types de PJ to types de champ PJ 2019-01-17 17:40:40 +01:00
simon lehericey
6ab2d124f9 Dossier: #accepter_automatiquement! 2019-01-16 17:20:12 +01:00
simon lehericey
0f3dedb0b6 Dossier: #passer_automatiquement_en_instruction! 2019-01-16 17:12:32 +01:00
simon lehericey
29fff9ee68 [fix #3269] bufferize login token email 2019-01-10 12:06:35 +01:00
simon lehericey
a197285742 [fix #2612] Admin: add missing steps to admin UI 2019-01-09 16:25:00 +01:00
simon lehericey
8ca7eb1c54 Procedure: cloning set the current admin gestionnaire of the procedure 2019-01-09 16:25:00 +01:00
simon lehericey
f0139c5962 Spec Factory: an administrateur always has a gestionnaire 2019-01-09 13:49:47 +01:00
Paul Chavard
1beefe4469 Fix champ repetition belongs_to associations 2019-01-08 11:56:33 +00:00
gregoirenovel
c00aac2f80 We can now replace processing in #formatted_value by #to_s calls 2019-01-08 12:32:26 +01:00
gregoirenovel
9e42190148 Remove the proxy value_for_export method
Overload for_export instead
2019-01-08 12:32:26 +01:00
gregoirenovel
9a2341c56c Remove the useless #for_display proxy method 2019-01-08 12:32:26 +01:00
simon lehericey
7b935a6486 login_token: lets constantize 2019-01-07 08:18:29 +01:00
simon lehericey
5daa565a80 login_token: add missing tests 2019-01-07 08:18:29 +01:00
gregoirenovel
5fa5f2aa37 Bump development gems
- rubocop (0.61.1 → 0.62.0)
2019-01-05 11:47:55 +01:00
Pierre de La Morinerie
d77530c461 Make Procedure state consistent after switching types de champ order
Fixes an issue where, after clicking the "move champ up" button,
the new form is rendered with an incoherent order.
2019-01-03 15:13:14 +01:00
gregoirenovel
b41764ec03 Remove ChampDecorator 2019-01-03 12:08:25 +01:00
gregoirenovel
186e362701 Enable the Layout/SpaceInsideArrayLiteralBrackets 2019-01-03 10:53:50 +01:00
gregoirenovel
386fbce776 Enable the Layout/SpaceBeforeBlockBraces cop 2019-01-03 10:53:50 +01:00
gregoirenovel
8b0b8162f0 Enable the Layout/SpaceAfterComma cop 2019-01-03 10:53:50 +01:00
Mathieu Magnin
b40c706d98 [Fix #3192] Clone service if procedure is transferred 2018-12-20 15:45:48 +01:00
Paul Chavard
eb9edc1cee Order types de champ in scope 2018-12-20 14:14:15 +01:00
Paul Chavard
5d1c24f3d8 Add type de champ repetition models (with row) 2018-12-19 15:31:11 +01:00
gregoirenovel
df7e0a9881 Remove dead code 2018-12-19 14:59:15 +01:00
Frederic Merizen
57a136c861 Make champ PJ generally available 2018-12-18 11:11:23 +01:00
pedong
f70f276ae9 [fix #2813] set lien_notice nil when clone a procedure 2018-12-06 21:28:08 +01:00
Paul Chavard
35494df78e Procedure export dossiers with champs siret 2018-12-05 17:09:39 +01:00
Pierre de La Morinerie
e206f3d4d4 gestionnaire: display draft procedures in the list
Fix #3088
2018-12-05 15:38:20 +01:00
Pierre de La Morinerie
421f125c45 gestionnaire_spec: factorize a assign helper 2018-12-05 15:38:20 +01:00
Paul Chavard
e873b6a9c4 Expose selection utilisateur size on champ carte 2018-12-03 12:49:03 +01:00
Paul Chavard
d77a5c9f15 More tests and fixes on carte champ 2018-11-30 13:28:30 +01:00
Paul Chavard
ca147969ab Fix number champs validation 2018-11-29 15:12:31 +01:00
Paul Chavard
1883c57c87 Add stable ids to types_de_champ after every update 2018-11-29 11:41:13 +01:00
Paul Chavard
36f6f54337 Remove unused carto models 2018-11-27 16:11:25 +01:00
Paul Chavard
0b017580c5 Expose migrated legacy carto champs on api 2018-11-20 10:53:14 +01:00
Pierre de La Morinerie
b6521625e4 procedure_spec: add missing Timecop.return statement
Fix order-dependant test.
2018-11-14 14:49:41 +01:00
Pierre de La Morinerie
83031b5cdd procedure: compute the usual instruction time only for the last month 2018-11-13 17:23:31 +01:00
Pierre de La Morinerie
b693e055b7 procedure: make usual_instruction_time spec more robust 2018-11-13 17:23:31 +01:00
Pierre de La Morinerie
b1296df4c3 procedure: refactor usual_instruction_time spec 2018-11-13 17:23:31 +01:00
simon lehericey
2613d05a4f An admin has always a gestionnaire role 2018-11-13 10:41:45 +01:00
Pierre de La Morinerie
e59bec51ef procedure: use 90th percentile to estimate the completion delay 2018-11-08 18:29:17 +01:00
Pierre de La Morinerie
5c921182ea procedure: rename mean_instruction_time to usual_instruction_time
Ref #2970
2018-11-08 17:20:06 +01:00
Paul Chavard
33c6ddc452 Remove dead code related to dossier state 2018-11-08 14:56:45 +01:00
Pierre de La Morinerie
d4b2b04875 spec: clear deliveries before every example 2018-11-06 17:26:20 +01:00
simon lehericey
9d406770a8 [fix #2956] YesNo: fixing to_s 2018-11-06 16:59:47 +01:00
Paul Chavard
074050a91a Add IntegerNumberChamp 2018-11-06 11:28:44 +01:00
Paul Chavard
45bfb2fd47 Add DecimalNumberChamp 2018-11-06 11:28:44 +01:00
Paul Chavard
78dc582588 Remove ProcedurePath 2018-10-30 12:01:45 +01:00
Frederic Merizen
aff93ecd6a Simplify test syntax 2018-10-26 17:53:36 +02:00
Frederic Merizen
f6207bee26 Do not take time of day into account when searching dates 2018-10-26 17:53:26 +02:00
simon lehericey
a06f872a4b ProcedurePresentation: rescue big int as a datetime value 2018-10-26 14:39:17 +02:00
simon lehericey
63db387984 ProcedurePresentation: display dossier date in d/m/Y 2018-10-26 10:10:20 +00:00
simon lehericey
3685c65fb7 [fix #2905] fix DATE_TRUNC usage
DATE_TRUNC is played on the db where the timestamp are stored in utc.
So if a user search for 12/12/2012 in Paris timezone and that we truncate it should do something similar to :

SELECT DATE_TRUNC('day', foo.timezone) from (SELECT timestamp '2012-12-12 00:00:00' AT TIME ZONE 'Europe/Paris') as foo;
=> 2012-12-11

To avoid such pb, I suggest avoiding DATE_TRUNC when exact results are needed
2018-10-26 10:10:20 +00:00
simon lehericey
3078b377c7 Time.new => Time.zone.local 2018-10-26 10:10:20 +00:00
simon lehericey
e684cec516 DateTime.new => Time.zone.local 2018-10-26 10:10:20 +00:00
simon lehericey
f620e4aee2 DateTime.parse => Time.zone.parse 2018-10-26 10:10:20 +00:00
simon lehericey
2238e5bd9f Time.now => Time.zone.now 2018-10-26 10:10:20 +00:00
simon lehericey
13ffa61435 DateTime.now => Time.zone.now 2018-10-26 10:10:20 +00:00
Frederic Merizen
64cb231b01 [#2675] Fix notification sort order 2018-10-24 17:10:30 +02:00
Frederic Merizen
14fd60bee7 [Fix #2604] Handle ProcedurePresentations that have gone invalid 2018-10-23 16:41:51 +02:00
Frederic Merizen
7baa239095 [#2604] Introduce errors when retrieving ProcedurePresentation 2018-10-23 16:34:38 +02:00
Frederic Merizen
85f698bc71 [#2604] Clean up GestionnaireSpec 2018-10-23 16:34:31 +02:00
Frederic Merizen
eab8da43fc [#2604] Introduce explicit context in GestionnaireSpec 2018-10-23 16:34:28 +02:00
Frederic Merizen
91cfa69220 [#2604] Clean up AssignTo spec 2018-10-23 16:34:25 +02:00
Frederic Merizen
86f01a9120 [#2604] Factor AssignTo spec 2018-10-23 16:34:22 +02:00
Paul Chavard
c8c75fc254 Better handle empty user selection layers 2018-10-23 09:35:25 +02:00
Paul Chavard
93ef0a02b7 Remove unused lien_demarche from procedure 2018-10-23 09:25:29 +02:00
Frederic Merizen
0dea9f9ece [#2741] Additional test to filtered_ids to be sure 2018-10-17 12:16:51 +02:00
Frederic Merizen
c652cf3ae5 [#2741] Expand unit tests for sorted_ids just to be sure 2018-10-17 12:16:51 +02:00
Frederic Merizen
37fb358bd5 [#2741] Expand unit tests for #get_value just to be sure 2018-10-17 12:16:51 +02:00
Frederic Merizen
a2bd0582b9 [Fix #2741] Filter / sort by en_construction_at 2018-10-17 12:16:51 +02:00
gregoirenovel
baf69acbcb [Fix #2833] Move /support files to /fixtures 2018-10-16 10:47:41 +02:00
gregoirenovel
2a57c093c0 Remove a duplicated cassette 2018-10-15 20:55:46 +02:00
gregoirenovel
1f0af303f3 Remove the unused ModuleApiCarto#classes method 2018-10-15 16:16:16 +02:00
Frederic Merizen
3dca3c7dee [Fix #1961] Check that sorted_ids works for individual 2018-10-11 12:13:03 +02:00
Frederic Merizen
abd066c6f4 [#1961] filtered_ids for individual 2018-10-11 12:13:03 +02:00
Frederic Merizen
34da620b0f [#1961] get_value for individual 2018-10-11 12:13:03 +02:00
Frederic Merizen
5d862ae92b [#1961] Add individual fields 2018-10-11 12:13:03 +02:00
Frederic Merizen
577475f26e [Fix #2580] Filter by created_at / updated_at 2018-10-10 18:18:28 +02:00
gregoirenovel
c8f872c566 InviteUser → Invite 2018-10-10 12:07:10 +02:00
Frederic Merizen
40a5ff0266 [#2750] do parsing of displayed_fields inside ProcedurePresentation
rather than in the view
2018-10-10 09:07:57 +02:00
Frederic Merizen
9fa7a6fd0e [#2750] Move get_value to ProcedurePresentation 2018-10-10 09:07:57 +02:00
Frederic Merizen
fc157c3e4c [#2750] Move sorted_ids to ProcedurePresentation 2018-10-10 09:07:57 +02:00
Frederic Merizen
2e9dafb4c3 [#2750] Move filtered_ids to ProcedurePresentation 2018-10-10 09:07:57 +02:00
Frederic Merizen
0e9b40ccf6 [#2750] Move fields from Procedure to ProcedurePresentation 2018-10-10 09:07:57 +02:00
Frederic Merizen
efcac5192a [#2750] Move fields_for_select to ProcedurePresentation 2018-10-10 09:07:57 +02:00
simon lehericey
87e731bc75 Dossier: move state translation to model dossier 2018-10-08 17:55:20 +02:00
Frederic Merizen
33f29f35ab Avoid recreating service too often 2018-10-04 18:09:39 +02:00
gregoirenovel
12f0c99b5a Remove FC fields from instructeur table customisation 2018-10-04 13:54:07 +02:00
gregoirenovel
5107b33af8 Remove FC fields from search 2018-10-04 13:54:07 +02:00
Frederic Merizen
b36d153620 Fix missing sort columns 2018-10-03 17:09:49 +02:00
gregoirenovel
7e4268db67 Enable Style/TrailingCommaInArguments 2018-10-03 12:03:21 +02:00
gregoirenovel
6eeba14885 Enable Style/WordArray 2018-10-03 12:03:21 +02:00
Frederic Merizen
8bb08a1b8b [#2579] Validate columns on ProcedurePresentation model 2018-10-03 10:17:46 +02:00
Pierre de La Morinerie
0526551e71 templates: update link to dossier 2018-09-27 17:22:59 +02:00
simon lehericey
6725c5e34c Procedure: add test on mean_instruction_time 2018-09-27 15:02:38 +02:00
simon lehericey
88f7e888c3 Administrateur: do not save api_token in clear text anymore 2018-09-27 10:24:56 +02:00
simon lehericey
8c4f8347ca Api Token: store token in an encrypted form 2018-09-27 10:14:32 +02:00
simon lehericey
1997f45d7e Api Token: do not generate one token by default 2018-09-27 10:14:32 +02:00
Mathieu Magnin
499021588d [Fix #1285] Password strength is ensured when saving an administrateur 2018-09-26 09:03:03 +02:00
Frederic Merizen
998754ab73 [Fix #2258] Validate options for linked dropdown menus 2018-09-25 20:32:19 +02:00
Frederic Merizen
3fea14c07d [#2258] Let dynamic type validate the type de champ 2018-09-25 20:31:34 +02:00
Frederic Merizen
9beaa293cd [#1421] Use delegation rather than STI for TypeDeChamp 2018-09-25 08:26:56 +02:00
Frederic Merizen
112fdb71fb [#2613] Remove dead code 2018-09-24 20:19:26 +02:00
Frederic Merizen
7d382837d9 [Fix #2622] Change filters to proper JSONB 2018-09-24 19:39:01 +02:00
Frederic Merizen
1419e9b73f [#2622] Change sort to proper JSONB 2018-09-24 19:39:01 +02:00
Frederic Merizen
68608307ad [#2622] Change displayed_fields to proper JSONB 2018-09-24 19:39:01 +02:00
Frederic Merizen
43d8db88d9 [#1946] Check if a dossier’s retention period has expired 2018-09-20 17:44:31 +02:00