Commit graph

6513 commits

Author SHA1 Message Date
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