From 149d4c3846409ea5720a0abe96ad4781018b4e64 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 13 Jun 2022 09:46:45 +0200 Subject: [PATCH 01/13] changelog updated --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c479fe6b..f6654afcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to * [workflow]: added pagination to workflow list page * [homepage_widget]: null error on tasks widget fixed +* [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty ## Test releases From ceb0f741ef0a44edb4580023f6c08364f927a7e7 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 13 Jun 2022 15:05:18 +0200 Subject: [PATCH 02/13] order of birthdate fields changed in advanced search --- CHANGELOG.md | 3 ++- src/Bundle/ChillPersonBundle/Search/PersonSearch.php | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6654afcd..4ea0e2c0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,8 @@ and this project adheres to * [workflow]: added pagination to workflow list page * [homepage_widget]: null error on tasks widget fixed -* [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty +* [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty +* [search]: Order of birthdate fields changed in advanced search to avoid confusion. ## Test releases diff --git a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php index 08fdf072e..9b18ae244 100644 --- a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php +++ b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php @@ -82,14 +82,14 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf 'label' => 'Last name', 'required' => false, ]) - ->add('birthdate-after', ChillDateType::class, [ - 'label' => 'Birthdate after', - 'required' => false, - ]) ->add('birthdate', ChillDateType::class, [ 'label' => 'Birthdate', 'required' => false, ]) + ->add('birthdate-after', ChillDateType::class, [ + 'label' => 'Birthdate after', + 'required' => false, + ]) ->add('birthdate-before', ChillDateType::class, [ 'label' => 'Birthdate before', 'required' => false, From fec27babbe6b902b1de8a1b15ffac49c4e0b02b3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 13 Jun 2022 15:35:35 +0200 Subject: [PATCH 03/13] visual changes when option 'create household' is checked in user create form --- .../vuejs/Address/components/ShowPane.vue | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue index 4be073991..cc1c3b0e5 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue @@ -16,26 +16,30 @@
-

- {{ $t('not_yet_address') }} -

+
+ +

+ {{ $t('not_yet_address') }} +

+ + + + +
- - - - + + From f0187536c173da203cdef839e3242e52b125ecaf Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 13 Jun 2022 15:35:35 +0200 Subject: [PATCH 04/13] visual changes when option 'create household' is checked in user create form --- .../vuejs/Address/components/ShowPane.vue | 81 +++++++++++++------ 1 file changed, 58 insertions(+), 23 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue index 4be073991..4197079d4 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue @@ -15,27 +15,46 @@ {{ $t('wait_redirection') }} -
-

- {{ $t('not_yet_address') }} -

+
+
+ +

+ {{ $t('not_yet_address') }} +

+ + + + +
+
+ +
+ + +
- - - - + + From 4719a743078d73d224d1c06f982517fced5192fb Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 13 Jun 2022 17:35:21 +0200 Subject: [PATCH 05/13] constraint added to workflow transtion - cannot be null --- CHANGELOG.md | 1 + .../ChillMainBundle/Form/WorkflowStepType.php | 39 +++++++++++-------- .../translations/messages.fr.yml | 1 + 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ea0e2c0a..2ed9cdebf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to * [homepage_widget]: null error on tasks widget fixed * [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty * [search]: Order of birthdate fields changed in advanced search to avoid confusion. +* [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675) ## Test releases diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 9a2fd1b6c..3eba23b37 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -109,6 +109,7 @@ class WorkflowStepType extends AbstractType 'multiple' => false, 'expanded' => true, 'choices' => $choices, + 'constraints' => [new NotNull()], 'choice_label' => function (Transition $transition) use ($workflow) { $meta = $workflow->getMetadataStore()->getTransitionMetadata($transition); @@ -208,24 +209,28 @@ class WorkflowStepType extends AbstractType $transition = $form['transition']->getData(); $toFinal = true; - foreach ($transition->getTos() as $to) { - $meta = $workflow->getMetadataStore()->getPlaceMetadata($to); - - if ( - !array_key_exists('isFinal', $meta) || false === $meta['isFinal'] - ) { - $toFinal = false; - } - } - - $destUsers = $form['future_dest_users']->getData(); - $destEmails = $form['future_dest_emails']->getData(); - - if (!$toFinal && [] === $destUsers && [] === $destEmails) { + if (null === $transition) { $context - ->buildViolation('workflow.You must add at least one dest user or email') - ->atPath('future_dest_users') - ->addViolation(); + ->buildViolation('workflow.You must select a next step, pick another decision if no next steps are available'); + } else { + foreach ($transition->getTos() as $to) { + $meta = $workflow->getMetadataStore()->getPlaceMetadata($to); + + if ( + !array_key_exists('isFinal', $meta) || false === $meta['isFinal'] + ) { + $toFinal = false; + } + } + $destUsers = $form['future_dest_users']->getData(); + $destEmails = $form['future_dest_emails']->getData(); + + if (!$toFinal && [] === $destUsers && [] === $destEmails) { + $context + ->buildViolation('workflow.You must add at least one dest user or email') + ->atPath('future_dest_users') + ->addViolation(); + } } } ), diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index c5ab02d6b..376806292 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -463,6 +463,7 @@ workflow: Previous transitionned: Anciens workflows Previous workflow transitionned help: Workflows où vous avez exécuté une action. For: Pour + You must select a next step, pick another decision if no next steps are available: Il faut une prochaine étape. Choissisez une autre décision si nécessaire. Subscribe final: Recevoir une notification à l'étape finale From 0943366d39cac376b6f928eeace55d2495ecbdde Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 13 Jun 2022 17:59:29 +0200 Subject: [PATCH 06/13] only prefill agents traitants of action if parcours has a referrer, otherwise null --- CHANGELOG.md | 1 + .../EventListener/AccompanyingPeriodWorkEventListener.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ed9cdebf..9d9a0da1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to * [person-thirdparty]: fix quick-add of names that consist of multiple parts (eg. De Vlieger) within onthefly modal person/thirdparty * [search]: Order of birthdate fields changed in advanced search to avoid confusion. * [workflow]: Constraint added to workflow (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/675) +* [action]: Agents traitants should be prefilled with referrer of the parcours or left empty if there is no referrer (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/696) ## Test releases diff --git a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php index 83f9ca460..ba7a2bbc8 100644 --- a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php +++ b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php @@ -26,8 +26,9 @@ class AccompanyingPeriodWorkEventListener public function prePersistAccompanyingPeriodWork(AccompanyingPeriodWork $work): void { - if ($this->security->getUser() instanceof User) { - $work->addReferrer($this->security->getUser()); + $referrer = $work->getAccompanyingPeriod()->getUser(); + if (null !== $referrer) { + $work->addReferrer($referrer); } } } From a48b990c736786d36e83f26ae9f3fc63fed4619e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 14 Jun 2022 17:15:33 +0200 Subject: [PATCH 07/13] condition correction to fix display of addAddress btn in parcours and household tunnel --- .../public/vuejs/Address/components/ShowPane.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue index 4197079d4..0b2047a2a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue @@ -55,6 +55,21 @@ +
+ + + +
+