From 90da067fbd2bd3a5e0ce561ae5ac6f56cfe2d7de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 9 Feb 2022 22:21:48 +0100 Subject: [PATCH 1/2] address: show full address in address text and adapt Vue --- .../_components/Entity/AddressRenderBox.vue | 46 ------------------- .../Normalizer/AddressNormalizer.php | 2 +- .../Templating/Entity/AddressRender.php | 2 +- .../PersonsAssociated/ParticipationItem.vue | 1 + 4 files changed, 3 insertions(+), 48 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue index 385f7aa3d..9a5dc2644 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/Entity/AddressRenderBox.vue @@ -42,57 +42,11 @@ class="street"> {{ address.text }}

-

- {{ address.postcode.code }} {{ address.postcode.name }} -

-

- {{ address.country.name.fr }} -

- -
diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php index 10e889344..78e8729be 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php @@ -64,7 +64,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw if ($address instanceof Address) { $data = [ 'address_id' => $address->getId(), - 'text' => $address->isNoAddress() ? null : $this->addressRender->renderStreetLine($address, []), + 'text' => $this->addressRender->renderString($address, []), 'street' => $address->getStreet(), 'streetNumber' => $address->getStreetNumber(), 'postcode' => [ diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php index 66d6e9e41..3a97d0ef6 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php @@ -124,7 +124,7 @@ class AddressRender implements ChillEntityRenderInterface */ public function renderString($addr, array $options): string { - return implode(' - ', $this->renderLines($addr)); + return implode(' — ', $this->renderLines($addr)); } public function supports($entity, array $options): bool diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue index 2ed08ffc0..ed2d69f42 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated/ParticipationItem.vue @@ -10,6 +10,7 @@ addAge : true, hLevel : 3, isConfidential : false, + isMultiline: true, }" :person="participation.person" :returnPath="getAccompanyingCourseReturnPath"> From 6578f66fec6e3ba36555d3a1ed7e2d4377d60850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 11 Feb 2022 14:22:10 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d974cb2..0da81633b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to * [pick entity]: fix translations in modal (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/419) * [homepage_widget]: fix translation on emergency badge (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/440) * [person]: create person and household added to button dropdown (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/454) +* display full address in address.text in normalization. Adapt AddressRenderBox ## Test releases