Commit graph

9862 commits

Author SHA1 Message Date
clemkeirua
0c2ccb4ae0 added automated tests for PDF rendering
- as a user, it should not display the administration info
 - as an instructeur, it should display the administration info
 - it should render the proper view with no crash
2020-01-14 09:29:29 +01:00
clemkeirua
8da1185a5d ajout des dates de changement de statut 2020-01-14 09:29:29 +01:00
clemkeirua
18e21f75c9 Retours de code review
- message_date_with_year systématique pour les messages
 - tous les commentaires sont affiché
 - gestion du champ 'Explication'
2020-01-14 09:29:29 +01:00
clemkeirua
cf385e326c infos usagers, entreprise et champ siret 2020-01-14 09:29:29 +01:00
clemkeirua
bc506bf693 ajout d'un lien d'export pdf usager 2020-01-14 09:29:29 +01:00
clemkeirua
b153b0e5e2 modification du lien d'export pdf instructeur 2020-01-14 09:29:29 +01:00
clemkeirua
85d4adbf8b ajout de l'export pdf pour instructeur 2020-01-14 09:29:29 +01:00
clemkeirua
a2d53bb400 ajout de la gem prawn 2020-01-14 09:29:29 +01:00
Keirua
1c56d1477f
Merge pull request #4681 from betagouv/feat/revert-adresse
Revert "Merge pull request #4552 from tchak/champ-communes"
2020-01-13 16:35:53 +01:00
clemkeirua
4373cb22cb Revert "Merge pull request #4552 from tchak/champ-communes"
This reverts commit 4cec26f73a, reversing
changes made to 0ef25ef36c.
2020-01-13 16:26:27 +01:00
Keirua
c9ac7294f5
Merge pull request #4674 from betagouv/4127-superadmin-supprime-compte-usager
4127 superadmin supprime compte usager
2020-01-13 10:28:51 +01:00
Christophe Robillard
d289c21a8b speak english for test descriptions 2020-01-13 10:06:43 +01:00
Christophe Robillard
0f881f942b raise if trying to del a user who can't be deleted 2020-01-13 10:06:43 +01:00
Christophe Robillard
696a058280 delete adminis with procs managed by other admins 2020-01-13 10:06:43 +01:00
Christophe Robillard
a0b4d97d08 fix rubocop offenses 2020-01-13 10:06:43 +01:00
Christophe Robillard
c72ce977f7 refactor delete_user_account task 2020-01-13 10:06:43 +01:00
Christophe Robillard
9a62d3fe0c delete a user 2020-01-13 10:06:43 +01:00
Christophe Robillard
58ef36ff57 tells if a user can be deleted 2020-01-13 10:06:43 +01:00
Pierre de La Morinerie
8d2d66a2b6
config: fix France Connect callback URL when testing locally (#4673)
Correction de l'URL locale de France Connect sur les environnements de développement
2020-01-08 15:48:12 +01:00
Pierre de La Morinerie
f04fb3830c config: fix France Connect callback URL when testing locally
When testing France Connect on a local development environment, the
callback URL should be something like `http://localhost:3000/…/…`

But currently, the callback URL uses `https`, even in development. This
causes the callback URL to be rejected by France Connect.

This commit overrides the callback URL when in development, to use
an `http` URL instead. In doesn't affect the production settings.
2020-01-08 15:44:49 +01:00
Paul Chavard
cfdaa95c0c
Merge pull request #4548 from tchak/fix-ativestorage-url-expiration
ActiveStorage url should expire after an hour
2020-01-08 15:10:47 +01:00
Paul Chavard
c6326bfa77 Fix tests involving attachment urls 2020-01-08 14:46:18 +01:00
Paul Chavard
785a09b326 Use service_url instead of blob_url on secure attachments 2020-01-08 14:43:05 +01:00
Paul Chavard
cccb04d725 ActiveStorage url should expire after an hour 2020-01-08 14:43:05 +01:00
Pierre de La Morinerie
b5c663e01c
Refactor individual creation (#4670)
Nettoyage de la création des objets `Individual`
2020-01-08 14:20:42 +01:00
Pierre de La Morinerie
b3558c497d dossiers: make build_default_individual explicit
It avoid the use of callbacks, and may avoid situations where an empty
individual is implicitely created.
2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
5e05556ee8 dossiers: add a validation on dossier individual
Validate that a dossier on a `for_individual?` procedure always has
an `individual` associated record.

For this, the individual needs to be built before the record is
validated (i.e. even before the `before_create` callback is run).

This should help with #4596: now if a dossier is created without an
`individual`, or if the `invividual` record is later removed, the
validation will fail.
2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
e32a42cfe6 dossiers: split the dossier creation on several lines 2020-01-08 10:48:22 +01:00
Pierre de La Morinerie
5b2311c851 dossiers: rescue RecordNotFound only for procedures
This ensures that we won't rescue an `ActiveRecord::RecordNotFound`
exception related to another object.
2020-01-08 10:48:21 +01:00
Pierre de La Morinerie
7f5b0d8bf3 specs: don't create an implicit brouillon in all test cases 2020-01-07 17:59:11 +01:00
Pierre de La Morinerie
630c6de967 specs: move the query for individual to the individual context 2020-01-07 17:59:11 +01:00
Paul Chavard
4cec26f73a
Merge pull request #4552 from tchak/champ-communes
Add champ communes and make all location champs autocomplete
2020-01-07 17:25:50 +01:00
Paul Chavard
e61e39d345 Remove unused code and tests 2020-01-07 11:52:51 +01:00
Paul Chavard
ff46ee366e Fix user brouillon spec 2020-01-07 11:52:51 +01:00
Paul Chavard
4bbd16576b Add champ communes 2020-01-07 11:52:51 +01:00
Paul Chavard
22aa2d4ee0 Make all location champs autocomplete 2020-01-07 11:52:51 +01:00
Paul Chavard
0ef25ef36c
Merge pull request #4649 from tchak/cleanup-archive
Cleanup demarche archivee state
2020-01-07 11:51:33 +01:00
Paul Chavard
fa2eea81aa Cleanup demarche archivee state 2020-01-07 11:13:42 +01:00
Keirua
4527124755
Merge pull request #4668 from betagouv/strike-banner-feature-flip
Put the strike banner behind a feature-flip
2020-01-07 10:19:50 +01:00
clemkeirua
4f604c8b0a put the strike banner behind a feature-flip 2020-01-06 15:25:43 +01:00
Paul Chavard
71a3e464b4
Merge pull request #4660 from betagouv/fix-autocorrect-exception
sign_up: fix suggestions error when navigating away
2019-12-19 18:30:48 +01:00
Pierre de La Morinerie
a5f2c84cbf sign_up: fix suggestions error when navigating away
When navigating away from the page, the field receives the 'focusout'
event – but stops to be present in the DOM.

Thus we need to check that the DOM element is actually present.
2019-12-19 17:45:14 +01:00
Pierre de La Morinerie
fccbbdf53a
Fix dossier AASM exceptions (#4657)
Instructeur : meilleur messages lorsque le changement d’état d’un dossier échoue
2019-12-19 15:34:28 +01:00
Pierre de La Morinerie
8eb295d67e dossiers: avoid exceptions on invalid AASM transitions
When attempting an invalid transition on a dossier, provide a meaningful
error message (instead of letting an `AASM::InvalidTransition` exception
propagate).

This handles not only the case where the same state is applied twice
(which was already handled manually), but all cases where the transition
is invalid.
2019-12-19 13:25:32 +01:00
Pierre de La Morinerie
c7a307553c helpers: allow dossier_display_state to take a state as input
This allow to use either:

- `dossier_display_state(dossier)`
- `dossier_display_state(:en_construction)`
2019-12-19 13:22:40 +01:00
Paul Chavard
0b54af822f
Merge pull request #4655 from betagouv/dependabot/bundler/rack-2.0.8
build(deps): bump rack from 2.0.7 to 2.0.8
2019-12-19 09:45:50 +01:00
dependabot[bot]
94736e4f27
build(deps): bump rack from 2.0.7 to 2.0.8
Bumps [rack](https://github.com/rack/rack) from 2.0.7 to 2.0.8.
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/2.0.7...2.0.8)

Signed-off-by: dependabot[bot] <support@github.com>
2019-12-18 23:28:28 +00:00
LeSim
3cd2296c52
Merge pull request #4650 from betagouv/fix_typo_in_job_name
Fix typo in purges_stale_exports_job filename
2019-12-18 13:43:31 +01:00
simon lehericey
2ee559c748 Fix typo in purges_stale_exports_job filename 2019-12-18 13:35:04 +01:00
LeSim
05ebb3f14e
Merge pull request #4632 from betagouv/export_uses_groupe_instructeur
Rend l'export de dossier compatible avec les procédures routées
2019-12-18 13:17:56 +01:00