From 09e68727245af9b21fd2535f66e9bb8a8234d4a2 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 14 Mar 2022 11:48:39 +0100 Subject: [PATCH] firstname added to onthefly for child or contact --- .../vuejs/_components/OnTheFly/ThirdParty.vue | 16 +++++++++++++--- .../Resources/public/vuejs/_js/i18n.js | 2 ++ .../Normalizer/ThirdPartyNormalizer.php | 1 + .../Templating/Entity/ThirdPartyRender.php | 4 +++- .../ChillThirdPartyBundle/chill.api.specs.yaml | 2 ++ 5 files changed, 21 insertions(+), 4 deletions(-) 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 8de41b989..9ed4481dd 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -65,7 +65,7 @@
-
+
+
+
+ + +
+
+ + +
+
-
+
@@ -307,7 +317,7 @@ dl { margin-bottom: 1rem; } -#child-info { +.child-info { display: flex; justify-content: space-between; div { diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js index 76f01e3f4..04cfc0cf4 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js @@ -1,6 +1,8 @@ const thirdpartyMessages = { fr: { thirdparty: { + firstname: "Prénom", + lastname: "Nom", name: "Dénomination", email: "Courriel", phonenumber: "Téléphone", diff --git a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php index 8e4775aad..87bfb6995 100644 --- a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php +++ b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php @@ -43,6 +43,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf { return [ 'type' => 'thirdparty', + 'firstname' => $thirdParty->getFirstname(), 'name' => $thirdParty->getName(), 'text' => $this->thirdPartyRender->renderString($thirdParty, []), 'id' => $thirdParty->getId(), diff --git a/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php b/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php index 8cfa95f80..cec9dee7d 100644 --- a/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php +++ b/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php @@ -77,7 +77,9 @@ class ThirdPartyRender extends AbstractChillEntityRender $acronym = ''; } - return $civility . $entity->getName() . $acronym; + $firstname = empty($entity->getFirstname()) ? '' : $entity->getFirstname(); + + return $civility . $firstname . ' ' . $entity->getName() . $acronym; } public function supports($entity, array $options): bool diff --git a/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml b/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml index eb303a4f0..035185181 100644 --- a/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml @@ -20,6 +20,8 @@ components: type: string enum: - "thirdparty" + firstname: + type: string name: type: string email: