Commit graph

12033 commits

Author SHA1 Message Date
Pierre de La Morinerie
f9401cfbad spec: better split spec_helper and rails_helper
This fixes the

> DEPRECATION WARNING: Initialization autoloaded the constants ActionText::ContentHelper and ActionText::TagHelper.

error appearing when running specs.

It also gets us closer from a newly-generated rails config.
2021-03-04 22:59:39 +01:00
Pierre de La Morinerie
71c4ce67b2 gemfile: don't require i18n-tasks by default
i18n-tasks is only used as a standalone command-line tool. It doesn't
need to be included in the app.

It also prevent a parser warning from appearing when running any rails
command:

> warning: parser/current is loading parser/ruby27, which recognizes
> warning: 2.7.2-compliant syntax, but you are running 2.7.1.
> warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.

Now this (legitimate) warning only appears when running the i18n-tasks
command.
2021-03-04 22:52:19 +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
krichtof
abb8b04208
Merge pull request #5961 from tchak/fix-carto
fix mapbox-gl transpilation
2021-03-04 19:46:40 +01:00
Paul Chavard
d4a34edab5 fix mapbox-gl transpilation 2021-03-04 19:04:39 +01:00
Pierre de La Morinerie
c8d775af29
Merge pull request #5958 from tchak/make_association_date_creation_nullable
GraphQL : corrige la date de création des associations
2021-03-04 16:41:24 +01:00
Paul Chavard
47e232f439 Some associations have no date_creation 2021-03-04 16:28:20 +01:00
krichtof
2a5d7cf696
Merge pull request #5957 from betagouv/fix-invalid-proc
no validation for old procedures
2021-03-04 16:26:31 +01:00
Christophe Robillard
7f496c43e5 no validation for old procedures 2021-03-04 16:13:19 +01:00
Pierre de La Morinerie
ae8df82dbc
Merge pull request #5953 from betagouv/fix-blob-hooks
ActiveStorage : correction de la manière dont sont déclenchés les jobs externes (anti-virus, filigranage) (#5953)
2021-03-04 14:38:03 +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
21980a37cc
Merge pull request #5947 from tchak/procedure_reset_revision
When procedure is reset delete only draft revision dossiers
2021-03-04 14:15:58 +01:00
Paul Chavard
f31096b33e When procedure is reset delete only draft revision dossiers 2021-03-04 13:10:58 +01:00
Pierre de La Morinerie
bced5fbd51
Merge pull request #5951 from tchak/make_street_address_nullable
Some addresses have no street_address
2021-03-04 12:59:39 +01:00
Paul Chavard
79606e8696 Some addresses have no street_address 2021-03-04 12:52:01 +01:00
Paul Chavard
f2e9b04f99
Merge pull request #5946 from tchak/routage-with-api
Implementer le feature flag pour permettre le routage via l'API
2021-03-04 11:20:40 +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
Paul Chavard
46377fb7d9
Merge pull request #5920 from betagouv/fix-tdc-query
procedure: fix query for finding champs without stable_id
2021-03-04 11:05:35 +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
7c44662f23
Merge pull request #5943 from tchak/groupe_instructeur_order
Groupe instructeur order
2021-03-04 10:53:25 +01: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
2ea94f9eb6
Merge pull request #5944 from tchak/handle-external-data-api-errors
Add proper external data API errors handling
2021-03-04 10:35:04 +01:00
Paul Chavard
9f8c55969d Add proper external data API errors handling 2021-03-04 10:16:06 +01:00
Paul Chavard
e5a9e90304
Merge pull request #5945 from tchak/fix_send_to_instructeurs
Fix JSON.parse crashing on empty values
2021-03-04 10:11:03 +01:00
Paul Chavard
e7ba380d95 Fix JSON.parse crashing on empty values 2021-03-03 17:31:05 +01:00
Paul Chavard
e2063e0fc8
Merge pull request #5922 from tchak/operation-serializer
Operation serializer
2021-03-02 13:07:04 +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
f45d7f4efd
Merge pull request #5942 from betagouv/fix-test-failing-in-february
specs: fix test failing on March 1st
2021-03-02 12:34:45 +01:00
Pierre de La Morinerie
1c77f59f6b specs: fix test failing on March 1st
Because February only has 28 days.
2021-03-02 12:26:28 +01:00
Paul Chavard
fead222533
Merge pull request #5940 from tchak/remove-unused-print-css
remove unused print.css reference
2021-02-25 17:33:35 +01:00
Paul Chavard
ac5a860e1b remove unused print.css reference 2021-02-25 17:20:11 +01:00
LeSim
23d54910b7
Merge pull request #5938 from tchak/sib-emails-list-fix
Try to parse SIB email date when it is a string
2021-02-25 15:31:50 +01:00
Paul Chavard
ff8ccbd088 Try to parse SIB email date when it is a string 2021-02-25 15:20:14 +01:00
Paul Chavard
1a4a658140
Merge pull request #5935 from betagouv/remove-unused-gems
Suppression et mise à jour de gems
2021-02-25 13:49:24 +01:00
Pierre de La Morinerie
1ebfdef411 gems: remove ruby-debug-ide
- It was included to make Rubymine happy, but nowadays Rubymine seems
to load the debugger without touching the Gemfile
- It keeps matching an invalid version when `bundle upgrade`-ing the
dependencies.
2021-02-25 10:45:42 +00:00
Pierre de La Morinerie
473a86b861 gems: remove guard
- It doesn't seem used a lot these days
- It has some incompatibility with rspec 4

We need to explicitely add the 'listen' gem now though.
2021-02-25 10:45:42 +00:00
Pierre de La Morinerie
1d7c4f5b02 gems: remove ffi-geos
We don't need it now that we don't link to a compiled geos version
anymore.
2021-02-25 10:45:42 +00:00
Pierre de La Morinerie
0fa3d367c0 gems: use a version of devise-two-factors compatible with Rails 6.1 2021-02-25 10:45:42 +00:00
Pierre de La Morinerie
8b5a012e14
Merge pull request #5936 from betagouv/fix-zeitwerk-smtp-warning
Correction de messages d'avertissement liés à Zeitwerk (#5936)
2021-02-25 11:44:52 +01:00
Pierre de La Morinerie
d36a684315 config: fix zeitwekr warning when reloading the app
Turns out we need not only to load the Job constants later, but also
not to do the same work twice – otherwise we'll get a 

> ApiEntreprise::Job constant is already defined

when attempting to re-define the constant.
2021-02-24 19:01:27 +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
28722b002b
Merge pull request #5932 from betagouv/sprockets-4
Mise à jour vers le processeur d'assets Sprockets v4 (#5932)
2021-02-24 17:56:48 +01:00
Pierre de La Morinerie
68425929c6 config: disable Sentry sampling when not enabled
This removes spam in the debug console when running locally.

Removed messages look like a swarm of:

> [Tracing] Discarding <rails.request> transaction </assets/marianne.png> because it's not included in the random sample (sampling rate = 0.001)
2021-02-24 17:45:18 +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
Pierre de La Morinerie
e1a450fd6f gems: remove xray-rails
It is not compatible with sprockets-4.
2021-02-24 17:09:51 +01:00