Commit graph

498 commits

Author SHA1 Message Date
Christophe Robillard
ea59f5f260 add opendata boolean attribute for procedure
when opendata is set to true, it means that descriptive's procedure can be
public
when opendata is set to false, ti means that descriptive's can not be
public, because the procedure is only available for public servants, not
citizens.
2022-06-23 14:11:09 +02:00
simon lehericey
9596dac508 force resync types_de_champ and types_de_champ_public/private 2022-06-17 14:54:21 +02:00
Kara Diaby
d58ecb3fcc Lors de la restauration d'une démarche supprimée, met sur les dossiers liés hidden_by_administration_at à nil 2022-06-10 12:33:47 +02:00
Kara Diaby
d2bd2ffcbe controller 2022-06-08 14:38:17 +02:00
Kara Diaby
60eed4ec01 model 2022-06-02 15:48:11 +02:00
Paul Chavard
462b2618a4 feat(procedure): move new children to new parent in transaction 2022-06-01 09:33:39 +02:00
Paul Chavard
c0a253078c fix(revision): fix clone démarches with repetitions 2022-05-31 13:28:56 +02:00
Paul Chavard
6f98def288 refactor(revision): remove old code 2022-05-31 08:58:53 +02:00
Kara Diaby
36aff57f24 model 2022-05-26 12:45:05 +02:00
Paul Chavard
b635952b2f refactor(revision): types_de_champ for export 2022-05-23 18:36:18 +02:00
Paul Chavard
b6ea44f7e7 refactor(revision): remove type_de_champ#revision_id 2022-05-17 11:31:49 +02:00
Paul Chavard
6adb3f7a3a fix(revision): fix migrate_parent! 2022-05-12 10:40:41 +02:00
Kara Diaby
d187b7e881 model 2022-05-10 16:16:16 +02:00
simon lehericey
4ec5b418cb fix create_new_revision 2022-05-06 12:37:59 +02:00
Martin
3737311390 feat(procedure.procedure_expires_when_termine_enabled): enable by default, allow contributor to choose the default settings of this flag using an env var during migration. ie: DEFAULT_PROCEDURE_EXPIRES_WHEN_TERMINE_ENABLED=true|false
feat(administrateurs/procedures#show): warning/alert when procedure_expires_when_termine_enabled is not true on current procedure

feat(administrateur/procedure#update): after an update redirect to procedure show: suggested by: https://ux.stackexchange.com/questions/55291/after-updating-form-should-redirect-back-to-form-itself-or-to-the-show-page-or-b and confirmed by Olivier

clean(Flipper.archive_zip_globale): no more in use, so remove all occurences

Update app/views/administrateurs/procedures/_suggest_expires_when_termine.html.haml

Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>

Update app/views/administrateurs/procedures/_suggest_expires_when_termine.html.haml

Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>

Update app/views/administrateurs/procedures/_suggest_expires_when_termine.html.haml

Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>

Update spec/views/administrateurs/procedures/show.html.haml_spec.rb

Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>

fix(review): typo, why ena?, who knows

fix(env.example.optional): add missing DEFAULT_PROCEDURE_EXPIRES_WHEN_TERMINE_ENABLED
2022-05-05 13:07:11 +02:00
simon lehericey
37e01ea399 re introduce revision_types_de_champ 2022-05-04 13:16:12 +02:00
simon lehericey
ea361643be types_de_champ -> types_de_champs_public 2022-05-03 11:05:24 +02:00
Martin
be090a1bec feat(administrateur/procedure#create): allow admin to add a lien to the DPO, allow user to consult link to dpo. enhance spec on _procedure_footer.html
Update spec/views/users/_procedure_footer.html.haml_spec.rb

Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2022-04-27 15:09:02 +02:00
Paul Chavard
23b60c87e9 fix(procedure): cloned procedure should not have auto_archive_on
fix #7149
2022-04-22 10:48:31 +02:00
simon lehericey
23707d6033 ignore file not found error when cloning procedure 2022-04-14 13:46:16 +02:00
Paul Chavard
706c648be8 refactor(procedure): remove unused code 2022-04-05 09:42:23 +02:00
Paul Chavard
c530399eac feat(procedure): display revisions diffs 2022-03-17 10:26:38 +01:00
Paul Chavard
54b559364a feat(dossier): replace discarded with visible_by_administration 2022-03-10 14:29:40 +01:00
Pierre de La Morinerie
a645c5781d models: delete AdministrateursProcedure when destroying Procedure 2022-03-08 09:20:34 +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
Paul Chavard
2d396fcfb7 feat(dossier): rebase dossiers en construction and en instruction 2022-02-18 17:08:38 +01:00
Paul Chavard
e269077c40 refactor(attestation_template): cleanup relationships 2022-02-11 08:45:32 +01:00
Paul Chavard
12151acb99 Revert "Revert "feat(attestation): revise attestations""
This reverts commit 4e7733e571.
2022-02-08 16:22:59 +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
Paul Chavard
4e7733e571 Revert "feat(attestation): revise attestations"
This reverts commit e413872530.
2022-01-25 18:26:34 +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
403e71b41f feat(procedure): only purge procedures without dossiers 2022-01-18 11:22:04 +01:00
Kara Diaby
1ca553e088 rename hidden_by_instructeur by hidden_by_administration 2022-01-03 11:51:25 +01:00
Paul Chavard
ad4be3c482 refactor(dossier): handle discard by admin and super admin 2022-01-03 11:51:25 +01:00
François Vantomme
14e0c68266 feat(api particulier): add MESRI field 2021-12-16 16:45:18 +01:00
François Vantomme
6ab8ac0662 feat (api particulier): add Pole emploi field 2021-12-08 10:36:25 +01:00
François Vantomme
2110ef072c feat(api particulier): add DGFiP field 2021-12-07 11:03:05 +01:00
Paul Chavard
5e0f8a5816 task(type_de_champ): migrate type_de_champ parent_id 2021-12-06 21:45:54 +01:00
Martin
ce87878ff0 refactor(traitement.process_expired): move process expired to procedure 2021-12-03 16:32:36 +01:00
Christophe Robillard
561f6fb274 add belongs_to zone for procedure 2021-12-02 19:23:05 +01:00
Pierre de La Morinerie
b7d17b0989 models: validate that no drop-downs are empty on publishing
Disallow publishing a procedure containing drop-downs with no selectable
values.
2021-12-02 09:00:37 +01:00
Pierre de La Morinerie
e219ec33d8 validators: rename no_empty_repetitions to no_empty_repetition 2021-12-02 09:00:37 +01:00
Pierre de La Morinerie
52b0fbf9b7 models: validate repetitions on publishing 2021-11-30 13:34:41 +01:00
Pierre de La Morinerie
48133c2595 models: don't save the procedure before the state transition
Otherwise a validation error occurs here instead of on save.
2021-11-30 13:34:41 +01:00
Pierre de La Morinerie
e5f5440663 models: explicitely save procedure's new revision
Deep-cloned objects have all their relationships stale. Thus, for a
newly deep-cloned revision, `revision.types_de_champs` returns `[]`,
even when it actually has associated types de champ.

This causes consecutive champs creations and re-ordering to fail in
subtle ways, like:

```
procedure.draft_revision.add_type_de_champ(…)
procedure.publish_revision!
procedure.draft_revision.add_type_de_champ(…)
procedure.draft_revision.move_type_de_champ(…) # this will fail
```

As `publish_revision!` created a new stale revision, moving the type
de champ fails because not all existing champs are found until the
object is refreshed.

We don't hit this path in production, because usually only a single
operation is made in a request.

To fix this, save the new revision before associating it as the draft
procedure.

(Another option would be to `reload` the revision after creation, but
this seems better contained and matches the name of the method.)
2021-11-25 08:49:17 +01:00
Pierre de La Morinerie
60c2718f29 models: remove custom code for file size validation message
With active_storage_validations 0.9.6, we can use the %{max_size}
variable directly in the error message.
2021-11-24 10:06:45 +01:00
Pierre de La Morinerie
2227dcc1e7 app: remove leftovers of procedure path autocomplete
We used to pre-validate the procedure, to display in advance if the path
could be used.

Now that the path autocomplete is long gone, we can remove this kludgy
code.
2021-11-23 14:30:21 +01:00
Paul Chavard
e74d599042 feat(procedure): remove duree_conservation_dossiers_hors_ds 2021-11-16 19:55:56 +03:00
Paul Chavard
f6b8689a97 fix(revisions): fix repetitions export with revisions 2021-11-03 18:20:48 +01:00
Paul Chavard
0e2f09dd6f fix(dossiers): wrap dossier discard in a transaction
By doing this we ensure that deleted_dossier are not created when dossier is not discarded
2021-11-02 18:17:35 +01:00
Paul Chavard
2a3a9dd822 feat(revisions): rebase dossiers brouillons 2021-10-20 17:26:09 +02:00
simon lehericey
7aee944daa show cnaf tdc when procedure is compatible 2021-10-12 14:27:20 +02:00
Paul Chavard
357c684688 feat(routage): self managing instructeurs 2021-09-27 15:06:17 +02:00
Paul Chavard
d4e8158887 feat(routing): add instructeurs_self_management_enabled to procedures 2021-09-27 15:06:17 +02:00
Ismael MOUSSA S
36dc9c2ca2 Add File Validation concern after refactoring 2021-09-21 12:11:20 -05:00
Ismael MOUSSA S
7c7c9c9ea4 Fix file size validation message 2021-09-21 12:11:20 -05:00
Ismael MOUSSA S
bdbb4deb87 ADD FILE_MAX_SIZE constant to set allow file size limit 2021-09-21 12:04:56 -05:00
Paul Chavard
0ff62c5a5e feat(routage): add routing_enabled to procedures 2021-09-18 11:22:35 +02:00
simon lehericey
b000590d81 add api particulier sources to procedure 2021-09-17 13:50:23 +02:00
simon lehericey
6c6205e188 a cloned procedure to a different admin does not keep api_particulier token and scopes 2021-09-16 09:30:11 +02:00
simon lehericey
2d2ae3a878 add api particulier scopes to procedure 2021-09-16 09:30:11 +02:00
Pierre de La Morinerie
745e19bb8e localize 2021-09-16 09:07:47 +02:00
simon lehericey
b29bae4707 a procedure has an encrypted api_particulier_token
Co-authored-by: François VANTOMME <akarzim@gmail.com>
2021-07-30 11:18:44 +02:00
Christophe Robillard
bc07a875eb integrate a mininum weight for the average dossier weight
before this commit, the average dossier weight took account only pieces
justificatives. With this commit, we add a minimum weight for other
files included in an archive like pdf_export, log operations,
attachments added to traitements. This minimum weight is set arbitrary,
from the observation of some random procedures in production
2021-07-06 15:58:45 +02:00
Paul Chavard
ce27999bc3 Refactor clone_attachments 2021-07-01 16:21:46 +02:00
Paul Chavard
280e54b59d Enable test revisions 2021-07-01 15:59:07 +02:00
Paul Chavard
15ff046428 Improuve revision changes messages 2021-06-24 11:39:49 +02:00
Paul Chavard
241eff76a3 Enable publish new revision only if some changes are found 2021-06-24 11:39:49 +02:00
Paul Chavard
0ca5e1abe2 Preview should reflect revision changes 2021-06-24 11:39:49 +02:00
Paul Chavard
35eccb5630 Show separate blocks for types de champ and annotation changes 2021-06-23 09:40:07 +02:00
Paul Chavard
19195008e8 Expose removed types_de_champ in exports 2021-06-23 09:40:07 +02:00
simon lehericey
eadae7af6b show all available tdc for procedure presentation 2021-06-23 09:40:07 +02:00
Paul Chavard
0d25f52309 Add changed? and compare on ProcedureRevision 2021-06-23 09:40:07 +02:00
Paul Chavard
15e9013264 Set published_at on revision when publishing a procedure 2021-06-23 09:40:07 +02:00
Christophe Robillard
a8840faadb move stats methods to appropriate concern class 2021-06-17 16:31:53 +02:00
Christophe Robillard
45ffae9eb3 affiche evolution temps de traitement 2021-06-17 16:31:53 +02:00
Christophe Robillard
701b72494d compute usual traitement time for specific month 2021-06-17 16:31:53 +02:00
Christophe Robillard
169f254c79 infer champ type from class 2021-06-09 10:52:38 +02:00
Christophe Robillard
5e180268cd remove one sql query 2021-06-09 10:52:38 +02:00
simon lehericey
9e43823f9a add average_dossier_weight
Co-authored-by: Christophe Robillard <christophe.robillard@beta.gouv.fr>
2021-06-09 10:52:38 +02:00
Paul Chavard
1888f74b10 Prevent double processing of declarative dossiers 2021-06-04 17:55:40 +02:00
Paul Chavard
f526e303e8 Apply suggestions from code review
Co-authored-by: Pierre de La Morinerie <kemenaran@gmail.com>
2021-06-03 13:11:16 +02:00
Paul Chavard
3fb10fb4b8 Set published_at on revision when publishing a procedure 2021-06-03 13:11:16 +02:00
Paul Chavard
acb277e650 Use stable_id when replacing tags 2021-05-25 11:43:38 +02:00
Paul Chavard
f6508899de Refactor NotificationMailer 2021-05-04 12:05:06 +02:00
Christophe Robillard
f40d96fbd2 Revert "Revert "Export de tous les dossier d'une démarche""
This reverts commit d9a588b52e.
2021-04-29 17:29:47 +02:00
krichtof
d9a588b52e
Revert "Export de tous les dossier d'une démarche" 2021-04-29 16:07:18 +02:00
Christophe Robillard
8b2849408c instructeurs can create and download archives 2021-04-28 11:40:58 +02:00
Pierre de La Morinerie
0cb2162a65 db: fix out-to-date Procedure comments 2021-04-27 15:36:22 +02:00
kara Diaby
541a36abbf Add boolean to procedures table 2021-04-19 10:23:45 +02:00
Paul Chavard
f152c51d12 Remove ignored_columns 2021-04-13 17:00:07 +01:00
simon lehericey
594cda3ee3 Remove previous attempt but steal its spec 2021-04-13 09:32:48 +02:00
Paul Chavard
23104f15a4 Fix export n+1 queries 2021-03-25 19:22:12 +01:00
Paul Chavard
84214f4bd4 Do not export non exportable champs on draft procedures 2021-03-23 09:55:37 +01:00
Paul Chavard
70500e3d56 Groupe instructeur selector default blank 2021-03-09 14:47:23 +01:00
Christophe Robillard
6169399a6b fix limit date for notice validation 2021-03-05 08:34:39 +01:00
Christophe Robillard
7f496c43e5 no validation for old procedures 2021-03-04 16:13:19 +01:00