Commit graph

2791 commits

Author SHA1 Message Date
Damien Le Thiec
2533ca50d4 Merge branch 'main' into feature/prefill_repetible 2023-02-15 11:07:56 +01:00
sebastiencarceles
6f65a4c2fe 🚨 line length 2023-02-14 13:49:41 +01:00
sebastiencarceles
681e1cf518 ♻️ refactor possible_values impl for clarity 2023-02-14 13:45:30 +01:00
sebastiencarceles
a07446da6c ♻️ rename method for clarity 2023-02-14 11:45:39 +01:00
sebastiencarceles
0159a10969 🐛 make possible_values_list method public 2023-02-14 11:41:35 +01:00
sebastiencarceles
a77a0e2c7f ⚰️ dead code is dead 2023-02-14 11:35:35 +01:00
sebastiencarceles
67ef3a16fa review: put example values in translation yamls 2023-02-14 09:23:52 +01:00
Sébastien Carceles
12abf9045b add external_id and value validation 2023-02-14 09:23:11 +01:00
Sébastien Carceles
a235829ddd add possible and example values 2023-02-14 09:19:55 +01:00
Sébastien Carceles
cd3a72ddce make departements champ prefillable 2023-02-14 09:19:19 +01:00
mfo
76ef4ae96e
Merge pull request #8613 from colinux/email-template-subject-length
Email: limite le sujet généré à 100 caractères et utilise le sujet par défaut si le modèle est vide
2023-02-13 17:31:04 +01:00
Damien Le Thiec
899c8a6589 Add documentation json parse rescue repetition 2023-02-13 14:17:53 +01:00
Sébastien Carceles
1a72b80f8f
fix: "remove" a champ to prefill (#8612)
* fix: "remove" a champ to prefill

Removing a champ to prefill on /preremplir used to fail, because of a
collusion (having the same form multiple times on un page looks like a
bad idea, when it comes to multiple input fields).

* fix specs
2023-02-13 08:17:22 +00:00
Damien Le Thiec
ea126612a1 Refacto to_assignable_attributes for prefill_repetition 2023-02-12 13:02:30 +01:00
Damien Le Thiec
fc94aaaa21 Use "to_assignable_attributes" 2023-02-12 11:55:28 +01:00
Damien Le Thiec
4a6841c009 Fix linter 2023-02-11 22:51:37 +01:00
Damien Le Thiec
dbb92e7fd3 Merge branch 'main' into feature/prefill_repetible 2023-02-11 22:40:56 +01:00
Damien Le Thiec
2a3ba28343 Fix tests possible value prefill 2023-02-11 22:27:16 +01:00
Damien Le Thiec
a4d707f942 Improve format prefill possible_values (tests missing) 2023-02-09 18:08:51 +01:00
Colin Darie
aeb602a63d fix(mail): default subject fallback when subject template is empty
Closes #8448
2023-02-09 17:49:43 +01:00
Damien Le Thiec
4b0e6ea382
Convert datetime field to datetime_local (#8572)
* Convert datetime field to datetime_local

* Fix tests

* Add value formatting view datetime component

* Add helper datetime component value
2023-02-09 15:18:38 +01:00
Colin Darie
e626eb69ce feat(admin): import groupe instructeurs csv when procedure is closed 2023-02-09 11:17:13 +01:00
Colin Darie
a4329b6699 chore(export/job): set procedure_id for sentry 2023-02-09 11:06:54 +01:00
Damien Le Thiec
c5f1f80d25 Add prefill params tests repetition 2023-02-08 17:38:51 +01:00
Paul Chavard
1693e46acb fix(dossier): prevent crash when updating champs in rebase 2023-02-08 14:56:26 +01:00
Colin Darie
0958053c72 chore(dossier): can destroy dossier having dossier_batch_operations
Ça peut arriver lors des démarches en test, avec des dossiers tests
en cours d'instruction.
2023-02-08 14:42:14 +01:00
Paul Chavard
dc9a455d22 fix(dossier): prevent crash in rebase 2023-02-08 11:11:14 +01:00
Kara Diaby
984ef67827 Prend en compte uniquement les procédures publiées dans les propositions de tags 2023-02-06 17:03:51 +01:00
Paul Chavard
6924b8e46d feat(dossier): optional repetition champ should not add first row 2023-02-06 11:53:32 +01:00
Martin
f4cc8078b4 amelioration(EmailEvent): purge les email_events vieux de plus de un mois
Update app/models/email_event.rb

Co-authored-by: Colin Darie <colin@darie.eu>

Update app/jobs/cron/purge_old_email_event_job.rb

Co-authored-by: Colin Darie <colin@darie.eu>
2023-02-06 10:35:57 +01:00
Martin
6a25120f80 amelioration(dolist_api): echoue avec un fail pour remonter dans notre gestion des retry 2023-02-03 17:19:36 +01:00
Martin
2de9026c13 amelioration(dolist_api): forward le message_id afin de faciliter les investigations 2023-02-03 17:19:36 +01:00
Damien Le Thiec
63e7c17fda First tests for prefill repetition 2023-02-03 12:14:18 +01:00
Paul Chavard
2971100081 fix(dossier): do not try to rebase if procedure is not published 2023-02-02 10:11:46 +01:00
Lisa Durand
3a82558c3f use super instead of run_at 2023-02-01 17:06:04 +01:00
Lisa Durand
120fbb0ef7 Overload the finished_at 2023-02-01 17:06:04 +01:00
Lisa Durand
d0a131dc55 change the way we set the finished_at on batch operation job to fix alert display bug 2023-02-01 17:06:04 +01:00
Damien Le Thiec
e7c78321d9 Fix new failing tests 2023-02-01 13:35:32 +01:00
Colin Darie
eb9cd90ee8 chore(schema): +procedure#estimated_duration_visible 2023-02-01 11:02:55 +01:00
Paul Chavard
9c83939431 fix(dossier): fix adding repetition in a new revision 2023-02-01 10:36:46 +01:00
Eric Leroy-Terquem
b306dea5cf refactor(avis): rename revive by remind 2023-02-01 09:55:46 +01:00
Eric Leroy-Terquem
004bf5be38 feat(avis): add remind_by! method 2023-02-01 09:55:46 +01:00
Damien Le Thiec
5a7b740f58 Clean rubocop alerts 2023-01-31 17:06:00 +01:00
Damien Le Thiec
4a07fd6223 Merge branch 'main' into feature/prefill_repetible 2023-01-31 16:49:40 +01:00
Damien Le Thiec
e1748a2666 Fix "see more" link for prefillable fields 2023-01-31 16:48:38 +01:00
Damien Le Thiec
d7b01255fe Merge branch 'main' into feature/prefill_repetible 2023-01-31 16:39:00 +01:00
Martin
2edfcdd652 correctif(liens.invitations): utilise le mapping rails as: :target_model, sinon on requete uniquement par l'id du model, qui peut etre problématique en cas de relation polymorphiques avec des ensembles d'id se superposant 2023-01-31 16:33:31 +01:00
Damien Le Thiec
f91cc05d95 Small fix link to prefill type de champ 2023-01-31 16:24:32 +01:00
Damien Le Thiec
20ba96ba3c POST working with prefill query example for repeating fields 2023-01-31 14:54:23 +01:00
Martin
88553eec9b correctif(dossier_transfer): le transfer de dossier vers un email contenant des majuscule ne fonctionnait pas 2023-01-31 14:52:57 +01:00
Colin Darie
5cddb1c74e fix(procedure_presentation): options groupe_instructeur for that procedure only 2023-01-31 13:55:06 +01:00
Paul Chavard
dcbe16603a fix(dossier): fix parser with dashes 2023-01-31 10:40:48 +01:00
Paul Chavard
ca05fb753b fix(only_present_on_draft?): broken when type_de_champ is removed from later revisions 2023-01-31 09:26:50 +01:00
Martin
dbe64cf0c8 correctif(date_champ): renforce la validation avec le parsing de la date plutot qu'une approche par regexp 2023-01-30 13:01:24 +01:00
Paul Chavard
6cacfbdf32 refactor(dossier): refactor rebase 2023-01-30 12:01:11 +01:00
Paul Chavard
2f4e85f163 fix(dossier): set rebased_at only on changed champs 2023-01-30 12:01:11 +01:00
Paul Chavard
626b28ca16 perf(tags parser): improuve parser perf 2023-01-30 11:52:35 +01:00
Eric Leroy-Terquem
1b67f93c66 feat(avis): add reminded_at field to avis 2023-01-30 11:13:23 +01:00
Paul Chavard
298721f90d fix(dossier): fix clone with data 2023-01-30 10:58:26 +01:00
Damien Le Thiec
81df033282 First draft repeatable 2023-01-26 17:57:57 +01:00
Colin Darie
923ee59e92 refactor(instructeurs/perf): don't load anymore geo areas for each champ because of header
Economise 1 requête par champ sur chaque page instructeur d'un dossier
à cause du header juste pour savoir s'il faut afficher
le bouton d'export GeoJSON.
2023-01-26 14:57:45 +01:00
Paul Chavard
508cdec33f fix(morph): ids should not start with numbers 2023-01-26 10:42:22 +01:00
Colin Darie
51c1736d00 refactor(conditional): extract in a ChampConditionalConcern with tests 2023-01-26 09:06:30 +01:00
Colin Darie
7c13449b4f feat(conditional): show loader during autosave when other champs are dependent of it 2023-01-26 09:06:30 +01:00
Colin Darie
81f00774af feat(logic): operators sources 2023-01-26 09:06:30 +01:00
Kara Diaby
b18d76dff6 Ne prend pas en compte les tags sur les démarches en brouillon 2023-01-24 14:53:27 +01:00
Sébastien Carceles
49ce255e29
feat(dossier): prefill region champ (#8442)
* make regions champ prefillable

* add possible and example value

* add external_id and value validation
2023-01-24 11:25:17 +00:00
mfo
84a667b8bd
Merge pull request #8454 from tchak/feat-epci
feat(types de champ): add EPCI champ
2023-01-23 16:56:18 +01:00
Sébastien Carceles
92c769de4f
fix(prefill): code pays display (#8477)
* show translated text AND possible values

* show less possible values

* show countries possible values
2023-01-23 14:08:20 +00:00
Paul Chavard
a4cbbe721e feat(types de champ): add EPCI champ 2023-01-20 11:32:36 +01:00
Paul Chavard
f38ee8f03f feat(dossier): implement refresh_after_update on champs 2023-01-20 11:05:25 +01:00
Sébastien Carceles
0046338e6a
fix(prefill): don't mark the dossier as prefilled when it's not (#8464)
A dossier should not be marked as prefilled when it's not, meaning
when no prefill params are given.
2023-01-19 10:51:56 +00:00
Colin Darie
428dd9bf1a fix(dossier): we can't terminer any dossier having etablissements in degraded mode
Closes #8449
2023-01-18 19:23:25 +01:00
Kara Diaby
eac5a42a32 model 2023-01-18 18:46:42 +01:00
Damien Le Thiec
3a8a50a216
Allow prefill pays type de champs (#8344)
* Allow prefill pays type de champs

* Avoid conditional prefil params for pays champ

* Clean pays data with batch update

* Fix bug and add test batch update pays value

* Improve performance batch_update_pays

* Fix associated country code problem

* Fix after party task name

* Format country name if needed in batch update
2023-01-18 12:52:38 +01:00
Colin Darie
784b0458fe feat(dolist): consolidate dispatched events with delivered emails 2023-01-18 09:56:40 +01:00
Sébastien Carceles
5c7b2ba1f3
feat(dossier): prefill drop down list champ (#8361)
* feat(dossier): prefill drop down list champ

* decorate the types de champ to avoid if / else

In order to avoid doing if this a drop down ? / else at several places,
we decorate the types de champ and let the decorator give the possible
and example values.

* show all possible values when there are too many

* allow to prefill 'other' option

* review: remove duplicate

* review: refactor for readability

* validate that value is in options

* review: exclude disabled options
2023-01-18 09:47:22 +01:00
Colin Darie
ef3546e9f1 fix(email-event): apparently mail subject could be null 2023-01-17 16:46:54 +01:00
Colin Darie
13479fc88e
fix(admin): display of procedure admins count 2023-01-17 16:02:08 +01:00
Paul Chavard
dad393355b chore(db): remove unused columns 2023-01-17 12:49:22 +01:00
Paul Chavard
44488c7014 feat(dossier): use select in filters bygroupe instructeur 2023-01-16 14:00:08 +01:00
Lisa Durand
06c6a4ab0c add action 'unfollow' to page 'suivis' 2023-01-16 11:14:29 +01:00
Lisa Durand
2f666b487e add action 'repasser en construction' to page 'suivis' 2023-01-16 11:14:29 +01:00
Damien Le Thiec
5e26acb0e1
Make date and datetime prefillable (#8304)
* Make date and datetime prefillable

* Format in ISO8601 format
2023-01-12 17:42:02 +01:00
Paul Chavard
5641c2b078 fix(groupe_instructeur): only show to administrators the number of visible files 2023-01-11 21:49:08 +01:00
Martin
822eda7c42 correctif(safe_mailer): fix bug sur de la synthax 2023-01-11 20:29:51 +01:00
Martin
3e6b82ed9e amelioration(safe_mailer): ajoute au manager la fonction pour configurer le routage des mails sur un fournisseur unique
Update app/mailers/devise_user_mailer.rb

Co-authored-by: LeSim <mail@simon.lehericey.net>
2023-01-11 17:32:24 +01:00
Martin
2f43ffc940 data(safe_mailer): ajout d'un object permetant d'orienter les mails vers un unique fournisseur au cas ou l'autre soit down 2023-01-11 17:13:05 +01:00
simon lehericey
528b2c2b88 fix(procedure): valid juridique on create and publication 2023-01-11 14:05:17 +01:00
simon lehericey
bd3fbbce49 add schema and annotation 2023-01-11 11:19:24 +01:00
Paul Chavard
afc1f12028 feat(graphql): implement add/remove instructeurs via API 2023-01-10 20:33:35 +01:00
Paul Chavard
af33d5d65c refactor(repetition): use row_id instead of row 2023-01-10 19:31:41 +01:00
Colin Darie
d58e6a2f9c refactor(email): remove pseudonymization, it will be done at dump-time 2023-01-10 16:07:35 +01:00
Colin Darie
5ae5de0d9c refactor(email): log event when error occurs before recipients was set 2023-01-10 16:07:35 +01:00
Colin Darie
0a22c1d2f0 chore(email): log smtp errors 2023-01-10 16:07:35 +01:00
Colin Darie
6cb2389eef chore(email): add an observer which log the emails dispatched 2023-01-10 16:07:35 +01:00
Colin Darie
07167cead9 chore(schema): create email_events 2023-01-10 16:07:35 +01:00
Colin Darie
0a890acc33 fix(conditional): huge perf improvement by caching champ visibility
Hyper nécessaire lorsqu'il y a des champs qui dépendent d'autres champs
en cascade.

Co-authored-by: simon lehericey <mail@simon.lehericey.net>
Co-authored-by: mfo <martin@sharypic.com>
2023-01-10 11:41:08 +01:00
Paul Chavard
5128b9a086 refactor(demarches): use turbo_stream template 2023-01-10 09:48:32 +01:00
Lisa Durand
67c104c8eb affiner le scope 2023-01-09 11:58:51 +01:00
Lisa Durand
25a7fa5a34 add bulk action 'follow' 2023-01-09 11:58:51 +01:00
Paul Chavard
5a4cefc5c5 fix(dossier): fix rebase with drop down options 2023-01-06 14:15:46 +01:00
Sébastien Carceles
06b8a0f734
feat(dossier): prefill boolean champs (#8381) 2023-01-06 14:01:59 +01:00
Paul Chavard
dfe65136be refactor(repetition): add row_id to champs 2023-01-05 18:04:54 +01:00
Paul Chavard
940f8c0474 fix(graphql): fix departements with alphanumeric codes 2023-01-05 17:33:03 +01:00
Lisa Durand
4afb873afc feedbacks from Martin 2023-01-05 16:20:18 +01:00
Lisa Durand
59468fe351 add justificatif_motivation field to batch operation accepter 2023-01-05 16:20:18 +01:00
Lisa Durand
1bc0609543 add motivation field to batch operation accepter 2023-01-05 16:20:18 +01:00
Lisa Durand
d7ebb67889 implement first step - accepte without motivation and PJ 2023-01-05 16:20:18 +01:00
Paul Chavard
378f3c5fb0 use join table instead of arrays 2023-01-05 16:20:18 +01:00
Paul Chavard
26e02c7173 fix(template): trix will transform double spaces in &nbsp; 2023-01-05 13:23:24 +01:00
Sébastien Carceles
fa6fc077b4
normalize boolean values (#8320)
* extract parent for yes no and checkbox champs

* checkbox stores true / false instead of on / off

* normalize blank value to nil

* normalize invalid value to false

* after party task: normalize checkbox values

* after party task: normalize yes_no values
2023-01-05 11:18:27 +00:00
Paul Chavard
c4a30084fe refactor(virus_scan): remove lock 2023-01-04 12:12:11 +01:00
Paul Chavard
6e18090fb3 refactor(virus_scan_result): use column instead of metadata on blob 2023-01-04 12:12:11 +01:00
Paul Chavard
d469bca0ae refactor(watermark): use column instead of metadata on blob 2023-01-04 12:07:08 +01:00
Sébastien Carceles
456be420fa
feat(demarche): describe dossier prefilling with POST (#8298)
* feat(demarche): describe dossier prefilling with POST

* show response example
2023-01-04 07:31:31 +00:00
Martin
76301d4c32 correctif(api_entreprise_token): les nouveaux tokens stockent les roles dans sous la clé scopes et non plus roles 2023-01-03 15:32:50 +01: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
mfo
1f5db1faf2
Merge pull request #8340 from mfo/US/fix-champs-pays
sentry(3830513995): champs pays peut avoir un external_id a '', test la presence d'external_id sinon on peut renvoyer du nil via Champs::PaysChamp.name
2022-12-28 09:51:18 +01:00
Martin
a2d3ec7a21 sentry(3830513995): champs pays peut avoir un external_id a '', test la presence d'external_id sinon on peut renvoyer du nil via Champs::PaysChamp.name 2022-12-27 16:28:34 +01:00
mfo
31735e16d8
Merge pull request #8339 from mfo/US/fix-departement-champs
Us/fix departement champs
2022-12-27 16:01:35 +01:00
Martin
186d4e6539 correctif(ChampDepartement): gere les departement a 3 codes 2022-12-27 14:55:57 +01:00
Paul Chavard
9b3fa4dd3c refactor(revision): changes should be domain objects 2022-12-27 10:58:53 +00:00
Martin
48c80e9387 correctif(api/v1): ajoute la methode manquante for_api sur le type de champs departement 2022-12-27 11:45:43 +01:00
Martin
3732c079a7 correctif(champ.normalize): enleve les null chars uniquement si il y en a. sinon on rappel value=() avec nos champs surchargeant ce setter 2022-12-27 11:43:34 +01:00
Paul Chavard
0b10c73bcf feat(prefill): allow to prefill private annotations 2022-12-26 22:14:17 +00:00
Paul Chavard
4a4ce67ef6 fix(dossier): explicitly send draft notification email 2022-12-26 22:02:33 +00:00
Damien Le Thiec
9e083ea3f7
Merge branch 'main' into feature/prefill_civility 2022-12-26 11:31:52 +01:00
mfo
62813f3d74
Merge pull request #8323 from tchak/fix-graphql-champs
feat(graphql): add pays champ to API
2022-12-22 13:51:02 +01:00
mfo
e3bf0d8fec
Merge pull request #8327 from tchak/feat-rebase-after-repasser-en-instruction
feat(dossier): rebase after repasser en instruction
2022-12-22 13:50:43 +01:00
Paul Chavard
f4f38982b4 feat(dossier): rebase after repasser en instruction 2022-12-22 13:44:03 +01:00
Paul Chavard
6363206c44 fix(dossier): when rebase creates a champ always push in to champs 2022-12-22 13:44:03 +01:00
Paul Chavard
4c516a6991 feat(dossier): allow to rebase champs with value made mandatory 2022-12-22 13:08:04 +01:00
Paul Chavard
072156d38e feat(graphql): add pays champ to API 2022-12-22 11:56:45 +01:00
Paul Chavard
bd9fe7eb7c feat(export): add pays, region and departement codes 2022-12-21 14:03:02 +01:00
Paul Chavard
3f0f5e381f refactor(regions): champ regions to use simple select 2022-12-21 14:03:02 +01:00
Paul Chavard
e0b0a42bc3 refactor(departements): champ departements to use simple select 2022-12-21 14:03:02 +01:00
Paul Chavard
f7c1dff22a refactor(pays): champ pays to use simple select 2022-12-21 14:03:02 +01:00
François Vantomme
993c1b8676 fix(batch operation): ensure to append bigint to SQL array 2022-12-21 11:59:55 +01:00
Christophe Robillard
11a18516b2 remove feature flag zonage 2022-12-21 09:02:16 +01:00
Paul Chavard
227296682b fix(dossier): clone should include more attachments 2022-12-20 21:30:32 +01:00
Colin Darie
c673950e56 fix(instructeurs): behavior of sort by notifications checkbox (updated_at desc) 2022-12-20 15:51:47 +01:00
Damien Le Thiec
c4e427642f Allow prefill civility 2022-12-20 14:38:05 +01:00
Sébastien Carceles
e4a7a4c391
hide values and examples for unprefillable champs (#8309)
* hide values and examples for unprefillable champs

*  put prefillable champs first
2022-12-20 13:37:25 +00:00
Sébastien Carceles
dd0a05c1d8
feat(prefill): add possible values (#8299)
* update layout in order to show possible values

* filter out non fillable types de champ
2022-12-20 11:04:42 +01:00
Sébastien Carceles
0a10a08c21
feat(demarche): describe procedure prefilling (#8187)
* feat(demarche): description

Show the description of an opendata procedure (published or draft),
with help about how to prefill a dossier for this procedure.

Co-authored-by: Damien Le Thiec <damien.lethiec@gmail.com>
2022-12-19 11:32:09 +00:00
Martin
dd74834689 amelioration(attestation.et.mail): desactive les tags sur les champs conditionnés et informe l'usager que ca arrivera 2022-12-19 09:28:46 +01:00
Christophe Robillard
f1595d1f50 wrap resultset tuples in ProcedureDetail 2022-12-16 15:51:49 +01:00
Christophe Robillard
3a660349ad export all demarches 2022-12-16 15:51:49 +01:00
Eric Leroy-Terquem
2645ac85f7 update wording and order in types de champ select 2022-12-16 09:30:36 +01:00