From 21b33fb4f63e9877ac6b32dfad9c46962235e2a1 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 22 Nov 2021 14:57:29 +0100 Subject: [PATCH 01/91] accourse resume page: add requestor and resources informations --- .../vuejs/AccompanyingCourse/js/i18n.js | 4 +- .../views/AccompanyingCourse/index.html.twig | 41 +++++++++++++++---- .../translations/messages.fr.yml | 3 ++ 3 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js index d5f5ea72e..2a562f600 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js @@ -34,7 +34,7 @@ const appMessages = { title: "Origine de la demande", label: "Origine de la demande", placeholder: "Renseignez l'origine de la demande", - not_valid: "Indiquez une origine de la demande", + not_valid: "Indiquez une origine à la demande", }, persons_associated: { title: "Usagers concernés", @@ -125,7 +125,7 @@ const appMessages = { participation_not_valid: "sélectionnez au minimum 1 usager", socialIssue_not_valid: "sélectionnez au minimum une problématique sociale", location_not_valid: "indiquez au minimum une localisation temporaire du parcours", - origin_not_valid: "indiquez une origine de la demande", + origin_not_valid: "Indiquez une origine à la demande", set_a_scope: "indiquez au moins un service", sure: "Êtes-vous sûr ?", sure_description: "Une fois le changement confirmé, il ne sera plus possible de le remettre à l'état de brouillon !", diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index 434a87759..6c7b30a3a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -4,15 +4,12 @@ {{ 'Resume Accompanying Course'|trans }} {% endblock %} -{% macro button_person(person) %} - {% if person.isSharingHousehold %} -
  • - - - -
  • - {% endif %} +{% macro insert_onthefly(type, entity) %} + {% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with { + action: 'show', displayBadge: true, + targetEntity: { name: type, id: entity.id }, + buttonText: entity|chill_entity_render_string + } %} {% endmacro %} {% block js %} @@ -56,6 +53,32 @@ {% endif %} +
    +
    +

    {{ 'Requestor'|trans }}

    + {% if accompanyingCourse.requestorPerson is not null %} + {{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }} + {% elseif accompanyingCourse.requestorThirdParty is not null %} + {{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }} + {% else %} + {{ 'No requestor'|trans }} + {% endif %} +
    +
    +

    {{ 'Resources'|trans }}

    + {% for r in accompanyingCourse.resources %} + {% if r.person is not null %} + {{ _self.insert_onthefly('person', r.person) }} + {% elseif r.thirdParty is not null %} + {{ _self.insert_onthefly('thirdparty', r.thirdParty) }} + {% endif %} + {% endfor %} + {% if accompanyingCourse.resources is empty %} + {{ 'No resources'|trans }} + {% endif %} +
    +
    +

    {{ 'Last social actions'|trans }}

    {% include 'ChillPersonBundle:AccompanyingCourseWork:list_recent_by_accompanying_period.html.twig' with {'buttonText': false } %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 6dc4aebed..31996117e 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -204,6 +204,9 @@ See accompanying periods: Voir toutes les périodes d'accompagnement See accompanying period: Voir la période Edit accompanying period: Modifier la période See this period: Voir cette période +Requestor: Demandeur +No requestor: Pas de demandeur +No resources: "Pas d'interlocuteurs privilégiés" Referrer: Référent Some peoples does not belong to any household currently. Add them to an household soon: Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur appartenance à un ménage dès que possible. Add to household now: Ajouter à un ménage From e43d22c1e07b30f1caa4b9a5f6ab27c081a3ce5c Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 22 Nov 2021 17:02:08 +0100 Subject: [PATCH 02/91] resume: improve resources bloc --- .../views/AccompanyingCourse/index.html.twig | 34 ++++++++++++------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index 6c7b30a3a..a36b50afe 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -34,7 +34,8 @@ {% endif %} {% endif %} - {% if accompanyingCourse.locationStatus == 'address' or accompanyingCourse.locationStatus == 'none' %} + {% if accompanyingCourse.locationStatus == 'address' + or accompanyingCourse.locationStatus == 'none' %}
    {% include '@ChillPerson/AccompanyingCourse/_warning_address.html.twig' %}
    @@ -53,31 +54,38 @@ {% endif %}
    + {% if accompanyingCourse.resources is not empty + and (accompanyingCourse.requestorThirdParty is not null + or accompanyingCourse.requestorPerson is not null) + %}
    -

    {{ 'Requestor'|trans }}

    {% if accompanyingCourse.requestorPerson is not null %} +

    {{ 'Requestor'|trans }}

    {{ _self.insert_onthefly('person', accompanyingCourse.requestorPerson) }} {% elseif accompanyingCourse.requestorThirdParty is not null %} +

    {{ 'Requestor'|trans }}

    {{ _self.insert_onthefly('thirdparty', accompanyingCourse.requestorThirdParty) }} {% else %} - {{ 'No requestor'|trans }} + {{ 'No requestor'|trans }} {% endif %}
    -

    {{ 'Resources'|trans }}

    - {% for r in accompanyingCourse.resources %} - {% if r.person is not null %} - {{ _self.insert_onthefly('person', r.person) }} - {% elseif r.thirdParty is not null %} - {{ _self.insert_onthefly('thirdparty', r.thirdParty) }} - {% endif %} - {% endfor %} - {% if accompanyingCourse.resources is empty %} - {{ 'No resources'|trans }} + {% if accompanyingCourse.resources is not empty %} +

    {{ 'Resources'|trans }}

    + {% for r in accompanyingCourse.resources %} + {% if r.person is not null %} + {{ _self.insert_onthefly('person', r.person) }} + {% elseif r.thirdParty is not null %} + {{ _self.insert_onthefly('thirdparty', r.thirdParty) }} + {% endif %} + {% endfor %} + {% else %} + {{ 'No resources'|trans }} {% endif %}
    + {% endif %}

    {{ 'Last social actions'|trans }}

    From 92753604facc604b3de03d9616041dbdbaceb409 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Wed, 24 Nov 2021 17:00:09 +0100 Subject: [PATCH 03/91] fix backend error in activity::getPersonsNotAssociated() --- src/Bundle/ChillActivityBundle/Entity/Activity.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 85abed5e5..693e2af85 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -346,8 +346,9 @@ class Activity implements HasCenterInterface, HasScopeInterface, AccompanyingPer if (null !== $this->accompanyingPeriod) { $personsNotAssociated = []; + // TODO better semantic with: return $this->persons->filter(...); foreach ($this->persons as $person) { - if (!in_array($person, $this->getPersonsAssociated())) { + if ($this->accompanyingPeriod->getOpenParticipationContainsPerson($person) === null) { $personsNotAssociated[] = $person; } } From b09f32b1c2dd224233e9db032dabd1a00472e7f4 Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 25 Nov 2021 11:41:44 +0100 Subject: [PATCH 04/91] vue_activity: adapt bloc width, depends of blocs number --- .../public/vuejs/Activity/components/ConcernedGroups.vue | 4 ++++ .../vuejs/Activity/components/ConcernedGroups/PersonsBloc.vue | 4 ++-- .../components/Banner/PersonsAssociated.vue | 4 +--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue index 721f136a9..981c6fd3a 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups.vue @@ -6,6 +6,7 @@ v-for="bloc in contextPersonsBlocs" v-bind:key="bloc.key" v-bind:bloc="bloc" + v-bind:blocWidth="getBlocWidth" v-bind:setPersonsInBloc="setPersonsInBloc">
    @@ -122,6 +123,9 @@ export default { } } }, + getBlocWidth() { + return Math.round(100/(this.contextPersonsBlocs.length)) + '%'; + } }, mounted() { this.setPersonsInBloc(); diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups/PersonsBloc.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups/PersonsBloc.vue index f95e2add7..106196588 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups/PersonsBloc.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/ConcernedGroups/PersonsBloc.vue @@ -1,5 +1,5 @@