Commit graph

9663 commits

Author SHA1 Message Date
Pierre de La Morinerie
ac922c456e policies: refactor champ_policy_spec
Creating champs without attaching them to a procedure works only by
chance.
2020-04-02 11:27:13 +02:00
Paul Chavard
533b16b6ea
Merge pull request #4976 from tchak/fix-reassign-dossiers-group-instructeur
Reassign discarded dossiers on group_instructeur
2020-04-01 18:30:29 +02:00
Paul Chavard
c0bbfa42b7 Reassign discarded dossiers on group_instructeur
fix #4851
2020-04-01 18:10:12 +02:00
Paul Chavard
d55535b237
Merge pull request #4982 from tchak/prepare_for_more_deletions
Refactor notify near deletion mailers
2020-04-01 18:01:35 +02:00
Paul Chavard
7ba4c513e6 Refactor notify near deletion mailers 2020-04-01 17:40:52 +02:00
Paul Chavard
ccb884df6d
Merge pull request #4944 from tchak/discard-procedures
Discard/Undo Démarches and Dossiers in manager
2020-03-31 20:46:26 +02:00
Paul Chavard
288ace2f34 Dossier on discarded procedure should have access to discarded procedure 2020-03-31 17:08:29 +02:00
Paul Chavard
bd81970f67 DeletedDossier should have access to discarded demarche 2020-03-31 17:08:29 +02:00
Paul Chavard
e4ab2574ce Démarches discarded by administrateur can be reactivated in manager 2020-03-31 17:08:28 +02:00
Paul Chavard
58c126308c Add DiscardedProceduresDeletionJob job 2020-03-31 17:08:28 +02:00
Paul Chavard
da52ec30bd Undo discard dossiers and demarches from manager 2020-03-31 17:08:28 +02:00
Paul Chavard
876e05aed3 Discard demarches from manager 2020-03-31 17:08:28 +02:00
Paul Chavard
89f1f70f0d
Merge pull request #4968 from tchak/clean-up-deleted-dossiers
Clean up deleted dossiers
2020-03-31 17:06:34 +02:00
Paul Chavard
aa066bc20a Validate deleted dossiers dossier_id uniqueness 2020-03-31 16:54:33 +02:00
Paul Chavard
60cb9bcf09 Remove brouillons deleted dossiers 2020-03-31 16:54:33 +02:00
Pierre de La Morinerie
8dcbe5f47c
Merge pull request #4918 from betagouv/auto-upload
Usager : envoi automatique des pièces jointes au dossier (désactivé pour l'instant)
2020-03-31 13:30:18 +02:00
Pierre de La Morinerie
6417c0d2c0 dossiers: allow auto upload of attachments 2020-03-31 13:09:44 +02:00
Pierre de La Morinerie
a1083ca253 javascript: add some comments to the upload systems 2020-03-31 13:09:17 +02:00
Pierre de La Morinerie
2a1c91a2a5
Merge pull request #4960 from betagouv/fix-js-alerts
Javascript : mise à jour d'eslint et de ses dépendences
2020-03-31 13:08:56 +02:00
Pierre de La Morinerie
f4b15da26f js: upgrade eslint and dependencies
Fix vulnerabilities in acorn and minimist.
2020-03-31 13:00:39 +02:00
Pierre de La Morinerie
0f6f447a6c
Merge pull request #4961 from betagouv/remove-wait-for-ajax
Tests : suppression du helper inutilisé `wait-for-ajax`
2020-03-31 13:00:13 +02:00
Pierre de La Morinerie
7a27e78452 specs: remove unused wait-for-ajax helper
This helper is:
- no longer used;
- buggy (not all requests increment it);
- discouraged (we should instead match an UI change that signals the end
of an ajax request).

Good riddance.
2020-03-31 12:54:49 +02:00
Pierre de La Morinerie
34dc554748
Merge pull request #4940 from betagouv/improve-rspec-harness
Simplification de la configuration rspec
2020-03-31 12:54:28 +02:00
Pierre de La Morinerie
cae256fd28 rspec: allow Rails to auto-migrate the test schema
rails_helper already has `ActiveRecord::Migration.maintain_test_schema!`
which automatically updates the test database if needed.

However, if we raise **before** `maintain_test_schema` had the chance
to do its job, the test database is never-automigrated.

Thus by removing the check, we ensure the test database will be migrated
as needed (and still an error will be raised if the schema cannot be
applied).
2020-03-31 12:48:32 +02:00
Pierre de La Morinerie
4cb747fdb6 specs: always require rails_helper
Test helpers are separated between two files: spec_helper and
rails_helper. This separation is meant to allow tests that do not
require Rails (like testing standalone libs) to boot faster.

The spec_helper file is always loaded, through `--require spec_helper`
in the `.rspec` config file. When needed, the rails_helper file is
expected to be required manually.

This is fine, but:
- Many test files have a redundant `require 'spec_helper'` line;
- Many test files should require `rails_helper`, but don't.

Not requiring `rails_helper` will cause the Rails-concerned section of
the test environment not to be configured–which may cause subtle bugs
(like the test database not being properly initialized).

Moreover, Spring loads all the Rails files on preloading anyway. So the
gains from using only `spec_helper` are thin.

To streamline this process, this commit:
- Configures `.rspec` to require `rails_helper` by default;
- Remove all manual requires to spec_helper or rails_helper.

Reference: https://stackoverflow.com/questions/24145329/how-is-spec-rails-helper-rb-different-from-spec-spec-helper-rb-do-i-need-it
2020-03-31 12:48:32 +02:00
Paul Chavard
d6f6a076dd
Merge pull request #4963 from tchak/schedule-cron-jobs
Schedule cron jobs
2020-03-31 12:32:09 +02:00
Paul Chavard
742cc15209 Use base CronJob 2020-03-31 12:25:46 +02:00
Paul Chavard
5005c54891 Add base cron job 2020-03-31 12:25:46 +02:00
Paul Chavard
33bf2fe109 remove deprecated AutoReceiveDossiersForProcedureJob 2020-03-31 12:25:46 +02:00
Paul Chavard
39c47c21cf Remove explicit queue_as :default 2020-03-31 12:01:42 +02:00
Paul Chavard
44ec4a739c
Merge pull request #4964 from tchak/fix-expiration-tests
Use bigger deltas to allow for month length variations
2020-03-31 12:01:17 +02:00
Paul Chavard
c40d689edf Use bigger deltas to allow for month length variations 2020-03-31 11:50:59 +02:00
Paul Chavard
0c81e50c8c
Merge pull request #4962 from betagouv/fix-champs-editor-padding
champs editor: fix bottom padding of the list
2020-03-31 09:41:48 +02:00
Pierre de La Morinerie
54337a1603 editor: fix bottom padding of the list
Turns out Safari (and maybe IE) collapse the margins together. So we
need to give the footer an explicite height.

Fix #3570
2020-03-30 17:36:59 +02:00
Pierre de La Morinerie
2024465bc2
Merge pull request #4959 from betagouv/fix-attestation-preview
Administrateur : correction de la prévisualisation des attestations
2020-03-30 17:36:21 +02:00
Pierre de La Morinerie
ed5f2fa35f attestation: fix preview of logos
Turns out that assigning the params to the procedure calls `read` on the
images files. Calling `read` moves the seek offset to the end of the
file; which means that subsequent calls to `read` return an empty
string.

Fix the issue by calling `rewind` before attempting to `read` the file,
to ensure the seek offset is at the beginning of the file.

Fix #4958
2020-03-30 14:58:50 +02:00
Pierre de La Morinerie
b8c3d7c6bd attestation: ensure the PDF is rendered successfully 2020-03-30 14:58:50 +02:00
Pierre de La Morinerie
008181bfbf
Merge pull request #4954 from betagouv/pj-prepare-validations
Nettoyage des validations de PJ
2020-03-30 12:06:53 +02:00
Pierre de La Morinerie
fe13043efd dossier: prepare validations to piece_justificative champs
We can't yet enable the validations, because of an issue that will
(hopefully) be solved with Rails 6.

See https://github.com/betagouv/demarches-simplifiees.fr/issues/4926
2020-03-30 11:12:25 +02:00
Pierre de La Morinerie
f3c210e875 dossier: remove dead validation code
This code used to be called by CarrierWave, but is unused since the
migration to ActiveStorage.

This means that these validations are currently disabled though.
See https://github.com/betagouv/demarches-simplifiees.fr/issues/4926
2020-03-30 11:12:25 +02:00
Pierre de La Morinerie
245ef2befd specs: fix an Rspec warning 2020-03-30 11:12:25 +02:00
Keirua
bc68570244
Merge pull request #4956 from betagouv/4955-bandeau-coronavirus
#4955 - ajout d'un bandeau d'informations coronavirus
2020-03-27 15:55:09 +01:00
clemkeirua
6a22ba7036 #4955 - ajout d'un bandeau d'informations coronavirus 2020-03-27 15:33:03 +01:00
Paul Chavard
3120f94370
Merge pull request #4953 from tchak/fix-locales
Use ’ consistently instead of '
2020-03-26 18:03:20 +01:00
Paul Chavard
a60b6b6776 Use ’ consistently instead of ' 2020-03-26 17:27:48 +01:00
Paul Chavard
e333e2dce2
Merge pull request #4951 from tchak/fix-manager
Remove non-existant columns from manager dashboards
2020-03-26 16:35:25 +01:00
Paul Chavard
c763679b54 Remove non-existant columns from manager dashboards 2020-03-26 16:17:07 +01:00
Paul Chavard
953ebfe45a
Merge pull request #4943 from tchak/rename-delete-to-discard
Rename delete_and_keep_track -> discard_and_keep_track
2020-03-26 15:37:24 +01:00
Paul Chavard
c707a21f97 Rename delete_and_keep_track -> discard_and_keep_track 2020-03-26 14:23:23 +01:00
Pierre de La Morinerie
b974020785
Merge pull request #4881 from maatinito/issue/fc_requires_eidas
Spécification du niveau eIDAS lors des appels à France Connect
2020-03-26 14:21:40 +01:00