Commit graph

3542 commits

Author SHA1 Message Date
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
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
Kara Diaby
7a49985e2c tests 2022-01-24 16:47:47 +01:00
Martin
47fa95a577 feat(MonAvisEmbedValidator): allow mon avis button without title 2022-01-24 15:56:29 +01:00
Paul Chavard
e413872530 feat(attestation): revise attestations 2022-01-19 18:00:37 +01:00
Paul Chavard
c1cb89bb44 fix(revision): changed? conflicts with rails method 2022-01-19 18:00:37 +01:00
Paul Chavard
3d8471e064 fix(dossier): do not send notification on expiration when dossier is already deleted 2022-01-19 17:52:53 +01:00
Paul Chavard
403e71b41f feat(procedure): only purge procedures without dossiers 2022-01-18 11:22:04 +01:00
Paul Chavard
7937e58caa fix(archives): only export dossiers in archive groupe_instructeurs
fix #6793
2022-01-18 11:16:20 +01:00
Paul Chavard
7e81b257b1 test(system): simplify select menu selector 2022-01-13 17:49:16 +01:00
Kara Diaby
bdcb0ca0e9 tests 2022-01-12 15:49:38 +01:00
Pierre de La Morinerie
062f52feb9 Fix ProcedureAdministrateursController#destroy
- The "no remove oneself" rule wasn't actually enforced
- `flash.error` is not a flash category
2022-01-07 15:39:58 +01:00
Pierre de La Morinerie
fb75a55b89 Add specs for Administrateurs::ProcedureAdministrateursController 2022-01-07 15:39:58 +01:00
Martin
383a92bcd9 fix(parallel_download_queue): tophoeus does not like raise from a request handler [crash straight to first frame] 2022-01-07 14:24:37 +01:00
Pierre de La Morinerie
2e1a3c32cb helpers: handle flash[:error]
Errors generated by the `invisible-catcha` gem are reported as
`flash[:error]` (which differs from Rail's usual `flash[:alert]`).

We probably shouldn't use flash[:error] in our own codebase; but we can
handle its use in third-party libraries.
2022-01-06 14:09:31 +01:00
Pierre de La Morinerie
68b112e00a helpers: don't crash on unknown flash level
Errors generated by the `invisible-catcha` gem are reported as
`flash[:error]` (which differs from Rail's usual `flash[:alert]`).

Avoid crashing when the flash level passed to this helper is not known.
2022-01-06 14:09:26 +01:00
Martin
f770ac4907 fix(users/champs/piece_justificative#update): ensure to bump dossier.last_champ_updated_at otherwise instructeurs are not notified when user update their piece_justificative 2022-01-06 13:09:57 +01:00
Martin
a9ffaf942e feat(attestation): can enable/disable attestation no matter the state of the procedure 2022-01-05 18:20:11 +01:00
Paul Chavard
cb66348916 a11y(select): cleanup select helpers in specs 2022-01-05 12:33:40 +01:00
Paul Chavard
968384952a a11y(capybara): enable use of aria-label in spec 2022-01-05 12:33:40 +01:00
Paul Chavard
28c1763701 a11y(champs): generalize describedby and update to use new Combo props 2022-01-05 12:33:40 +01:00
simon lehericey
00871cfe13 Fix ping controller in dev
For an unknown reason, ActiveRecord::Base.connected? does not work anymore in dev. It returns false negative.

This simple workaround can timeout. The caller has to monitor the response time.
2022-01-05 11:44:32 +01:00
Martin
3eb1c1a421 feat(async_backend): switch to typhoeus 2022-01-04 16:27:23 +01:00
Martin
ce1b189dcd refactor(DownloadManager): extract parallel download in dedicated class. move error management in custom class for procedure exports using the didicated class 2022-01-04 16:17:03 +01:00
Martin
2ed9cccba0 extract download all attachments in dedicated class using async/async-http for better perf 2022-01-04 16:17:03 +01:00
Martin
252eee272b feat(support#create): block with invisible captcha [avoid painful captcha] 2022-01-04 14:49:00 +01:00
Paul Chavard
7f0dde9be4 fix(a11y): add aria to tabs 2022-01-04 09:44:32 +01:00
Kara Diaby
1ca553e088 rename hidden_by_instructeur by hidden_by_administration 2022-01-03 11:51:25 +01:00
Kara Diaby
598cb09c6d tests 2021-12-29 17:37:58 +01:00
Martin
d0ab1711ff fix(profil_controller#update_email): ensure we are not merging same account
fix(profil_controller#update_email): changing email from current_user.email to current_user.email destroy current user. whoops ☠️'

Update config/locales/en.yml

Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>

Update config/locales/fr.yml

Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>

Update spec/controllers/users/profil_controller_spec.rb

Update config/locales/fr.yml

Co-authored-by: Pierre de La Morinerie <pierre.de_la_morinerie@beta.gouv.fr>

Update spec/controllers/users/profil_controller_spec.rb

fix(spec): broken due to typo
2021-12-29 13:36:47 +01:00
Paul Chavard
4e779f445d fix(instructeur): copy notifications settings from previous groupe instructeur
fix #6763
2021-12-23 13:55:25 +01:00
Christophe Robillard
f9609b0b0b fix zone specs
by reenabling task before the next spec is run
2021-12-23 09:58:31 +01:00
Pierre de La Morinerie
4efc1053f9 specs: make dossiers deletion specs more robust
It would fail when ran on some dates, like "21 Dec. 2021".
2021-12-21 17:20:32 +01:00
Christophe Robillard
822c754581 add namespace for populate_zones task 2021-12-16 17:20:06 +01:00
Christophe Robillard
882f92268c update zone to procedures 2021-12-16 17:20:06 +01:00
François Vantomme
14e0c68266 feat(api particulier): add MESRI field 2021-12-16 16:45:18 +01:00
François Vantomme
3d81d4b541 feat(api particulier): add MESRI adapter 2021-12-16 16:45:17 +01:00
François Vantomme
66a9109cd7 feat(api particulier): add MESRI support to sources service 2021-12-16 16:45:17 +01:00
Martin
b9d13df483 fix(spec): avoid flacky test. 15.days ago is not always on the previous month. eg: this spec failed on 16 of december, stats is still in december 2021-12-16 15:02:17 +01:00
Christophe Robillard
84c648eef0 manual task for populating zones 2021-12-15 19:37:32 +01:00
simon lehericey
c7f7855f14 avoid phishing 2021-12-15 13:51:49 +01:00