Commit graph

6683 commits

Author SHA1 Message Date
kara Diaby
66f0fa35f2 layout 2021-06-04 15:29:08 +02:00
kara Diaby
3555c9696a modify concern 2021-06-04 15:29:08 +02:00
kara Diaby
6ed339e7aa modify controllers 2021-06-04 15:29:08 +02:00
Paul Chavard
3071af220a Add revision date_publication 2021-06-03 13:11:16 +02:00
Paul Chavard
f526e303e8 Apply suggestions from code review
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2021-06-03 13:11:16 +02:00
Paul Chavard
3fb10fb4b8 Set published_at on revision when publishing a procedure 2021-06-03 13:11:16 +02:00
Paul Chavard
306e5d228d Add published_at to procedure_revisions 2021-06-03 13:11:16 +02:00
Paul Chavard
990ae10399 GraphQL byte_size should be BigInt 2021-06-03 10:53:17 +02:00
Paul Chavard
f076fa803e Handle GeoJSON validation errors 2021-06-02 12:43:24 +02:00
Pierre de La Morinerie
188b89a3c8 manager: fix polymorphic route exception when viewing user emails
Since the last Rails update, arguments to polymorphic routes must be
symbols, otherwise an exception is raised.
2021-06-01 11:29:57 +02:00
Paul Chavard
05380b9520 Fix destoying discarded procedures 2021-05-27 18:48:56 +02:00
François Vantomme
bc6d5aca0e Fix (Sentry): prefer Rails secrets over ENV variables 2021-05-27 11:12:27 +02:00
Paul Chavard
9b0dae4cc2 Fix apostrophes ‘ -> ’ 2021-05-26 18:05:14 +02:00
Paul Chavard
bd7bb2d0d2 Fix apostrophes ‘ -> ’ 2021-05-26 15:09:23 +02:00
Paul Chavard
4922bc88d6 Do not crash when properties is nil 2021-05-26 12:40:07 +02:00
Paul Chavard
dfc46a8736 Enable add descriptions to cadastres 2021-05-26 11:27:09 +02:00
Paul Chavard
18ce027b84 Update dossier serialize query to stop using deprecated fileds 2021-05-26 11:12:06 +02:00
lydiasan
2d6ad4f2c1
Merge branch 'main' into localize-dropdown-button 2021-05-25 14:45:52 +02:00
lydiasan
884e52326e
Update app/views/layouts/_locale_dropdown.html.haml
Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>
2021-05-25 13:36:50 +02:00
lydiasan
355616e9a7
Update app/views/layouts/_header.haml
Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>
2021-05-25 13:36:32 +02:00
lydiasan
e85dcf4c58
Update app/controllers/application_controller.rb
Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>
2021-05-25 13:32:26 +02:00
Paul Chavard
179bb5a9fe Apply suggestions from code review
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2021-05-25 11:43:38 +02:00
Paul Chavard
acb277e650 Use stable_id when replacing tags 2021-05-25 11:43:38 +02:00
lydiasan
71069c0e1b correction de la variable d'environnement 'LOCALIZATION_ENABLED' 2021-05-25 10:05:52 +02:00
Paul Chavard
1b0cc62fc2 Add cadastres to MapReader 2021-05-24 11:57:00 +02:00
Paul Chavard
2244263b49 Add cadastres to MapEditor 2021-05-24 11:57:00 +02:00
Paul Chavard
19440afebf Improuve mapbox utilis and shared components 2021-05-24 11:57:00 +02:00
Paul Chavard
3b85ade440 Add compatibility cadsatre layer with old API GEO 2021-05-24 11:57:00 +02:00
Paul Chavard
e74dcb0056 Remove ign feature flag 2021-05-24 11:50:16 +02:00
Paul Chavard
01c558953b Remove API GEO legacy adapter 2021-05-24 11:50:16 +02:00
Paul Chavard
bf462380e6 MultiSelect: select values on blur 2021-05-20 17:21:13 +02:00
Paul Chavard
3313ea5885 MultiSelect: do not show empty results on free form inputs 2021-05-20 17:21:13 +02:00
Paul Chavard
e0d8d096f2 MultiSelect: improuve setters 2021-05-20 17:21:13 +02:00
Paul Chavard
868ec214ce MultiSelect: enable adding multiple emails with , or space 2021-05-20 17:21:13 +02:00
simon lehericey
b620888597 show only dossier avis 2021-05-20 16:18:04 +02:00
simon lehericey
63311eceb0 avoid serializing long id list in case of huge procedure, search on it before 2021-05-20 12:08:04 +02:00
Paul Chavard
bf9f29cc71 Fix messagerie scroll to last message 2021-05-20 11:58:54 +02:00
kara Diaby
20933579b0 do not display confidential avis to other experts 2021-05-19 21:30:22 +02:00
simon lehericey
17617fba43 address champ needs the data column 2021-05-19 15:59:18 +02:00
simon lehericey
a46000dc1f ensure to_s is used on specialized champ 2021-05-19 09:39:20 +02:00
simon lehericey
3c01488db2 use set to avoid duplicate in @dossier_count 2021-05-18 11:43:20 +02:00
simon lehericey
663d287962 proposition de simplification 2021-05-18 11:43:17 +02:00
simon lehericey
02e2128fb7 proposition de simplification 2021-05-18 11:42:11 +02:00
Paul Chavard
e043645a88 cleanup tests 2021-05-18 11:42:10 +02:00
kara Diaby
6a1ed2e02d layout 2021-05-18 11:42:10 +02:00
kara Diaby
fdde55f675 modify service 2021-05-18 11:42:10 +02:00
kara Diaby
7d9cf63056 add and modify controllers 2021-05-18 11:42:10 +02:00
Paul Chavard
5f419954b4 Fix dossier deleted user display 2021-05-13 10:43:55 +02:00
lydiasan
42153d1d37 ajout du selecteur de langue 2021-05-12 16:30:35 +02:00
Paul Chavard
3f7a2bea9b Dossier without user should be valid 2021-05-11 17:50:10 +02:00
Paul Chavard
8a74438dc1 Use conservation_extension instead of en_construction_conservation_extension 2021-05-11 17:33:53 +02:00
Paul Chavard
1e0d6ea28f Rename en_construction_conservation_extension to conservation_extension 2021-05-11 14:08:51 +02:00
simon lehericey
c5f6c9ae1e fix missing state translation 2021-05-10 11:17:34 +02:00
Pierre de La Morinerie
b398485d97 manager: localize dossier enums
In the previous commit, we cleaned up the localization of the
Dossier.state enum. This prevented administrate from crashing, but now
the dossier enum are no longer localized in the Manager.

By using a `Field::Enum` type, we instruct the administrate plugin
to look up our localized name for the Dossier state enum.
2021-05-06 14:41:08 +02:00
Pierre de La Morinerie
b8f71bd52c i18n: fix enum values for Dossier.state
According to Rails i18n guide, enum values should be localized
as `<model>/<enum>`, not as sub-values to the attribute.

This fixes an exception in administrate when displaying a Dossier
in the Manager.

Note: we need to change the way GraphQL attributes are generated, because
`AASM::Core::State#display_name` doesn’t honor the `model/attribute.value`
convention (and instead tries to localize as `model.attribute/value`).
So instead we lookup the localized name using ActiveRecord.
2021-05-06 14:38:25 +02:00
Pierre de La Morinerie
dc33f4a395 manager: use administrate helper to retrieve resource path
This is lifted from the current default template provided by
administrate.
2021-05-06 11:11:04 +02:00
Christophe Robillard
6086f05524 corrige le lien annuaire lorsque le siren n'est pas connu 2021-05-06 09:59:27 +02:00
simon lehericey
55b80df29d display count before text in tabs 2021-05-06 09:13:20 +02:00
simon lehericey
f55c6ee371 stick arrow with label 2021-05-06 09:13:20 +02:00
simon lehericey
8d0082419c do not know how it worked before 2021-05-05 14:36:34 +02:00
simon lehericey
4dc314d24b [fix #6084] add db constraints to france_connect_informations table 2021-05-05 14:28:20 +02:00
simon lehericey
9fd1c604a1 display follower instructeur emails in alphabetic order 2021-05-04 16:38:34 +02:00
simon lehericey
50f679746f do not extract twice the same dossier_id if the dossier is followed twice 2021-05-04 16:38:34 +02:00
Paul Chavard
bcbfcdc537 Revert "Merge pull request #6142 from tchak/enable_brouillon_extend_conservation"
This reverts commit 48eb4d9778, reversing
changes made to 5539d5cb8c.

# Conflicts:
#	app/models/dossier.rb
#	db/schema.rb
2021-05-04 16:03:29 +02:00
Christophe Robillard
01f180022b prend en compte uniquement les pj pour estimer la taille d'un dossier 2021-05-04 12:50:12 +02:00
Paul Chavard
f6508899de Refactor NotificationMailer 2021-05-04 12:05:06 +02:00
Paul Chavard
a4fd629f4a Enable user destruction 2021-05-04 12:05:06 +02:00
Paul Chavard
e240dd6d2c remove NewAttestationMailer 2021-05-04 12:05:06 +02:00
Pierre de La Morinerie
13d2364fd5 jobs: add Excon::Error::Socket to the list of transient errors
In ActiveStorage::Purge job we see a lot of SSL errors:

> Connection reset by peer - SSL_connect (Errno::ECONNRESET)

These errors seem transient, and resolve themselves after a while.
2021-05-04 11:38:22 +02:00
François Vantomme
cb717aede2 Fix (GraphQL): raise exception when blob is missing
Failures:

  1) API::V2::GraphqlController when authenticated mutations dossierEnvoyerMessage upload error should fail
     Failure/Error: expect(gql_errors).to eq(nil)

       expected: nil
            got: [{:backtrace=>["/usr/local/bundle/ruby/2.7.0/gems/graphql-1.12.5/lib/graphql/backtrace/tracer.rb:64:i...]
2021-05-04 11:26:23 +02:00
Paul Chavard
b2a867266a Allow users to extend conservation on drafts 2021-04-29 19:50:30 +02:00
Christophe Robillard
3d04221dab generate pdf export for dossier only on demand 2021-04-29 17:30:38 +02:00
Christophe Robillard
f40d96fbd2 Revert "Revert "Export de tous les dossier d'une démarche""
This reverts commit d9a588b52e.
2021-04-29 17:29:47 +02:00
krichtof
d9a588b52e
Revert "Export de tous les dossier d'une démarche" 2021-04-29 16:07:18 +02:00
Paul Chavard
69ab7854c2 replace fontawesome with heroicons 2021-04-29 15:20:05 +02:00
Pierre de La Morinerie
2cb6ec7c51 jobs: add more transient errors
These errors occur frequently during interactions with OVH's
ObjectStorage.
2021-04-29 14:08:12 +02:00
Pierre de La Morinerie
684af77e35 jobs: extract an RetryOnTranscientErrors concern 2021-04-29 14:08:12 +02:00
simon lehericey
7b94c2de88 remove extra Dossier call in projection 2021-04-29 11:46:00 +02:00
simon lehericey
fd6f110210 do not calculate pagination twice 2021-04-29 11:23:41 +02:00
simon lehericey
22811e1cc2 remove unused kaminari stuff 2021-04-29 11:23:41 +02:00
simon lehericey
db23a853a9 fetch all notification at once 2021-04-29 11:23:41 +02:00
simon lehericey
87bee9d234 set img height and width 2021-04-29 11:23:41 +02:00
simon lehericey
a4e813380a one query for avis count 2021-04-29 11:23:41 +02:00
simon lehericey
5cfb4114ce one query per table 2021-04-29 11:23:41 +02:00
simon lehericey
20fb756097 one less count 2021-04-29 11:23:41 +02:00
simon lehericey
8b73d8804c fetch all exports at once by groupe_instructeurs_ids 2021-04-29 11:23:41 +02:00
simon lehericey
951d4c0025 eager load procedure logo 2021-04-29 11:23:41 +02:00
Paul Chavard
6e1b4a2067 Update and pin mapbox-gl 2021-04-28 15:34:53 +02:00
Paul Chavard
85b907807a Improuve ComboMultipleDropdownList style 2021-04-28 12:54:45 +02:00
Christophe Robillard
09870c918d prevent race conditions when creating archives 2021-04-28 11:40:58 +02:00
Christophe Robillard
dfbe004122 rename content_type to time_span_type for archives 2021-04-28 11:40:58 +02:00
Christophe Robillard
9134114c2e fix rubocop offenses 2021-04-28 11:40:58 +02:00
Christophe Robillard
aa407d5607 place le cronjob PurgeStaleArchives dans le bon répertoire 2021-04-28 11:40:58 +02:00
Christophe Robillard
8bee53fe77 rend plus robuste la création de l'archive 2021-04-28 11:40:58 +02:00
Christophe Robillard
59a08ad307 affiche quand l'archive a été générée 2021-04-28 11:40:58 +02:00
Christophe Robillard
fa4f6190c4 exporte aussi les démarches archivées 2021-04-28 11:40:58 +02:00
Christophe Robillard
71a5e41e5b add archive_zip_globale feature flag 2021-04-28 11:40:58 +02:00
Christophe Robillard
8b2849408c instructeurs can create and download archives 2021-04-28 11:40:58 +02:00
Christophe Robillard
609a1aa45b add archive creation and purge archives jobs 2021-04-28 11:40:58 +02:00
Christophe Robillard
07cc4fa97f add service to create procedure archive 2021-04-28 11:40:58 +02:00
Christophe Robillard
fba0d78153 generate pdf export inside pieces_justificatives_service 2021-04-28 11:40:58 +02:00
Christophe Robillard
c25f3c79d9 add archive model 2021-04-28 11:40:58 +02:00
Pierre de La Morinerie
0cb2162a65 db: fix out-to-date Procedure comments 2021-04-27 15:36:22 +02:00
Pierre de La Morinerie
ac3bc38c75 views: fix invalid locale name 2021-04-27 14:51:00 +02:00
simon lehericey
275b71abac includes champs: :type_de_champ 2021-04-27 13:45:57 +02:00
Pierre de La Morinerie
51d6faabee controllers: log invalid tokens in Users::SessionsController
This is an attempt to understand why we have so many of these
errors in production.
2021-04-22 19:23:47 +02:00
Paul Chavard
2a068fb9b0 Remove user feedback buttons 2021-04-22 15:40:40 +01:00
Paul Chavard
c20ad5ca17 Remove the link between commentaire and user 2021-04-22 15:10:47 +01:00
Pierre de La Morinerie
360f4be4c9 views: replace link by a round_button in the password reset email 2021-04-22 14:24:15 +02:00
Pierre de La Morinerie
d530b272a1 password: add specific page for reset instructions 2021-04-22 14:24:15 +02:00
Pierre de La Morinerie
fb55c76829 views: cleanup link_sent HTML and CSS
This prepares for re-using the CSS in the reset_link_sent page.
2021-04-22 14:24:15 +02:00
Paul Chavard
6836191ca5 Improuve commune autocomplete results 2021-04-22 09:59:21 +01:00
simon lehericey
b20296f8c6 less object (-350) 2021-04-22 10:46:04 +02:00
simon lehericey
553e1d973c remove old methods 2021-04-22 10:46:04 +02:00
simon lehericey
0c845c937d use DossierProjectionService 2021-04-22 10:46:04 +02:00
simon lehericey
5bfd4ecbbf add DossierProjectionService 2021-04-22 10:46:04 +02:00
kara Diaby
d5cea74ee9 add procedure number and link into admin dashboard (show) 2021-04-21 17:01:46 +02:00
Pierre de La Morinerie
8cb7a49dd9 password: add password reset instructions 2021-04-20 09:34:53 +02:00
Pierre de La Morinerie
53fc7386f1 sign_in: fix the procedure preview not being hidden on mobile 2021-04-20 09:34:52 +02:00
Pierre de La Morinerie
6b14420ffa sign_in: improve "Forgot password?" appearance on mobile 2021-04-20 09:34:52 +02:00
Pierre de La Morinerie
0749d981ab password: make the "Reset password" button clearer 2021-04-20 09:34:52 +02:00
Pierre de La Morinerie
fffb85987c app: retain user email on sign-in error 2021-04-20 09:34:52 +02:00
kara Diaby
6524b6bcb7 layout 2021-04-19 10:23:45 +02:00
kara Diaby
01a91fb35b modify controllers 2021-04-19 10:23:45 +02:00
kara Diaby
541a36abbf Add boolean to procedures table 2021-04-19 10:23:45 +02:00
simon lehericey
e0959cda1e constantize hot strings
- 1131 objects over 4220 (-25%) created in app/
2021-04-16 13:13:22 +02:00
simon lehericey
47f13219ed Avoid useless TypeDeChamp deserialization
- 520 objects overs 4720 (10%) created in app/ (using ?pp=profile-memory&memory_profiler_allow_files=app/)
2021-04-16 13:13:22 +02:00
simon lehericey
e728a3fcb7 include type_de_champ
Avoid n+1 when matching champ.stable_id in procedure.presentation.displayed_fields_values
win 2s in the worst 3s scenario
2021-04-16 13:13:22 +02:00
Paul Chavard
ea484b879e Prevent expert users to be deleted 2021-04-15 16:17:36 +01:00
kara Diaby
663fa50f02 notify expert when a decision is taken on a dossier 2021-04-15 11:29:55 +02:00
Christophe Robillard
db48ea02aa [manager] list superadmins 2021-04-15 10:12:11 +02:00
Paul Chavard
6d37e1d133 Fix discarded procedures destruction 2021-04-14 12:24:16 +01:00
Paul Chavard
5b56ec425b Fix discarded dossiers destruction 2021-04-14 12:24:16 +01:00
Pierre de La Morinerie
872f6b0153 lib: add migration helpers for making a column unique 2021-04-13 18:09:59 +02:00
Paul Chavard
f152c51d12 Remove ignored_columns 2021-04-13 17:00:07 +01:00
simon lehericey
fde433a7cf do not ask for avis if the dossier is absent 2021-04-13 12:04:45 +02:00
Pierre de La Morinerie
16f695031b manager: add Mailjet emails to the sent emails list 2021-04-13 10:58:30 +02:00
Pierre de La Morinerie
773c18babf manager: improve clarity of emails page 2021-04-13 10:57:26 +02:00
Pierre de La Morinerie
5e8327ff09 manager: refactor SendInBlue unblock action 2021-04-13 10:57:26 +02:00
Pierre de La Morinerie
76e74003ad manager: fix SendInBlue emails 2021-04-13 10:57:26 +02:00
simon lehericey
76e261691a add data column to france_connect_infromations 2021-04-13 09:59:28 +02:00
simon lehericey
cd6cb99c3c add bypass_email_login_token to instructeur 2021-04-13 09:43:38 +02:00
simon lehericey
594cda3ee3 Remove previous attempt but steal its spec 2021-04-13 09:32:48 +02:00
simon lehericey
376013ef03 simplify ever more 2021-04-13 09:32:48 +02:00
simon lehericey
6055fd1b0b remove for_procedure 2021-04-13 09:32:48 +02:00
simon lehericey
e7bc53237b simplify followed_dossiers 2021-04-13 09:32:48 +02:00
simon lehericey
430acb1cb0 Fetch all count at once (- 400ms on pass culture) 2021-04-13 09:32:48 +02:00
simon lehericey
9a5a41d0bb add assign_tos and groupe_instructeur_ids methods 2021-04-13 09:32:48 +02:00
simon lehericey
46517e997b extract procedure_id 2021-04-13 09:32:48 +02:00
kara Diaby
6bb61ca64f add condition regarding experts emails in dossier controller instructeur 2021-04-09 13:09:22 +02:00
simon lehericey
b24faae7e3 remove obsolete procedure_id column in assign_to table 2021-04-09 11:41:13 +02:00
Paul Chavard
5a7312f775 Ensure address to_s never returns nil 2021-04-08 16:43:45 +01:00
Paul Chavard
651a928b7c Improuve export UI 2021-04-08 14:40:26 +01:00
Paul Chavard
371d612fdb Remove unused columns 2021-04-08 12:43:29 +01:00
Paul Chavard
3ac4a1b339 Revert "New attemp to fix orange badge hell"
This reverts commit e83762c4e3.
2021-04-07 20:02:53 +01:00
Paul Chavard
e83762c4e3 New attemp to fix orange badge hell 2021-04-07 18:43:09 +01:00
Paul Chavard
3f994a6fc8 Revert "Try to fix orange badge hell"
This reverts commit 1fd92565f3.
2021-04-07 18:43:09 +01:00
Paul Chavard
1fd92565f3 Try to fix orange badge hell 2021-04-07 15:07:05 +01:00
Paul Chavard
5e5122a436 Prevent crash in preview where there is no siblings 2021-04-06 18:15:29 +01:00
simon lehericey
b87a691176 use env for localization to avoid db round trip 2021-04-06 18:23:14 +02:00
simon lehericey
cd4ad6878c remove insee_api_v3 feature 2021-04-06 18:23:14 +02:00
simon lehericey
06d2eb2d21 remove feature xray 2021-04-06 18:23:14 +02:00
simon lehericey
6f2b2c3c1f use env for maintenance mode to avoid DB roundtrip 2021-04-06 18:23:14 +02:00
simon lehericey
1715a4899f remove coronavirus banner 2021-04-06 18:23:14 +02:00
simon lehericey
7567e51a3f add ui for integrity error 2021-04-06 18:11:26 +02:00
simon lehericey
e636e3a752 add merge_and_update_metadata method 2021-04-06 18:11:26 +02:00
simon lehericey
d552e364fc retry 5 times on integrity error and then block processing 2021-04-06 18:03:39 +02:00
Christophe Robillard
10cd0fece6 modifie la cible des liens du footer 2021-04-06 17:09:56 +02:00
Christophe Robillard
2f7a7f8c83 indique que l'accessibilité n'est pas conforme 2021-04-06 17:09:56 +02:00
Christophe Robillard
b8d203fbf8 rend accessible les liens avec cible _blank 2021-04-06 17:09:56 +02:00
Pierre de La Morinerie
62051c926a app: move update_allow_decision_access to ExpertsController 2021-04-06 14:54:18 +02:00
Pierre de La Morinerie
c82c72402d app: move the experts list to ExpertsProceduresController 2021-04-06 14:29:02 +02:00
Pierre de La Morinerie
7acb4cee83 controllers: use standard action names in ExpertsProceduresController 2021-04-06 13:45:51 +02:00
Pierre de La Morinerie
3f25624a5a routes: nest ExpertsProcedures routes in a resource 2021-04-06 13:18:51 +02:00
Pierre de La Morinerie
c2ce20d40c config: form_with now generates local forms by default
We can remove the `local: true` parameter, as it is now implied by
default.
2021-04-06 12:12:57 +02:00
Pierre de La Morinerie
95b6fdf86d controllers: unload failed avis from dossier
This avoid the subsequent dossier update to fail because some Avis
may be invalid.
2021-04-06 12:12:57 +02:00
Paul Chavard
2702660d72 Update app/models/champs/header_section_champ.rb
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2021-04-06 10:45:16 +01:00
Paul Chavard
4feda01b6f Show section numbers only if none of sections start with numbers 2021-04-06 10:45:16 +01:00
kara Diaby
2a0c40c25f add experts_procedures controller 2021-04-06 10:39:25 +02:00
kara Diaby
a8b30c0cdc add react component (expert view) and block it when the flag is activated 2021-04-06 10:39:24 +02:00
kara Diaby
03fd6eaeea add react component to invite an expert 2021-04-06 10:39:24 +02:00
kara Diaby
f9e4d9c982 add variable to dossier controller 2021-04-06 10:39:24 +02:00
kara Diaby
436f567067 change create avis concern 2021-04-06 10:39:24 +02:00
kara Diaby
60c06b6d8c add revoked at to experts_procedures 2021-04-06 10:39:22 +02:00
kara Diaby
d6bed42a3e add css helper 2021-04-06 10:38:46 +02:00
kara Diaby
62b7d752f9 layout 2021-04-06 10:38:46 +02:00
kara Diaby
f4acc83269 change procedures controller 2021-04-06 10:38:46 +02:00
Pierre de La Morinerie
3499f5af9a models: remove invalid Dossier ↔︎ Champ inverse relationship
`Dossier.champs` is not really an inverse of `Champs.dossier`: when a
Champ record is created, it should not always be added to dossier.champs
(for instance if the champ is private).

NB: this breaks the workaround we added in #3907 to fix the parent
dossier not being touched in some cases (the workaround was to add an
inverse relationship, but we now have to remove it).

The new workaround is to watch for `changed_for_autosave?` on champs.
Unlike `changed?`, `changed_for_autosave?` also detects changes to
attachments. This allows us to touch both `last_champ_updated_at` and
`updated_at` in a single pass.
2021-04-06 10:26:17 +02:00
Pierre de La Morinerie
fc4d8362dc models: fix typo in comments 2021-04-06 10:26:17 +02:00
Paul Chavard
7f3d4a26ad Make exports#key not-null 2021-04-02 17:42:24 +01:00
Paul Chavard
ac17352693 Improuve generated dossier PDF 2021-04-02 14:22:59 +01:00
Paul Chavard
fd48b86b7f Simplify export unicity check and use create_or_find_by 2021-04-01 21:14:16 +01:00
Christophe Robillard
dbfc878bf5 supprime la page accessibilité 2021-03-30 15:12:18 +02:00
Christophe Robillard
d89dc785f0 met à jour le lien de bas de page Accessibilité
Ce lien pointe désormais vers notre site de documentation
2021-03-30 15:08:20 +02:00
Pierre de La Morinerie
798b4a65cc models: fix db structure comment in etablissement.rb
The column is not removed yet, but it is ignored.
2021-03-30 10:45:31 +02:00
kara Diaby
4fc4e19ee6 Ajoute l'onglet avis sur l'interface instructeur, qui renvoie vers le profil expert 2021-03-27 17:00:19 +01:00
Paul Chavard
23104f15a4 Fix export n+1 queries 2021-03-25 19:22:12 +01:00
Pierre de La Morinerie
3f3d6ae399 controllers: use template: rather than file: to render PDFs
ActionView now throws an error if a relative path is used with `file:`.
2021-03-25 13:24:53 +01:00
Pierre de La Morinerie
185c74d891 dossier: fix SQL deprecation error
ActiveRecord 6.1 disallows passing strings to the `order()` function, to
prevent SQL injections.

Here we know that the order string is safe: `ts_vector` is constant,
and `ts_query` is properly escaped.

Wrap the SQL fragment in Arel.sql to bypass the error.
2021-03-25 13:24:53 +01:00
lydiasan
8dce3e5d2a i18n: localize users/sign_in page 2021-03-25 11:59:05 +01:00
kara Diaby
fff6725799 modify api and serializer 2021-03-24 17:47:24 +01:00
kara Diaby
d17fdfec77 modify layout 2021-03-24 17:47:24 +01:00
kara Diaby
2930de1015 remove useless code in models 2021-03-24 17:47:24 +01:00
kara Diaby
71973de17c remove useless columns from the db 2021-03-24 16:20:44 +01:00
Christophe Robillard
83cf0fa903 detect staging env 2021-03-24 15:30:12 +01:00
maatinito
a29fb5cc5b dossier pdf: display form fields in two columns (instead of 2 lines)
Identity fields are displayed on two columns, but until now Dossier
fields were displayed on two lines.

This was because of a bug in format_in_2_columns, where the multiple-
lines fields were not handled properly.

This has been fixed a while back by @maatinito, so we can now enable
two-columns formatting even for Dossier fields.
2021-03-23 17:02:52 +01:00
maatinito
cc19453f68 views: fix warning message about incomplete fields for attestation
The labels for the champs and private champs were inverted.
2021-03-23 16:56:02 +01:00
Paul Chavard
0b22788d60 experts_procedure should not be optional 2021-03-23 13:46:33 +01:00
Paul Chavard
84214f4bd4 Do not export non exportable champs on draft procedures 2021-03-23 09:55:37 +01:00
Kara Diaby
38837443aa
Merge branch 'main' into fix-experts-lookup 2021-03-18 20:46:56 +01:00
Pierre de La Morinerie
239169e925 dossier: fix looking-up avis from Expert
This line causes an error on Rails 6.1.

And it isn't even necessary: this line is supposed to query avis where
the expert advice has been requested – but this is handled by the
`if expert.dossiers.include?(self)` condition just above.
2021-03-18 17:59:30 +01:00
Paul Chavard
1449fbbe67 Fix multiple_drop_down_list mandatory check 2021-03-18 15:22:28 +01:00
kara Diaby
64b94100f4 fix dossier link helper 2021-03-18 14:36:08 +01:00
kara Diaby
5e88ecc24c improve request to find an expert 2021-03-18 11:38:53 +01:00
kara Diaby
81f5a5254b tests 2021-03-18 11:38:52 +01:00
kara Diaby
328c2a8e3c change email to display for expert 2021-03-18 11:38:52 +01:00
kara Diaby
e7945594cf eager_load for expert 2021-03-18 11:38:52 +01:00
kara Diaby
38740d1b5b modify experts avis controllers, concern and serializer 2021-03-18 11:38:52 +01:00
kara Diaby
5519ee8417 Expert Layout 2021-03-18 11:38:52 +01:00
kara Diaby
e79b1204e0 change avis invitation mailer 2021-03-18 11:38:52 +01:00
kara Diaby
c55e4d0d98 remove unused instructeur logic 2021-03-18 11:38:52 +01:00
kara Diaby
e8207535ea modify instructeur views 2021-03-18 11:27:51 +01:00
kara Diaby
568b1c4e53 remove instructeur unused layout 2021-03-18 11:27:51 +01:00
kara Diaby
54d414b3b7 add expert to export 2021-03-18 11:27:51 +01:00
kara Diaby
a710116371 add expert profile to api 2021-03-18 11:27:51 +01:00
kara Diaby
d47fde3fcb add polymorphic relation to claimant on avis table 2021-03-18 11:27:51 +01:00
kara Diaby
d2ab2debb6 add expert logic 2021-03-18 11:27:51 +01:00
Paul Chavard
d59867c73b Exposer plus d’informations dans l’interface pour certains champs 2021-03-17 16:28:05 +01:00
Paul Chavard
e96d2fb083 Return empty strings for incomplete api entreprise adresses 2021-03-17 12:12:21 +01:00
Paul Chavard
a6fe1df201 update graphql schema 2021-03-17 11:53:48 +01:00
Paul Chavard
4efc5ff273 Update app/graphql/schema.graphql
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2021-03-17 11:53:48 +01:00
Paul Chavard
046b36d386 Update app/graphql/schema.graphql
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2021-03-17 11:53:48 +01:00
Paul Chavard
866ae256a3 Add revision dossiers filters 2021-03-17 11:53:48 +01:00
Christophe Robillard
f47e2e62cd add button role to supprimer link 2021-03-17 11:31:51 +01:00
Christophe Robillard
6026793c1d focus to target after toggle 2021-03-17 11:31:51 +01:00
Christophe Robillard
df3bd3a1d2 handle focus during and after upload 2021-03-17 11:31:51 +01:00
Christophe Robillard
43039d1755 add aria-value min, max and now for progressbar upload 2021-03-17 11:31:51 +01:00
Christophe Robillard
dfed8f32ae update link to download dossier and all pjs 2021-03-16 15:13:17 +01:00
Christophe Robillard
858bbde2d6 remove dead code 2021-03-16 15:13:17 +01:00
Christophe Robillard
60cc4d3697 add pdf to pjs export 2021-03-16 15:13:17 +01:00
Paul Chavard
76aa7bdfe3 Add default nil value for numero_tva_intracommunautaire 2021-03-16 12:57:10 +01:00
Pierre de La Morinerie
75a1046315 active_storage: refactor concerns
Follow-up of #5953.

Refactor the concerns with two goals:

- Getting closer from the way ActiveStorage adds its own hooks.
  Usually ActiveStorage does this using an `Attachment#after_create`
  hook, which then delegates to the blob to enqueue the job.
- Enqueuing each job only once. By hooking on `Attachment#after_create`,
  we guarantee each job will be added only once.

We then let the jobs themselves check if they are relevant or not, and
retry or discard themselves if necessary.

We also need to update the tests a bit, because Rails'
`perform_enqueued_jobs(&block)` test helper doesn't honor the `retry_on`
clause of jobs. Instead it forwards the exception to the caller – which
makes the test fail.

Instead we use the inline version of `perform_enqueued_jobs()`, without
a block, which properly ignores errors catched by retry_on.
2021-03-16 11:49:14 +01:00
Pierre de La Morinerie
08094e5384 jobs: retry on ActiveStorage::IntegrityError during virus scan
This is the same setting than what ActiveStorage::AnalyzeJob uses.
2021-03-16 10:52:12 +01:00
Paul Chavard
6f543d3770 Handle invalid GeoJSON in the editor 2021-03-11 15:51:09 +01:00
Paul Chavard
a7fb7bf1ef Add geo json validation 2021-03-11 15:51:09 +01:00
Paul Chavard
d24ee27cac Try to reduce the number of external data fetches
Only fetch external data if the external_id is the current one and data is not yet fetched
2021-03-11 14:56:37 +01:00
Paul Chavard
21d5da379f remove unused job 2021-03-11 14:56:37 +01:00
Paul Chavard
bee66d41c4 capital_social and numero_tva_intracommunautaire can be null 2021-03-11 11:13:50 +01:00
kara Diaby
6383e6b9e7 Revert "Revert "Claimant type to avis table""
This reverts commit f4fd220d43.
2021-03-10 08:48:55 +01:00
Paul Chavard
70500e3d56 Groupe instructeur selector default blank 2021-03-09 14:47:23 +01:00
Paul Chavard
9c3e72c84a Use revision instead of groupe instructeur as dossier procedure link 2021-03-09 14:47:23 +01:00
Kara Diaby
f4fd220d43
Revert "Claimant type to avis table" 2021-03-09 13:40:10 +01:00
kara Diaby
0211d1f105 modify create_avis_concern 2021-03-07 22:47:53 +01:00
kara Diaby
af4a27f4e0 add claimant type on avis table 2021-03-07 22:47:24 +01:00
Paul Chavard
82fca8be0b Make more association fields nullable 2021-03-05 10:13:22 +01:00
Christophe Robillard
6169399a6b fix limit date for notice validation 2021-03-05 08:34:39 +01:00
Pierre de La Morinerie
b0735aafe0 config: fix DynamicSmtpSettingsInterceptor warning again
This warning re-appeared when running mailer tests:

```
DISABLE_SPRING=1 bin/rspec spec/mailers/administration_mailer_spec.rb
```

It is now fixed properly, in a way recommanded by the documentation.
2021-03-04 22:52:19 +01:00
Paul Chavard
47e232f439 Some associations have no date_creation 2021-03-04 16:28:20 +01:00
Christophe Robillard
7f496c43e5 no validation for old procedures 2021-03-04 16:13:19 +01:00
Pierre de La Morinerie
2f948f7e46 active_storage: fix blob update hooks
For some reason on Rails 6.1 the `after_update_commit` hook is properly
registered – but disappears from the record later, and in the end is
never run.

Fix it by using the general `after_commit` hook instead.
2021-03-04 14:30:38 +01:00
Paul Chavard
f31096b33e When procedure is reset delete only draft revision dossiers 2021-03-04 13:10:58 +01:00
Paul Chavard
79606e8696 Some addresses have no street_address 2021-03-04 12:52:01 +01:00
Paul Chavard
600f49a0ff Hide groupe instructeur selector when routage is done via API 2021-03-04 11:06:04 +01:00
Paul Chavard
1c811083c0 Cleanup feature flags usage 2021-03-04 11:06:04 +01:00
Pierre de La Morinerie
9537342c06 procedure: fix query for finding champs without stable_id
It would break on ActiveRecord 6.1.
2021-03-04 09:54:22 +00:00
Paul Chavard
5d4f025be0 Rename for consistency with defaut_groupe_instructeur 2021-03-04 10:45:02 +01:00
Paul Chavard
89ec3923f2 Defaut groupe instructeur ordered by label 2021-03-04 10:35:44 +01:00
Paul Chavard
9f8c55969d Add proper external data API errors handling 2021-03-04 10:16:06 +01:00
Paul Chavard
e7ba380d95 Fix JSON.parse crashing on empty values 2021-03-03 17:31:05 +01:00
Paul Chavard
96a832bc19 Add SerializerService 2021-03-02 12:42:22 +01:00
Paul Chavard
bb072ba9e9 Add id argument to most collections on dossier 2021-03-02 12:42:22 +01:00
Paul Chavard
0bd8721776 Add a way to authoraize any query through context 2021-03-02 12:35:47 +01:00
Paul Chavard
ac5a860e1b remove unused print.css reference 2021-02-25 17:20:11 +01:00
Paul Chavard
ff8ccbd088 Try to parse SIB email date when it is a string 2021-02-25 15:20:14 +01:00
Pierre de La Morinerie
9f676c76e1 config: fix zeitwerk warning about DynamicSmtpSettingsInterceptor
Fix a warning when running tests:

> DEPRECATION WARNING: Initialization autoloaded the constant DynamicSmtpSettingsInterceptor.
>
> Being able to do this is deprecated. Autoloading during initialization is going
to be an error condition in future versions of Rails.
> 
> Reloading does not reboot the application, and therefore code executed during
> initialization does not run again. So, if you reload DynamicSmtpSettingsInterceptor, for example,
> the expected changes won't be reflected in that stale Class object.
> 
> This autoloaded constant has been unloaded.
> 
> Please, check the "Autoloading and Reloading Constants" guide for solutions.

However if we fix as recommanded, the interceptor will get added
each time the classes are reloaded. And as the actual class instance
changed after the reloading, they won't be de-duplicated – *and*
there's no way to remove the old interceptor without having a reference
to the (now-deleted) class.

Instead we load the interceptor once, and add a message about the class
not being auto-reloaded.
2021-02-24 19:00:29 +01:00
Pierre de La Morinerie
2e3ddd6190 gems: upgrade to Sprockets 4 2021-02-24 17:09:51 +01:00
Pierre de La Morinerie
e51948ab5c stylesheets: merge print rules with the application stylesheet
- Having a separate stylesheet for print rules is not a best practice
  (it makes an extra network request)
- It makes migrating to Sprockets 4 easier
2021-02-24 17:09:51 +01:00
Paul Chavard
2c2b392d6c Fix multiselect labels
only add values to new values if it is a new value
2021-02-19 12:08:54 +01:00
Paul Chavard
92158cecb6 fix constant 2021-02-19 11:29:08 +01:00
Paul Chavard
24f71ccc1a Improuve multi select
In multi select with acceptNewValues option alway keep the new value as the first item in the list to make it easier to add it
2021-02-19 10:53:16 +01:00
Paul Chavard
a0b53d7d80 Expose structured address on the API
fix #4290
2021-02-17 19:10:16 +01:00
Paul Chavard
75392272fb Add champ address model 2021-02-17 19:10:16 +01:00
Paul Chavard
228a83f8a5 Add api address external data fetch 2021-02-17 19:10:16 +01:00
Paul Chavard
7eee14feef Add ChampFetchExternalDataJob 2021-02-17 19:10:16 +01:00
Christophe Robillard
ac56581ccf fix indent 2021-02-17 16:41:57 +01:00
Christophe Robillard
d55f156aec admin: durée de conservation des données hors ds n'est plus demandée
La colonne est tout de même gardée en base
2021-02-17 16:41:57 +01:00
Christophe Robillard
2be4bcf22d admin: peut modifier durée de conservation d'une procédure publiée 2021-02-17 16:41:57 +01:00
Paul Chavard
6756db1013 Update react-query 2021-02-16 18:14:11 +01:00
Paul Chavard
bb49f6e151 replace react-use with use-debounce
this is a much lighter dependencie
2021-02-16 18:14:10 +01:00
Paul Chavard
3dae5b5c04 update react 2021-02-16 18:14:10 +01:00
Paul Chavard
df80f5681d remove react-scroll-to-component 2021-02-16 18:14:10 +01:00
Paul Chavard
1c164c4376 Use jsx extension 2021-02-16 18:14:10 +01:00
Pierre de La Morinerie
98be7e2076 Fix new Rubocop warnings 2021-02-16 16:31:30 +00:00
Pierre de La Morinerie
aae452cc67 gems: update chunky_png
And pass it a proper IO object, to avoid "Undefined method
`set_encoding`" errors.
2021-02-16 16:31:30 +00:00
Pierre de La Morinerie
b04afed20e gems: update graphql 2021-02-16 16:31:30 +00:00
Paul Chavard
881820888a Use stable cache key for useMemo 2021-02-16 16:47:15 +01:00
Christophe Robillard
8b55f67964 accepte nouvelles valeurs pour ComboMultipleDropdownList 2021-02-16 16:47:15 +01:00
Paul Chavard
06e282b839 supprime select2
select2 n'est plus utilisé. Il est remplacé par
ComboMultipleDropdownList
2021-02-16 16:47:15 +01:00
Christophe Robillard
f9ad9444a9 add style for ComboMultipleDropdownList 2021-02-16 16:47:14 +01:00
Christophe Robillard
7565a25b51 rend accessible l'affectation d'un instructeur
en remplaçant select2 par ComboMultipleDropdownList
2021-02-16 16:47:14 +01:00