Commit graph

370 commits

Author SHA1 Message Date
Paul Chavard
990c867c2e [GraphQL] Add more filters to dossiers 2019-11-07 22:07:42 +01:00
Paul Chavard
2a61ed5b1c Export etablissement information in csv
fix #4440
2019-11-07 14:27:52 +01:00
Pierre de La Morinerie
a462edb9bc instructeurs: alias instructeur.email
This also means we need to replace instances of `pluck` on the email
column.
2019-11-04 10:44:24 +01:00
Paul Chavard
839b0d7e6d Add Entreprise raison sociale to dossier export
fix #4422
2019-10-31 17:11:46 +01:00
Paul Chavard
86b271997b Invite experts to linked dossiers
closes #3669
2019-10-23 13:10:09 +02:00
simon lehericey
5897464224 Build Dossier champ only once 2019-10-17 15:48:14 +02:00
simon lehericey
451387d32d Dossier: add conditions on joins for with_notifications scope 2019-09-26 15:46:20 +02:00
Nicolas Bouilleaud
03c950ea97 Move followed_dossiers_with_notifications to a Dossier scope
Instead of instructeur.followed_dossiers_with_notifications, we can now write instructeur.followed_dossiers.with_notifications.

Yay composition!
2019-09-25 14:10:00 +02:00
Nicolas Bouilleaud
a4166d3c57 Refactor Instructeur.notifications_* methods
- rename `dossiers_id_with_notifications` to `followed_dossiers_with_notifications`,
- rename `notifications_per_procedure` to `procedures_with_notifications`,
- return an ActiveRecord::Relation instead of the result of the query, so that the call place can compose it,
- `merge` with the wanted Dossier scope in the call places, don’t bother passing it as a parameter,
- use the “state” (now “scope”) parameter as a scope method that can be just applied on `Dossier`.
2019-09-25 14:10:00 +02:00
Paul Chavard
eb7aba18e6 Add dossier champs and annotations types 2019-09-24 10:47:21 +02:00
Paul Chavard
2e854f2ac3 Add graph loading scopes to Dossier and Procedure 2019-09-24 10:47:21 +02:00
simon lehericey
faddbc23ef Eager load procedure: :groupe_instructeurs for export 2019-09-19 12:30:12 +02:00
simon lehericey
a2f82ab8be Add groupe_instructeur_label to export v2 2019-09-19 12:30:12 +02:00
simon lehericey
9b16bd2037 Dossier: retrieve all dossiers for a procedure 2019-09-18 15:51:02 +02:00
Paul Chavard
88842918f9 Prepare to drop columns 2019-09-17 12:37:37 +02:00
Paul Chavard
3b8d3b7967 Add Style/CollectionMethods to rubocop 2019-09-12 14:48:18 +02:00
Paul Chavard
3eb3ae001e Rename “Passé en construction le” to 'Déposé le' for clarity 2019-09-10 14:59:10 +02:00
simon lehericey
3cc8f0c792 Link Dossier and GroupeInstructeur 2019-09-03 06:47:02 +02:00
simon lehericey
3fde2a6f70 Rename gestionnaire in code to instructeur 2019-08-12 13:47:01 +02:00
clemkeirua
1e6847bc6f introduce constants for M./Mme 2019-08-01 17:42:32 +02:00
clemkeirua
d7105cb6f8 added spec for dossier#update_with_france_connect 2019-08-01 17:42:32 +02:00
clemkeirua
707e8a0004 dossier_controller#new uses info from FC if any 2019-08-01 17:42:32 +02:00
clemkeirua
f5d3818e3c remove unnecessary retransition methods 2019-08-01 10:40:08 +02:00
clemkeirua
38b48f4217 transition from accepte to instruction as superadmin 2019-08-01 10:29:51 +02:00
Paul Chavard
b266915892 Add repetitions to api 2019-08-01 10:04:35 +02:00
Paul Chavard
fba195c0b5 Add attestation url to dossier on api 2019-07-31 18:30:40 +02:00
Paul Chavard
ab1170bcfc Fix export dossier n+1 query 2019-07-30 17:17:36 +02:00
Pierre de La Morinerie
ea1c8ea7e3 models: remove associations to old pieces justificatives 2019-07-30 16:11:17 +02:00
Pierre de La Morinerie
f69f325236 api: remove export of old pieces justificatives 2019-07-30 16:11:17 +02:00
Pierre de La Morinerie
e975fe4ade tasks: remove task to migrate old pieces justificatives 2019-07-30 16:11:17 +02:00
clemkeirua
d62740c198 extraction de la taille max des fichiers dans une constante 2019-07-18 17:19:39 +02:00
Pierre de La Morinerie
a8354bd103 dossiers: unify deletion of dossiers between manager and user
The code paths for deleting a dossier were different, depending on
whether the dossier was deleted by the user, or from the Manager.

This commit unifies the two code paths into one.

This has the effect of:

- An operation log is now recorded when an user deletes its own dossier;
- Gestionnaires are now notified even when the dossier is deleted from
  the Manager;
- The `support:delete_user_account` task now requires the email address
  of the author.
2019-07-16 16:22:20 +02:00
clemkeirua
25f81f1d3c download a dossier as zip with all attachments 2019-07-16 09:11:25 +02:00
Pierre de La Morinerie
d5f360c85f manager: fix the deletion email not being sent
When deleting a dossier from the manager, the deletion notification
email was not being sent. This is because the returned object from
`Dossier#hide!` was invalid.
2019-07-15 10:01:16 +02:00
Pierre de La Morinerie
35c3795f56 dossier: make messagerie available on archived procedures
An Admin may archive a procedure to make it unavailable to
the general public, but before all dossiers are handled. In this case,
the messagerie needs to be available.

Fix #4089
2019-07-11 15:37:04 +02:00
Pierre de La Morinerie
fdca7c025a procedure: ignore :expects_multiple_submissions on the correct model 2019-07-11 12:14:25 +02:00
Paul Chavard
3cb39c2840 Refactor message attachements to use active_storage 2019-07-10 15:35:29 +02:00
Pierre de La Morinerie
ecfccae6f0 dossiers: remove support for Dossier#expects_multiple_submissions 2019-07-09 14:50:11 +02:00
Paul Chavard
ad0a74ea7c Fix dates in dossiers export 2019-07-09 10:02:08 +02:00
Paul Chavard
e582ff729c Add aasm to dossiers state 2019-07-03 13:37:27 +02:00
simon lehericey
b2c987ff0d [fix #3683] Dossier: add repasser_en_instruction! 2019-07-02 18:40:20 +02:00
Paul Chavard
fb0ef15e3c Export dossiers v2 2019-07-02 14:20:29 +02:00
Paul Chavard
46c1bbbc6f Official support for declarative demarches 2019-07-02 14:12:26 +02:00
Nicolas Bouilleaud
bd47bf2691 Disable Messagerie in archived Dossiers and procedures
* Use the existing Dossier#messagerie_available? method
* Raise when attempting to build a Commentaire if not messagerie_available?
* Disable the Messagerie form if not messagerie_available?
* Add tests :)
* Tweak the Horaires formatting while we’re here.
2019-07-01 09:39:39 +02:00
Paul Chavard
0d80c48b7e Add avis to api 2019-06-27 14:40:17 +02:00
Nicolas Bouilleaud
7e80b8a4dc Enable the Rails/InverseOf cop and add missing inverse_of 2019-06-17 13:44:07 +02:00
Pierre de La Morinerie
51aacabf13 models: fix touch not propagating when using nested attributes
Sometimes, when using nested attributes, touch doesn’t propagate to
parent relationships. (see https://github.com/rails/rails/issues/26726)

Specifically, this happens in our app when updating a dossier with
only new attachements (but without changing the value of any fields).

To work around this, we need to define the parent relationship
explicitely. This is good practice anyway.

Fix #3906
2019-06-17 13:44:07 +02:00
Nicolas Bouilleaud
6b90bc1ea1 Add “previously followed” dossiers and gestionnaires
Using an “inactive” Follow scope, similar to the “active” scope.

(I was tempted to use a default_scope, but this breaks when trying to `unscope` it in associations.)
2019-06-12 17:33:53 +02:00
Nicolas Bouilleaud
be4c575622 Add Follow.unfollowed_at
The active scopes is used indirectly in the dossier<->gestionnaire associations: the existing tests in dossier and gestionnaire just work™.
2019-06-12 17:33:53 +02:00
Paul Chavard
d5911071f8 Return dossiers on api with stable order 2019-06-04 15:34:49 +02:00