From 4dd9bc11237e7af3543108c43d92fe62a532eb73 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 11 Feb 2022 14:22:20 +0100 Subject: [PATCH 01/35] 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/35] 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/35] 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/35] 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/35] 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 11:42:11 +0100 Subject: [PATCH 06/35] thirdparty contact address blurred in view page if confidential --- CHANGELOG.md | 1 + .../Resources/views/ThirdParty/view.html.twig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e113f12c..3037eda41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ and this project adheres to * display full address in address.text in normalization. Adapt AddressRenderBox * [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) ## Test releases diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/view.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/view.html.twig index 8d40a8a34..824438fa3 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/view.html.twig +++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/view.html.twig @@ -115,7 +115,7 @@
{% for tp in thirdParty.activeChildren %}
- {{ tp|chill_entity_render_box({'render': 'bloc', 'addLink': false}) }} + {{ tp|chill_entity_render_box({'render': 'bloc', 'addLink': false, 'isConfidential': tp.contactDataAnonymous ? true : false }) }}
{% endfor %}
From 61cf838458d6d194e548d4e803184cd7cf8d2033 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 14 Feb 2022 14:05:59 +0100 Subject: [PATCH 07/35] 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 08/35] 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 09/35] 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 10/35] 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 11/35] 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 89edf508f5e9f12482fd06caf56c22663e923f1c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jan 2022 17:38:24 +0100 Subject: [PATCH 12/35] button added to add contact to personne morale (styling not correct yet) + opening of onTheFly thirdparty, but conditions and parameters not yet correct --- .../vuejs/OnTheFly/components/OnTheFly.vue | 12 ++ .../_components/AddPersons/TypeThirdParty.vue | 85 +++++++------- .../vuejs/_components/OnTheFly/ThirdParty.vue | 107 ++++++++++-------- 3 files changed, 118 insertions(+), 86 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue index 7b06776ba..c348e308f 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -51,6 +51,16 @@ + + @@ -48,36 +53,36 @@ const i18n = { }; export default { - name: 'SuggestionThirdParty', - components: { - OnTheFly, - BadgeEntity - }, - props: ['item'], - i18n, - computed: { - hasAddress() { - if (this.$props.item.result.address !== null) { - return true; - } - if (this.$props.item.result.parent !== null) { - this.$props.item.result.parent.address !== null; - } - }, - hasParent() { - return this.$props.item.result.parent !== null; - }, - getAddress() { - if (this.$props.item.result.address !== null) { - return this.$props.item.result.address; - } - if (this.$props.item.result.parent.address !== null) { - return this.$props.item.result.parent.address; - } + name: 'SuggestionThirdParty', + components: { + OnTheFly, + BadgeEntity + }, + props: ['item'], + i18n, + computed: { + hasAddress() { + if (this.$props.item.result.address !== null) { + return true; + } + if (this.$props.item.result.parent !== null) { + this.$props.item.result.parent.address !== null; + } + }, + hasParent() { + return this.$props.item.result.parent !== null; + }, + getAddress() { + if (this.$props.item.result.address !== null) { + return this.$props.item.result.address; + } + if (this.$props.item.result.parent.address !== null) { + return this.$props.item.result.parent.address; + } - return null; - } - } + return null; + } + } } diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue index 49249b8a1..366df4559 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -20,58 +20,73 @@
- -
-
- - -
-
- - -
-
-
-

Contact de :

- +
+ + +
+
+ + +
+
+
+

Contact de :

+ + -
+
- +
From dc7422bf56ecec95a033edd2713e1206352aa293 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jan 2022 17:40:36 +0100 Subject: [PATCH 13/35] unsaved changes --- .../Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue index 366df4559..57ca51e98 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -20,7 +20,7 @@
- {{ action }} +
From c2dec360b120e39c6b7799bcd6b08ab27836b856 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jan 2022 17:40:36 +0100 Subject: [PATCH 14/35] unsaved changes --- .../public/vuejs/_components/AddPersons/TypeThirdParty.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue index 9c561a653..d27844fed 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue @@ -24,8 +24,7 @@ :options="{ displayLong: true }"> Date: Thu, 13 Jan 2022 14:33:57 +0100 Subject: [PATCH 15/35] endpoints created for profession and civility for use in vue component --- .../DependencyInjection/ChillMainExtension.php | 14 ++++++++++++++ src/Bundle/ChillMainBundle/Entity/Civility.php | 1 + src/Bundle/ChillMainBundle/chill.api.specs.yaml | 10 ++++++++++ .../ChillThirdPartyExtension.php | 15 +++++++++++++++ .../Entity/ThirdPartyProfession.php | 5 +++-- .../ChillThirdPartyBundle/chill.api.specs.yaml | 11 +++++++++++ 6 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index fa561b7e7..03deafd14 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -559,6 +559,20 @@ class ChillMainExtension extends Extension implements ], ], ], + [ + 'class' => \Chill\MainBundle\Entity\Civility::class, + 'name' => 'civility', + 'base_path' => '/api/1.0/main/civility', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_index' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + ], + ], + ], + ], ], ]); } diff --git a/src/Bundle/ChillMainBundle/Entity/Civility.php b/src/Bundle/ChillMainBundle/Entity/Civility.php index c91016a63..cd4a75e5f 100644 --- a/src/Bundle/ChillMainBundle/Entity/Civility.php +++ b/src/Bundle/ChillMainBundle/Entity/Civility.php @@ -29,6 +29,7 @@ class Civility /** * @ORM\Column(type="boolean") + * @Serializer\Groups({"read"}) */ private bool $active = true; diff --git a/src/Bundle/ChillMainBundle/chill.api.specs.yaml b/src/Bundle/ChillMainBundle/chill.api.specs.yaml index 034dfe74b..fa82a58cd 100644 --- a/src/Bundle/ChillMainBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillMainBundle/chill.api.specs.yaml @@ -781,6 +781,16 @@ paths: description: "accepted" 403: description: "unauthorized" + /1.0/main/civility.json: + get: + tags: + - civility + summary: Return all civility types + responses: + 200: + description: "ok" + 401: + description: "Unauthorized" /1.0/main/user-job.json: get: tags: diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php index 1981d6daf..124f5b7f3 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php @@ -126,6 +126,21 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte ], ], ], + [ + 'class' => \Chill\ThirdPartyBundle\Entity\ThirdPartyProfession::class, + // 'controller' => \Chill\MainBundle\Controller\ProfessionApiController::class, + 'name' => 'profession', + 'base_path' => '/api/1.0/thirdparty/professions', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_index' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + ], + ], + ], + ], ], ]); } diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php index 1963b34a7..bf10c7cf1 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php @@ -23,6 +23,7 @@ class ThirdPartyProfession { /** * @ORM\Column(type="boolean") + * @Serializer\Groups({"read"}) */ private bool $active = true; @@ -30,13 +31,13 @@ class ThirdPartyProfession * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") - * @Serializer\Groups({"docgen:read"}) + * @Serializer\Groups({"docgen:read", "read"}) */ private ?int $id = null; /** * @ORM\Column(type="json") - * @Serializer\Groups({"docgen:read"}) + * @Serializer\Groups({"docgen:read", "read"}) */ private array $name = []; diff --git a/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml b/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml index 52db7589c..eb303a4f0 100644 --- a/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml @@ -110,3 +110,14 @@ paths: description: "OK" 422: description: "Object with validation errors" + + /1.0/thirdparty/professions.json: + get: + tags: + - thirdparty + summary: Return all thirdparty professions + responses: + 200: + description: "ok" + 401: + description: "Unauthorized" From 3b1fc4aacbf720c0b77b71d9b421d4dee2a202da Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 13 Jan 2022 14:34:28 +0100 Subject: [PATCH 16/35] translations added --- .../Resources/public/vuejs/OnTheFly/i18n.js | 3 +++ .../ChillMainBundle/Resources/public/vuejs/_js/i18n.js | 3 ++- .../Resources/public/vuejs/_js/i18n.js | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js index c619ef96b..71139bc95 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js @@ -18,6 +18,9 @@ const ontheflyMessages = { thirdparty: "un nouveau tiers professionnel" }, resource_comment_title: "Un commentaire est associé à cet interlocuteur" + addContact: { + title: "Créer un contact pour ..." + } } } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js index 0f2b52568..00ae02dc8 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js @@ -46,7 +46,8 @@ const messages = { person: "Quitter la page et ouvrir la fiche de l'usager", thirdparty: "Quitter la page et voir le tiers", }, - refresh: 'Rafraîchir' + refresh: 'Rafraîchir', + addContact: 'Ajouter un contact' }, nav: { next: "Suivant", diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js index 37d09320d..86b39ae36 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js @@ -4,7 +4,12 @@ const thirdpartyMessages = { name: "Dénomination", email: "Courriel", phonenumber: "Téléphone", - } + comment: "Comment", + profession: "Qualité", + civility: "Civilité" + }, + child_of: "Contact de: ", + children: "Personnes de contact: ", } }; From 02c09687a4edff0285a1fe850d2079a1e6cdee83 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 13 Jan 2022 14:35:53 +0100 Subject: [PATCH 17/35] onTheFly modal to add contact to thirdparty - form fields for profession,civility, and comment added - no saving possible yet --- .../vuejs/OnTheFly/components/OnTheFly.vue | 15 +- .../_components/AddPersons/TypeThirdParty.vue | 2 +- .../vuejs/_components/OnTheFly/ThirdParty.vue | 156 ++++++++++++------ 3 files changed, 118 insertions(+), 55 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue index c348e308f..d72e7ef2e 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -51,13 +51,12 @@
- @@ -45,10 +45,10 @@ ref="castThirdparty">
-

{{ $t('onthefly.resource_comment_title') }}

-
- {{ parent.comment }} -
+

{{ $t('onthefly.resource_comment_title') }}

+
+ {{ parent.comment }} +
@@ -114,11 +114,11 @@ export default { computed: { hasResourceComment() { //console.log('hasResourceComment', this.parent); - return (typeof this.parent !== 'undefined' && this.parent !== null) - && this.action === 'show' - && this.parent.type === 'accompanying_period_resource' - && (this.parent.comment !== null && this.parent.comment !== '') - ; + return (typeof this.parent !== 'undefined' && this.parent !== null) + && this.action === 'show' + && this.parent.type === 'accompanying_period_resource' + && (this.parent.comment !== null && this.parent.comment !== '') + ; }, classAction() { switch (this.action) { diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js index 178203807..0f4d4098a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js @@ -19,8 +19,8 @@ const ontheflyMessages = { }, addContact: { title: "Créer un contact pour {q}" - } - resource_comment_title: "Un commentaire est associé à cet interlocuteur" + }, + resource_comment_title: "Un commentaire est associé à cet interlocuteur", addContact: { title: "Créer un contact pour {q}" } From 20d22b726c1696331e47137354d9064adad0df72 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 19 Jan 2022 10:57:31 +0100 Subject: [PATCH 26/35] possible to add a contact to a thirdparty --- .../vuejs/OnTheFly/components/OnTheFly.vue | 18 +++++++++++++++--- .../Entity/ThirdParty.php | 6 +++--- .../Entity/ThirdPartyProfession.php | 2 +- .../vuejs/_components/OnTheFly/ThirdParty.vue | 10 ++-------- .../Normalizer/ThirdPartyNormalizer.php | 1 + 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue index b65a2c26b..531d4f739 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -218,10 +218,22 @@ export default { type = 'thirdparty' data = this.$refs.castThirdparty.$data.thirdparty; // create the new contact here, bypassing saveFormOnTheFly() -> not working here? - console.log('addContact data', data) - postThirdparty(data) + const body = { + "type": "thirdparty", + "kind": "child", + "name": data.text, + "isChild": true, + "parent": {"type": "thirdparty", "id": this.parent.id}, + "civility": {"id": data.civility}, + "profession": {"id": data.profession}, + "comment": data.comment, + "phonenumber": data.phonenumber, + } + // console.log('body', body) + postThirdparty(body) .then(thirdparty => new Promise((resolve, reject) => { - this.newPriorSuggestion(thirdparty); + // this.newPriorSuggestion(thirdparty); + console.log('thirdparty created', thirdparty) resolve(); })); } else { diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index 7404846e4..5679ea1f2 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -126,7 +126,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface * @var Civility * @ORM\ManyToOne(targetEntity=Civility::class) * ORM\JoinColumn(name="civility", referencedColumnName="id", nullable=true) - * @Groups({"docgen:read", "docgen:read:3party:parent"}) + * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) * @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"}) */ private ?Civility $civility = null; @@ -199,7 +199,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface * * @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", inversedBy="children") * @ORM\JoinColumn(name="parent_id", referencedColumnName="id") - * @Groups({"docgen:read"}) + * @Groups({"read", "write", "docgen:read"}) * @Context(normalizationContext={"groups": "docgen:read:3party:parent"}, groups={"docgen:read"}) */ private ?ThirdParty $parent = null; @@ -210,7 +210,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface * @var ThirdPartyProfession * @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyProfession") * ORM\JoinColumn(name="profession", referencedColumnName="id", nullable=true) - * @Groups({"docgen:read", "docgen:read:3party:parent"}) + * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) * @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"}) */ private ?ThirdPartyProfession $profession = null; diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php index bf10c7cf1..12b0818b5 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php @@ -31,7 +31,7 @@ class ThirdPartyProfession * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") - * @Serializer\Groups({"docgen:read", "read"}) + * @Serializer\Groups({"docgen:read", "read", "write"}) */ private ?int $id = null; diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue index 5299319fa..4b7bade24 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -48,7 +48,6 @@
- -
-
- - +
@@ -89,7 +89,7 @@