Commit graph

988 commits

Author SHA1 Message Date
Christophe Robillard
2a0ebd062a enable 2FA for manager
when trying to access manager, if superadmin did'nt enable otp, he/she is redirected to a page to enable 2FA. When superadmin is enabling 2FA, he has to to scan a qrcode with the 2FA application client. And afterwards, the superadmin has to log in with email, password and OTP code.
2020-11-05 16:03:55 +01:00
clemkeirua
89316c0689 fix counter for dossiers suivis/à suivre when unfollow 2020-10-28 13:51:35 +00:00
clemkeirua
b4910c557d ajout de procedure.dossiers_count_for_instructeur 2020-10-28 13:51:35 +00:00
Paul Chavard
7c58f06c60 always validate geometries returned from api 2020-10-08 16:03:28 +02:00
Paul Chavard
59086cc728 Fix geo length computations 2020-10-01 15:09:38 +02:00
Paul Chavard
4dfc1c719f Fix geo areas computations 2020-10-01 15:09:38 +02:00
Paul Chavard
1bd59c72e5 Include in exports types_de_champ from all revisions 2020-09-30 13:42:38 +02:00
clemkeirua
f3e487bd9e replace filter+first with find 2020-09-25 12:53:11 +00:00
clemkeirua
eb46cc6425 piecejusticative file validation focus on size 2020-09-25 09:35:16 +00:00
clemkeirua
c155de1d7e ajout de la liste des extensions 2020-09-25 09:35:16 +00:00
clemkeirua
31d48c2879 validation is enableed only for 'new' procedures 2020-09-25 09:35:16 +00:00
clemkeirua
8711e8f911 reenable validator on piece_justificative 2020-09-25 09:35:16 +00:00
Paul Chavard
26a6e18cb9 Do not crash when rgeo can’t calculate polygon area
example are “hourglass” shaped polygons
2020-09-23 16:52:08 +02:00
Paul Chavard
61c315b276 Fix geo area point coordinates display 2020-09-23 16:52:08 +02:00
kara Diaby
cb4e91c405 Add iban type de champ 2020-09-23 15:56:26 +02:00
Paul Chavard
973973ab6a Do not enqueue web hooks for empty urls 2020-09-22 17:03:19 +02:00
Paul Chavard
a3f3b8a8e0 procedure.dossiers through revisions 2020-09-22 10:55:17 +02:00
clemkeirua
f96377d878 refactor Dossier#with_notifications 2020-09-21 08:28:42 +00:00
clemkeirua
d01a53eb72 remove :cached_notifications gate 2020-09-21 08:28:42 +00:00
clemkeirua
d8b4cc67be add a test scenario for users 2020-09-18 11:16:34 +02:00
clemkeirua
1e32a3c11f add complexity check to admin account creation 2020-09-18 11:16:34 +02:00
clemkeirua
5a8fbde0e7 remove dead code in admin model 2020-09-18 11:16:34 +02:00
clemkeirua
de3118bc7b force password reset on admin promotion or creation 2020-09-17 16:39:13 +02:00
clemkeirua
0307beecd6 Revert "Merge pull request #5576 from tchak/soft-delete-users"
This reverts commit bf0d3914ce, reversing
changes made to 503527459e.
2020-09-17 15:39:16 +02:00
Paul Chavard
a0dd3604a4 User discard_and_anonymize! 2020-09-17 11:16:56 +02:00
simon lehericey
e4de522b48 only retrieve id of procedures with notifications 2020-09-11 09:43:04 +00:00
clemkeirua
a62907f33b add more tests for phone numbers 2020-09-09 09:00:03 +02:00
clemkeirua
c7b96d3d43 add feature-flip for instructeurs on cached notifications 2020-09-08 15:40:42 +00:00
clemkeirua
52ea5ef89a make Dossier#with_notifications great again
Co-authored-by: Christophe Robillard <christophe.robillard@beta.gouv.fr>
2020-09-08 15:40:42 +00:00
clemkeirua
61cf33e3ca remove duplicate private champ 2020-09-04 15:40:23 +02:00
kara Diaby
ae61c279af migrate emails text editor to new interface 2020-09-03 14:42:22 +02:00
Paul Chavard
1488e0964b update models specs to use revisions 2020-09-02 11:26:26 +02:00
Judith
25a24ba7c8 removal of translation keys already present in the gem rails-i18n 2020-09-01 16:33:58 +02:00
Christophe Robillard
090a247ba9 validates phone champ server side 2020-08-20 15:33:03 +02:00
Christophe Robillard
f77cc06a91 prend en compte le nom de l'enseigne pour l'établissement 2020-08-20 14:23:02 +02:00
Pierre de La Morinerie
a7361fdbd3 models: require belong_to associations on mail templates 2020-08-18 15:57:37 +02:00
Pierre de La Morinerie
5a7bd24fba models: require belong_to associations on type_de_champ
- Make `type_de_champ.procedure` a requirement;
- Move the procedure_id assignation to `before_validation` (otherwise
the record is invalid, and never gets saved);
2020-08-18 15:57:37 +02:00
Pierre de La Morinerie
6328011f60 models: require belong_to associations on champ
- Make `champ.dossier` a requirement;
- Move the dossier_id assignation to `before_validation` (otherwise
the record is invalid, and never gets saved);
- Allow specs to only build the champ (instead of saving it to the
database), which bypasses the requirement to have a dossier.
2020-08-18 15:57:37 +02:00
Pierre de La Morinerie
71d9774d58 models: require belong_to associations on trusted_device_token 2020-08-18 15:57:37 +02:00
Pierre de La Morinerie
ce53e219e0 models: require belong_to associations on procedure_presentation
Some tests are still failing
2020-08-18 15:57:37 +02:00
Pierre de La Morinerie
fe8804f208 models: require belong_to associations on individual 2020-08-18 15:57:37 +02:00
Pierre de La Morinerie
afb1c33154 models: require belong_to associations on geo_area 2020-08-18 15:57:37 +02:00
Pierre de La Morinerie
32e55a6d37 models: require belong_to associations on avis 2020-08-18 15:57:36 +02:00
Pierre de La Morinerie
aefdd5d2a1 models: require belong_to associations on attestation_template 2020-08-18 15:57:36 +02:00
Pierre de La Morinerie
c1e2928ce7 models: require belong_to associations on assign_to 2020-08-18 15:57:36 +02:00
Pierre de La Morinerie
8962db38cc models: render attestations in a simpler way
The older method of instanciating an entire new rendering stack can be
made simpler using Rails >= 5.0 methods.

See https://api.rubyonrails.org/classes/ActionController/Renderer.html#method-i-render
2020-08-04 16:53:46 +02:00
Paul Chavard
1fca481c6e Cleanup after clone 2020-07-28 17:04:06 +02:00
clemkeirua
c91e231347 spec: replace reference to ds in password 2020-07-23 16:20:16 +02:00
Paul Chavard
a08e318617 Add implicit_order_column on revisions 2020-07-22 12:25:06 +02:00
Paul Chavard
69ab2e44fb Insert type_de_champ with correct initial position 2020-07-22 11:09:51 +02:00
Paul Chavard
58535c6a35 Add procedure revisions spec 2020-07-21 19:35:30 +02:00
Paul Chavard
0338080430 Remove unused procedure move type_de_champ code 2020-07-21 19:35:30 +02:00
Paul Chavard
d18a9c8162 Migrate procedures “on demand” 2020-07-21 19:35:30 +02:00
Paul Chavard
0a0912503b Add type_de_champ mutation methods to revision 2020-07-21 19:35:30 +02:00
Christophe Robillard
52e8f32e19 expert can only revoke avis claimed by him/her 2020-07-16 21:07:20 +02:00
Christophe Robillard
3ea34834a7 revoke expert avis 2020-07-16 21:05:11 +02:00
Paul Chavard
b628169053 Remove unsused drop_down_list model 2020-07-16 15:29:01 +02:00
clemkeirua
8a2aa13b74 remove pending tests 2020-07-15 09:27:23 +00:00
clemkeirua
299c86141c added before_save to PieceJustificativeChamp in order to set skip_pj_validation 2020-07-15 09:00:12 +00:00
kara Diaby
ba6b89743c put pending testsz 2020-07-13 12:24:48 +02:00
Paul Chavard
cb8cac395b fix spec name 2020-07-08 19:28:17 +02:00
Paul Chavard
3b9e6dba25 Update spec/models/type_de_champ_shared_example.rb
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2020-07-08 19:28:17 +02:00
Paul Chavard
84ff75ed6b Update spec/models/type_de_champ_shared_example.rb
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2020-07-08 19:28:17 +02:00
Paul Chavard
a92320e246 Update spec/models/type_de_champ_shared_example.rb
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2020-07-08 19:28:17 +02:00
Paul Chavard
d8e864a7d9 Update spec/models/type_de_champ_shared_example.rb
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2020-07-08 19:28:17 +02:00
Paul Chavard
660c95356b Update spec/models/type_de_champ_shared_example.rb
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2020-07-08 19:28:17 +02:00
Paul Chavard
a74e52c828 Call remove_drop_down_list on before_save 2020-07-08 19:25:05 +02:00
Paul Chavard
3c9cc6c070 Remove repetition types_de_champ on type_champ change 2020-07-08 19:25:05 +02:00
Christophe Robillard
2c56511204 validate api_entreprise_token 2020-07-08 18:59:22 +02:00
Christophe Robillard
7fd4d46e8e remove empty spec file 2020-07-08 18:15:15 +02:00
Christophe Robillard
1253bb5994 store instructeur_email in traitement 2020-07-08 18:15:15 +02:00
Christophe Robillard
0be4b50ade update usual_traitement_time with traitement model 2020-07-08 18:15:15 +02:00
Christophe Robillard
a072d35211 use traitement model
when a dossier is terminated (accepte, refuse or classe_sans_suite),
we store now `processed_at` and `motivation` in a traitement instance
2020-07-08 18:15:15 +02:00
Christophe Robillard
f631acd118 update state date in aasm after callbacks
call aasm event methods, not state methods directly
2020-07-08 18:15:15 +02:00
Paul Chavard
c9ab80c880 WIP 2020-07-07 18:03:56 +02:00
Paul Chavard
13c21d89af Fix attestation_template spec 2020-07-07 18:03:56 +02:00
Paul Chavard
6a24c3f812 Rails app:update 2020-07-07 18:03:56 +02:00
Pierre de La Morinerie
060bf1f9ca factories: flesh out the default etablissement for a dossier 2020-07-06 11:41:25 +02:00
Pierre de La Morinerie
43569f687e specs: use fixture_file_upload rather than Rack::Test::UploadedFile
This is mostly for consistency (both styles were used before).

Note: we still have to use `Rack::Test::UploadedFile.new` in factories,
because of https://github.com/thoughtbot/factory_bot/issues/385.
2020-07-01 11:13:45 +02:00
Paul Chavard
97f91513c8 Store drop_down_list values as jsonb 2020-06-25 13:14:17 +02:00
Judith
9be58aa012 only downcasing search values for yes_no type_de_champs 2020-06-10 15:55:25 +02:00
Judith
ad53dfa84d Instructeurs: Changed the filters from 'true/false' to 'oui/non' for yes_no type_de_champ 2020-06-10 15:50:41 +02:00
Paul Chavard
901b6e23a8 Remove legacy carto 2020-06-04 16:03:23 +02:00
Christophe Robillard
cf9d6ccf34 export bilans in ods and xlsx 2020-06-04 15:31:16 +02:00
Christophe Robillard
d06867822b reorder bilans bdf csv 2020-06-03 15:45:11 +02:00
Paul Chavard
20705d6e30 Do not send draft norifications to users on inactive démarches 2020-05-27 16:36:46 +02:00
clemkeirua
77101208a4 Anonymisation de l'instructeur dans la messagerie 2020-05-18 12:56:30 +00:00
Pierre de La Morinerie
190548844a dossiers: add piece justificative filename to spreadsheet export 2020-05-14 10:18:10 +00:00
Paul Chavard
dfc004d7bb Unarchive dossier when repasser_en_instruction 2020-05-12 19:05:18 +02:00
Christophe Robillard
f587e6600a extract class ApiEntrepriseToken
and check if token is expired
2020-05-06 10:57:45 +02:00
Paul Chavard
6556df2a85 Fix a crash in case of invalid geometry 2020-05-05 15:56:05 +02:00
Christophe Robillard
9de2c7c85a improve csv generation for bilans bdf 2020-04-30 16:15:16 +02:00
Paul Chavard
843e033c38 Allow instructeurs to download a GeoJSON document for a given dossier 2020-04-30 15:49:43 +02:00
Christophe Robillard
ddd3e6bb02 don't copy api_entreprise_token when cloning
except for an admin who owns the parent procedure
2020-04-29 17:17:20 +02:00
Paul Chavard
9cb612bb3d Show area and length on champ carto selections utilisateur 2020-04-23 10:21:18 +02:00
Pierre de La Morinerie
1cb18e51ac champ: return the parent dossier even when discarded
Dossier has a `default_scope { kept }`.

Because of that, when the parent dossier is discarded, `champ.dossier`
will return nil.

We should kill the default scope. But meanwhile, ensure that
`champ.dossier` returns even a discarded dossier.
2020-04-22 11:46:42 +02:00
Paul Chavard
e512870fd2 Cleanup procedure duree_conservation_dossiers_dans_ds validations 2020-04-16 19:40:19 +02:00
Paul Chavard
bc8217e030 Carte Editor sends FeatureCollection to the server 2020-04-16 18:29:19 +02:00
Paul Chavard
22604013d0 Expose multiple user selections on champ carte 2020-04-15 18:07:09 +02:00
clemkeirua
8c2f589cbf fix admin deletion of empty service with archived procedures 2020-04-10 20:01:40 +02:00