From 4dd9bc11237e7af3543108c43d92fe62a532eb73 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 14:22:20 +0100 Subject: [PATCH 01/11] doc generation: do not set required fields for mainPerson, person1, person2 --- .../Service/DocGenerator/AccompanyingPeriodContext.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index fc19b6590..ddbc66f27 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -165,6 +165,7 @@ class AccompanyingPeriodContext implements }, 'multiple' => false, 'expanded' => true, + 'required' => false, 'label' => $options[$key . 'Label'], ]); } From 692343aae427786be4095aa8c23156a1d4956ba7 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 14:24:12 +0100 Subject: [PATCH 02/11] doc generation: add age and obele in the mainPerson, person1 and person2 list + add obele in person renderString if addAge --- .../Service/DocGenerator/AccompanyingPeriodContext.php | 2 +- .../ChillPersonBundle/Templating/Entity/PersonRender.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index ddbc66f27..96db9c2bd 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -161,7 +161,7 @@ class AccompanyingPeriodContext implements 'class' => Person::class, 'choices' => $persons, 'choice_label' => function (Person $p) { - return $this->personRender->renderString($p, []); + return $this->personRender->renderString($p, ['addAge' => true]); }, 'multiple' => false, 'expanded' => true, diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php index 0898bc32a..05b7e46c9 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php @@ -83,6 +83,13 @@ class PersonRender extends AbstractChillEntityRender . $this->addAltNames($person, false) . ' (' . $this->translator->trans('years_old', ['age' => $person->getAge()]) . ')'; } + if (null !== $person->getDeathDate() && $options['addAge']) { + return $person->getFirstName() . ' ' . $person->getLastName() + . ' (‡)' + . $this->addAltNames($person, false); + } + + return $person->getFirstName() . ' ' . $person->getLastName() . $this->addAltNames($person, false); } From c19099e76c14f36866680bed0ea14ff32ea9c5db Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 14:28:37 +0100 Subject: [PATCH 03/11] upd CHANGELOG --- CHANGELOG.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92e765829..c66f238af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,10 @@ and this project adheres to ## Unreleased -* [person] accompanying course work: fix on-the-fly update of thirdParty +* [doc-generator] do not set required fields for mainPerson, person1, person2 (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement#456) +* [doc-generation] add age and obele in the mainPerson, person1 and person2 list + add obele in person renderString if addAge (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/370) + +* [person] accompanying course work: fix on-the-fly update of thirdParty * [on-the-fly] close modal only after validation * [person] correct thirdparty PATCH url + add email and altnames in AddPerson and serializer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/433) * change order for accompanying course work list @@ -34,7 +37,7 @@ and this project adheres to * [parcours]: validation + message for closing parcours adjusted. * [household]: household composition double edit button replaced by a delete action (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/426) [fast_actions] improve fast-actions buttons override mechanism, fix https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/413 -[homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc. +[homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc. * [person]: Comment on marital status is possible even if marital status is not defined (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/421) * [parcours]: In the list of person results the requestor is not displayed if defined as anonymous (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/424) * [bugfix]: modal closes and newly created person/thirdparty is selected when multiple persons/thirdparties are created through the modal (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/429) @@ -42,7 +45,7 @@ and this project adheres to * [workflow][notification] improve how notifications and workflows are 'attached' to entities: contextual list, counter, buttons and vue modal * [AddAddress] disable multiselect search, and rely only on most pertinent Cities and Street computed backend * [fast_actions] improve fast-actions buttons override mechanism, fix https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/413 -* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc. +* [homepage widget] add vue homepage_widget with asynchone loading, give a global view resume of the user concerned actions, notifications, etc. ### test release 2021-01-31 @@ -91,7 +94,7 @@ and this project adheres to * [popover] add popover html popup mechanism (used by workflow breadcrumb) * [templates] improve updatedBy macro in item metadatas * [parcours]: bug fix when comment is pinned all other comments remain in the collection (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/385) -* [workflow] +* [workflow] * add My workflow section with my opened subscriptions * apply workflow on documents, accompanyingCourseWork and Evaluations * [wopi-link] a new vue component allow to open wopi link in a fullscreen chill-themed modal From 1f5d529d333e452f32dfee927c8327b40f4b225d Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 14:30:31 +0100 Subject: [PATCH 04/11] php code fix --- src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php index 05b7e46c9..c01476b2e 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php @@ -89,7 +89,6 @@ class PersonRender extends AbstractChillEntityRender . $this->addAltNames($person, false); } - return $person->getFirstName() . ' ' . $person->getLastName() . $this->addAltNames($person, false); } From eee38e95775d2009db2d9dc1ab5487d0bda07c02 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 15:18:54 +0100 Subject: [PATCH 05/11] remove isDead from insert vue on the fly as dead sign (obele) is included in personRender->renderString --- .../Resources/views/OnTheFly/_insert_vue_onthefly.html.twig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig b/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig index 16e9cbf02..bbc5f20db 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig @@ -11,7 +11,6 @@ * buttonText string * displayBadge boolean (default: false) replace button by badge, need to define buttonText for content * parent object (optional) pass parent context of the targetEntity (used for course resource comment) - * isDead boolean (default: false) is the person dead #} Date: Mon, 14 Feb 2022 14:05:59 +0100 Subject: [PATCH 06/11] if condition to check if a sender is assigned or if notification was assigned automatically by the system --- .../Resources/public/vuejs/HomepageWidget/MyNotifications.vue | 3 ++- .../Resources/public/vuejs/HomepageWidget/js/i18n.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue index 135532f0b..897ea3a9a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/MyNotifications.vue @@ -17,7 +17,8 @@ {{ n.title }} - {{ n.sender.text }} + {{ n.sender.text }} + {{ $t('automatic_notification')}} diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js index 29f9dac62..0845d0f02 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/js/i18n.js @@ -53,6 +53,7 @@ const appMessages = { }, emergency: "Urgent", confidential: "Confidentiel", + automatic_notification: "Notification automatique" } }; From 4920142540e8a4753d8ecddb67830b084ba0c04f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 14 Feb 2022 14:14:05 +0100 Subject: [PATCH 07/11] changelog updated --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3037eda41..81252251f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ and this project adheres to * [address]: Correction residential address 'depuis le' (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/459) * [Documents]: List view adapted to display more information (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/414) * [Thirdparty_contact]: address blurred if confidential in view page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/450) +* [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435) ## Test releases From 9e9fa5039f2c2e4a1e965f158f02b2cc51bc291a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 14 Feb 2022 14:26:12 +0100 Subject: [PATCH 08/11] fix cs --- .../Security/Authorization/AccompanyingPeriodWorkVoter.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php index 750cdd2dd..7193c524e 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php @@ -62,7 +62,6 @@ class AccompanyingPeriodWorkVoter extends Voter case self::UPDATE: return $this->security->isGranted(AccompanyingPeriodVoter::EDIT, $subject->getAccompanyingPeriod()); - default: throw new UnexpectedValueException("attribute {$attribute} is not supported"); } From 6402962990ebc3323f3262f00d095ec8e3fafd5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 14 Feb 2022 14:36:37 +0100 Subject: [PATCH 09/11] customize the 'none' into something more user-frieldly --- .../Service/DocGenerator/AccompanyingPeriodContext.php | 1 + src/Bundle/ChillPersonBundle/translations/messages.fr.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index 0578fb34f..d666c6928 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -167,6 +167,7 @@ class AccompanyingPeriodContext implements 'expanded' => true, 'required' => false, 'label' => $options[$key . 'Label'], + 'placeholder' => $this->translator->trans('Any person selected'), ]); } } diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 2c796c163..52b53553e 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -85,6 +85,7 @@ Course number: Parcours n° Civility: Civilité choose civility: -- All genders: tous les genres +Any person selected: Aucune personne sélectionnée # dédoublonnage Old person: Doublon From f2221565c5a983792f450f3555049e895c81fb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 14 Feb 2022 16:39:04 +0100 Subject: [PATCH 10/11] update changelog [ci-skip] --- CHANGELOG.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2baadd74..0c392663a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,14 @@ and this project adheres to * date versioning for test releases ## Unreleased -* AddPersons: remove ul-li html tags from AddPersons (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/419) + +## Test releases + +### test release 2022-02-14 + +* AddPersons: remove ul-li html tags from AddPersons (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/419) * [doc-generator] do not set required fields for mainPerson, person1, person2 (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement#456) * [doc-generation] add age and obele in the mainPerson, person1 and person2 list + add obele in person renderString if addAge (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/370) * [person] accompanying course work: fix on-the-fly update of thirdParty @@ -35,8 +40,6 @@ and this project adheres to * [Thirdparty_contact]: address blurred if confidential in view page (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/450) * [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435) -## Test releases - ### test release 2021-02-01 * renommer "dossier numéro" en "parcours numéro" dans les résultats de recherche From aebb21935b5f58dd030596362463bd741fd3550c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 16 Feb 2022 19:57:35 +0100 Subject: [PATCH 11/11] fix page "my accompanying period" and do not show drafts periods in homepage (+ ordering) --- .../Controller/UserAccompanyingPeriodController.php | 6 +++--- .../Repository/AccompanyingPeriodRepository.php | 3 ++- .../views/AccompanyingPeriod/user_periods_list.html.twig | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php index 51c8a32c0..321f212d5 100644 --- a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php @@ -30,7 +30,7 @@ class UserAccompanyingPeriodController extends AbstractController } /** - * @Route("/{_locale}/accompanying-periods", name="chill_person_accompanying_period_user") + * @Route("/{_locale}/person/accompanying-periods/my", name="chill_person_accompanying_period_user") */ public function listAction(Request $request) { @@ -44,13 +44,13 @@ class UserAccompanyingPeriodController extends AbstractController ); return $this->render('@ChillPerson/AccompanyingPeriod/user_periods_list.html.twig', [ - 'accompanyingds' => $accompanyingPeriods, + 'accompanyingPeriods' => $accompanyingPeriods, 'pagination' => $pagination, ]); } /** - * @Route("/{_locale}/accompanying-periods/drafts", name="chill_person_accompanying_period_draft_user") + * @Route("/{_locale}/person/accompanying-periods/my/drafts", name="chill_person_accompanying_period_draft_user") */ public function listDraftsAction(Request $request) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php index 10b424cef..122b658bd 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php @@ -71,7 +71,7 @@ final class AccompanyingPeriodRepository implements ObjectRepository $qb = $this->buildQueryByRecentUserHistory($user, $since); return $qb->select('a') - ->distinct(true) + ->addOrderBy('userHistory.startDate', 'DESC') ->getQuery() ->setMaxResults($limit) ->setFirstResult($offset) @@ -95,6 +95,7 @@ final class AccompanyingPeriodRepository implements ObjectRepository $qb ->join('a.userHistories', 'userHistory') ->where($qb->expr()->eq('a.user', ':user')) + ->andWhere($qb->expr()->neq('a.step', "'" . AccompanyingPeriod::STEP_DRAFT . "'")) ->andWhere($qb->expr()->gte('userHistory.startDate', ':since')) ->andWhere($qb->expr()->isNull('userHistory.endDate')) ->setParameter('user', $user) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_periods_list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_periods_list.html.twig index d30997bac..7395fceda 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_periods_list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingPeriod/user_periods_list.html.twig @@ -20,6 +20,8 @@
{% for period in accompanyingPeriods %} {% include '@ChillPerson/AccompanyingPeriod/_list_item.html.twig' with {'period': period, 'recordAction': _self.recordAction(period)} %} + {% else %} +

{{ 'Any accompanying period'|trans }}

{% endfor %}