Commit graph

3581 commits

Author SHA1 Message Date
Paul Chavard
91caef0bfe fix(dossier): ensure submitted dossiers always have groupe instructeur 2022-03-02 16:57:12 +00:00
Pierre de La Morinerie
087e438eb6 models: delete AdministrateursInstructeur when destroying Instructeur
By default, `has_and_belongs_to_many` properly deletes the record in
the join table.

However, as the association is declared manually with a
`has_many / through`, it doesn't delete the joined record automatically.

As we also lack a foreign-key contraint on the join table, that means
a dangling record remains in the join table.

To fix this, let's declare it a proper `has_and_belongs_to_many`
association, which will let the join record be deleted automatically
on destroy.
2022-03-02 11:26:53 +01:00
Pierre de La Morinerie
e32c9a9f94 models: don't attempt to format invalid phone numbers
This is a defensive-programming measure, because formatting an
invalid phone number may truncate some leading numbers.
2022-03-02 09:57:03 +00:00
Pierre de La Morinerie
f35d18cd5c models: stop truncating DROM phone numbers
Fix #6996
2022-03-02 09:57:03 +00:00
Pierre de La Morinerie
5150e33212 models: ensure DROM phone numbers are valid
They were accepted before, because they were 'possible' – but now
they are explicitely considered as valid.
2022-03-02 09:57:03 +00:00
Pierre de La Morinerie
71e1b6c973 models: delete AdministrateursProcedure when destroying Administrateur
By default, `has_and_belongs_to_many` properly deletes the record in
the join table.

However, as the association is declared manually with a
`has_many / through`, it doesn't delete the joined record automatically.

As we also lack a foreign-key contraint on the join table, that means
a dangling record remains in the join table.

To fix this, let's declare it a proper `has_and_belongs_to_many`
association, which will let the join record be deleted automatically
on destroy.
2022-03-01 16:58:04 +01:00
mfo
4346775169
Merge branch 'main' into US/fix-avis 2022-02-28 15:08:25 +01:00
Martin
48612028f4 fix(avis_controller#*): missing ACL 2022-02-28 14:24:41 +01:00
Martin
b808b4db00 fix(relation): avoid double association between procedure/procedure_revision/dossier_submitted_message 2022-02-25 14:01:18 +01:00
Martin
85a588541b feat(dossier_submitted_message): add a new system to customize the standby page (/merci) after an user created his folder. this is a basic feature that will come with more options asap
wip(dossier_created_hook): add tile to administrateurs/procedure#show in order to crud dossier_created_hook

refactor(css.utilities): remove merge helpers.scss within utils.scss (same purpose). use scss each for spacer modifiers

refactor(dossiers/_merci.html): extract partial _merci so we can re-use it in preview of dossier_created_hook.

feat(wip): current progress
2022-02-25 14:01:18 +01:00
Pierre de La Morinerie
30d7cf634a tasks: restore older after_party tasks
Turns out deleting the tasks after 6 months only may not be enough for instances deploying
only once a year, for instance.

This reverts commit 77b65f3aa0.
2022-02-22 15:39:16 +01:00
Paul Chavard
2d396fcfb7 feat(dossier): rebase dossiers en construction and en instruction 2022-02-18 17:08:38 +01:00
Paul Chavard
50f095a5c6 test(user): fix unstable spec 2022-02-17 14:45:53 +01:00
Pierre de La Morinerie
c9f1a2b8ea mailer: improve notify_new_answer wording
And also insert the reply email address directly in the email body.
2022-02-16 18:35:30 +01:00
Pierre de La Morinerie
17c83b1ce2 mailer: fix notify_new_answer mailer preview 2022-02-16 18:26:45 +01:00
Pierre de La Morinerie
8786b60285 specs: fix flaky "dossier brouillon" spec
When filling all the champs of a dossier, we skip the "Address"
champ (because it would attempt to request a blocked URL).

But that means the "Yes/No" radio buttons may be under the sticky
bottom bar, and thus not register the click – which makes the test fail.

Fix the issue by manually scrolling to the radio buttons.
2022-02-15 15:04:49 +01:00
Jon
97feca6305 feat(ClamAV): add config to disable clamav usage 2022-02-15 09:15:47 +01:00
Martin
f84b69276e fix(expiration_banner.message): miss match when procedure was not expirable ; always showing expiration message 2022-02-11 15:49:37 +01:00
Paul Chavard
fac77d97ef task(attestation_template): reassign_redundant_attestation_templates 2022-02-11 11:30:24 +01:00
Paul Chavard
08030bcdb7 fix(attestation_template): handle attestation changes on procedures without revisions 2022-02-11 11:12:10 +01:00
Paul Chavard
76b1b85fa7 fix(attestation_template): add revision diff support 2022-02-11 08:45:32 +01:00
Paul Chavard
e269077c40 refactor(attestation_template): cleanup relationships 2022-02-11 08:45:32 +01:00
Paul Chavard
88e80e9e32
Merge pull request #6901 from adullact/feature/6859-jwt-token-expiration
[API Entreprise] Ajout du support des jetons JWT sans clé d'expiration
2022-02-10 11:48:39 +01:00
Kara Diaby
24ff41d2c0 tests 2022-02-09 14:43:36 +01:00
Paul Chavard
77e42dd0e2 Update spec/lib/tasks/deployment/20220112184331_revise_attestation_templates_spec.rb
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2022-02-08 16:22:59 +01:00
Paul Chavard
1fc7db2562 fix(attestation_template): fix migration task 2022-02-08 16:22:59 +01:00
Paul Chavard
12151acb99 Revert "Revert "feat(attestation): revise attestations""
This reverts commit 4e7733e571.
2022-02-08 16:22:59 +01:00
François Vantomme
b9d6c32af7 Test (Universign): mock API URL constant
Addressable::URI::InvalidURIError:
 Absolute URI missing hierarchical segment: 'http://'
2022-02-08 15:59:50 +01:00
Pierre de La Morinerie
847abca122 config: simplify mailer configuration again
Move everything to initializers, and replace the email settings
interceptor by a BalancerDeliveryMethod.

It has the advantage that it can be configured entirely from the
`config/environment.rb` file, without an extra file to look at.
2022-02-08 12:44:43 +01:00
François Vantomme
2bdf58cb79 style(rubocop): fix Layout/SpaceInsideBlockBraces offense 2022-02-08 12:35:08 +01:00
Paul Chavard
e87e8b2c26
Merge pull request #6899 from adullact/feature/6857-no-sandbox
ETQ développeur, je voudrais pouvoir influer sur l'option --no-sandbox du pilote Selenium Chrome lors des tests
2022-02-08 12:29:51 +01:00
Paul Chavard
dad17ec2f8
Merge pull request #6906 from adullact/fix/6864-franceconnect-application-name
[FranceConnect] les tests échouent quand la variable d'env APPLICATION_NAME a une autre valeur que celle par défaut
2022-02-08 11:53:16 +01:00
Paul Chavard
5b147e6d81
Merge pull request #6903 from adullact/fix/6861-feature-test-emails
Les feature tests touchant aux emails échouent de manière aléatoire
2022-02-08 11:52:28 +01:00
Paul Chavard
2773e065ed
Merge pull request #6907 from adullact/fix/6865-instructeur-random-test
Des tests sur les instructeurs échouent aléatoirement
2022-02-08 11:45:36 +01:00
Paul Chavard
0268511264 fix(manager): remove admins added for a day
fix #6855
2022-02-08 11:18:44 +01:00
François Vantomme
eba9a87123
refactor(API Entreprise): raise an error on blank token 2022-02-07 15:18:16 +01:00
François Vantomme
dacc1dca68
fix(groupe instructeur): avoid false-negative tests due to array ordering 2022-02-04 17:43:08 +01:00
François Vantomme
27ccf6bbdd
fix(france connect): stub application name in tests 2022-02-04 17:42:02 +01:00
François Vantomme
9ff7fa73e4
Fix (Expert): clear emails before feature tests
Failures:

  1) Inviting an expert: as an Instructeur I can invite an expert
     Failure/Error: invitation_email = open_email(expert.email.to_s)

Diff:
  -/procedures/2/avis/2/sign_up/email/expert1@expert.com
  +/procedures/1/avis/1/sign_up/email/expert1@expert.com
2022-02-04 17:40:03 +01:00
François Vantomme
2032eb8144
Test (Capybara): add no-sandbox option to headless chrome driver
Activating this option fix the 'DevToolsActivePort file doesn't exist'
error.

https://stackoverflow.com/questions/50642308/webdriverexception-unknown-error-devtoolsactiveport-file-doesnt-exist-while-t
2022-02-04 17:34:10 +01:00
Christophe Robillard
447612abdf fix a11y-8.9.1
no p tag when Champ text with no value
2022-02-02 19:03:40 +01:00
Pierre de La Morinerie
e6cf07b810 stats: move date formatting out of the Stat model
Before this commit, the monthly dossiers count was serialized into the
Stat record using human-formatted dates, as:

```ruby
s.dossiers_in_the_last_4_months = {
  "octobre 2021"=>409592,
  "novembre 2021"=>497823,
  "décembre 2021"=>38170,
  "janvier 2022"=>0
}
```

Turns out the ordering of keys in a serialized hash is not guaranteed.
After a round-trip to the database, the keys will be wrongly sorted.

Instead we want to save raw Date objects, which will preserve the
ordering. The date formatting can be applied at display-time by the
controller.

Fix #6848
2022-02-02 14:13:53 +01:00
Pierre de La Morinerie
ca58e60dc0 validators: rename revisions namespace to types_de_champ 2022-02-01 12:37:16 +01:00
Pierre de La Morinerie
d680602c84 models: validate private types_de_champ 2022-02-01 12:37:16 +01:00
Pierre de La Morinerie
e8e37cce15 models: refactor the types_de_champ validators
Context: we want to validate public and private types_de_champ
separately.

Before we validated the whole revision (and then validators themselves
enumerated all champs, public and private).

Now we validate the actual public types_de_champ, which will let us
validate separately the private types_de_champ.
2022-02-01 12:37:16 +01:00
Kara Diaby
842cc11689 tests 2022-01-31 10:03:44 +01:00
Kara Diaby
96556ca4b3 locales 2022-01-31 10:03:44 +01:00
Paul Chavard
4e7733e571 Revert "feat(attestation): revise attestations"
This reverts commit e413872530.
2022-01-25 18:26:34 +01:00
Kara Diaby
c9f402aa5b tests 2022-01-25 11:46:05 +01:00
Kara Diaby
2eb35065f8 fix dossier deletion mailers 2022-01-25 11:46:05 +01:00