Commit graph

2002 commits

Author SHA1 Message Date
Paul Chavard
5e0f8a5816 task(type_de_champ): migrate type_de_champ parent_id 2021-12-06 21:45:54 +01:00
Paul Chavard
09c37435ad feat(procedure_revision_types_de_champ): add parent_id 2021-12-06 21:45:54 +01:00
Paul Chavard
0036933425 feat(graphql): add commune and departement information to API 2021-12-06 21:01:28 +01:00
Paul Chavard
fcbe364ac8 feat(commune): display departement information on commune champ 2021-12-06 21:01:28 +01:00
Paul Chavard
2ba05bfb4f fix(dossier): use depose_at instead of en_construction_at 2021-12-06 15:49:17 +01:00
Martin
081d5094a9 feat(instructeurs/procedure/dossiers#extend_conservation): add extends duree conservation in action button list, also rewire this action for user [extend by procedure.duree_conservation_dans_ds by default] but force 1.month for instructeur. add new icon for standby based on https://en.wikipedia.org/wiki/Power_symbol 2021-12-06 07:20:01 +01:00
Martin
d8a8d1fdab feat(instructeur/dossier/header/_expiration_banner): split trads and add dedicated expiration banner for instructeur. also enhance wording to include duree conservation + extension_conservation
feat(expiration_banner): enhance wording of expiration

feat(dossiers/expiration_banner): enhance wording regarding expiration to include duree_conservation_dossiers_dans_ds + extension_conservation, also add spec on expiration_banner for instructeur
2021-12-06 07:05:17 +01:00
Martin
1bb868714c fix(spec/lint/review): lint and fix spec of previous commits, also fix based on tchak feedback 2021-12-06 07:05:17 +01:00
Martin
d87f8b57cc feat(instructeurs/procedures#show): add dossier experiant in procedure#show 2021-12-06 07:05:17 +01:00
Martin
2dfbc70d41 feat(instructeur#dossiers_count_summary): add counter for expirants. ignore brouillon 2021-12-06 07:05:17 +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
Christophe Robillard
219eaf0d5e add zone model 2021-12-02 19:16:11 +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
Martin
725521c3a1 fix(expiration_banner): only show expirations info when flip is enabled
fix(lint): lint haml

fix(spec): enable flipper and allow procedure to receive flipper check when checking banner presence

fix(doc): add missing documentation on readme regarding system testing with a visual feedback

fix(typo): add missing accent

clean(PR): feedback from Tchak, better to wrap feature check for expirability by procedure within dossier.expirable? helper
2021-11-30 16:05:32 +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
simon lehericey
5a0fb6237f 😭 AASM does not support keyword arguments
https://github.com/aasm/aasm/issues/672
2021-11-30 09:42:45 +01:00
Pierre de La Morinerie
184a401182 app: rename new_administrateur to administrateurs 2021-11-30 08:49:38 +01:00
Martin
cf82c030e8 hotfix(scoping): try to avoid requesting archived: false when using termine scope, use state_termine instead 2021-11-26 15:09:53 +01:00
Martin
970e43efb8 feat(stats#index): update Stat model to also query DossierDeleted in stats computation
tech(question): discard_and_keep_track! ; are we really keeping track with default_scope { kept } ?

feat(stats): add DeletedDossier in Stat computations

Revert "tech(question): discard_and_keep_track! ; are we really keeping track with default_scope { kept } ?"

This reverts commit d1155b7eeaaf1a9f80189e59667e109541fcb089.

feat(stats): support deleted_dossiers for last_four_months_hash and cumulative_hash. extract sanitize query & merge hashes in methdos

clean(rubocop): lint with rubocop

Update db/migrate/20211126080118_add_index_to_deleted_at_to_deleted_dossiers.rb

Co-authored-by: LeSim <mail@simon.lehericey.net>

fix(rubocop): avoid uneeded allocation

fix(migration): add concurrent index with expected synthax

fix(brakeman): add ignore message since group date_trunc evaluation is used by only ourself
2021-11-26 13:29:40 +01:00
kara Diaby
eaac293da3 add a new tab traités on user dossiers 2021-11-26 09:45:13 +01:00
Paul Chavard
d847775c68 feat(traitements): add depose_at to dossiers 2021-11-25 12:57:55 +03:00
Paul Chavard
1f1dd9fce5 fix(traitements): add missing traitements to dossiers when reverting a decision 2021-11-25 12:57:55 +03: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
mfo
e7d9d047fe
Merge branch 'main' into 6649-etq-usager-instructeur-rendre-la-suppression-plus-visible 2021-11-24 14:07:32 +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
simon lehericey
5234a1854c manage AgentConnect callback 2021-11-23 14:17:59 +01:00
simon lehericey
1926a630f9 add agent_connect_id to instructeur 2021-11-23 14:17:59 +01:00
simon lehericey
898df449d4 redirect to AgentConnect 2021-11-23 14:17:59 +01:00
Martin
b6adf5fc72 feat(dossiers/show): enhance header with expirations message/banner. also ensure consistent design between dossier states
fix(spec): broken due to last refactoring

spec(dossier.extend_conservation): add system spec

lint(ruby): still not yet ready for auto lint in IDE...
2021-11-23 05:50:25 +01:00
Martin
a9978fb70b clean(code): move mfo comment to its rightful place 2021-11-19 14:34:20 +01:00
Martin
608a85148f feat(Dossier.close_to_expiration): add method to find any kind of dossier close to expiration [reuse previous scopes], add missing spec to termine_close_to_expiration, complement spec for each kind of expiration scope with general close_to_expiration spec 2021-11-19 14:28:54 +01:00
Martin
d8257284ef tech(refactor): extract states close to expiration within their scope. 2021-11-19 14:07:47 +01:00
Martin
1d721f14a0 fix(spec): get back to stable state 2021-11-19 12:36:03 +01:00
Martin
646459a1da fix(spec): at least let us start from a green suite 2021-11-18 18:15:57 +01:00
Paul Chavard
df474b60cf WIP 2021-11-18 18:58:17 +03:00
Paul Chavard
ae09b37e72 fix(champs): save departement info on champ commune 2021-11-17 14:52:47 +03:00
mfo
82b23b92c0
Merge branch 'main' into 6624/etq-instructeur-je-souhaite-supprimer-des-messages-envoyes-par-erreur 2021-11-17 05:41:56 +01:00
Paul Chavard
e74d599042 feat(procedure): remove duree_conservation_dossiers_hors_ds 2021-11-16 19:55:56 +03:00
Paul Chavard
04e67ea20a fix(dossier): add instructeur email to traitements when available 2021-11-16 19:00:20 +03:00
mfo
1d174df2ec
Merge branch 'main' into 6624/etq-instructeur-je-souhaite-supprimer-des-messages-envoyes-par-erreur 2021-11-16 16:37:15 +01:00
Martin
f0950b592b clean(CommentaireService): extract soft delete within controller. returning an instance with an error[:base] is not persisted with validation : avoid poluting stuff 2021-11-16 16:13:11 +01:00
Martin
8bbd77f89f refactor(mail.delay): use simplier implementation using after_action to prevent email delivery with delay 2021-11-16 15:12:05 +01:00
Martin
0aecc301c9 refactor(Commentarie.soft_delete): use discard 2021-11-16 14:28:38 +01:00
simon lehericey
e3c1e19424 include hidden dossier in merge 2021-11-15 23:14:41 +01:00
Martin
ddabed0c7e fix(refactor): continue to revert to past implementation. now use a job instead of calling deliver_later(wait: 5.minutes) [was not a satisfying implementation] 2021-11-15 15:45:48 +01:00
Martin
5534c3fbd6 fix(refactor): forgot to cleanup former implementation 2021-11-15 15:43:51 +01:00