diff --git a/CHANGELOG.md b/CHANGELOG.md index a308e03cf..1e5cdc25b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to * [person] create an accompanying course: add client-side validation if no origin (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/210) * [person] fix bounds for computing current person address: the new address appears immediatly * [docgen] create a normalizer and serializer for normalization on doc format +* [person normalization] the key center is now "centers" and is an array. Empty array if no center ## Test releases diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue index eb7793839..ffb9ef3d4 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue @@ -96,14 +96,9 @@

{{ $t('renderbox.no_data') }}

-
  • - - - +
  • + +
  • diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php index e09c976fe..54c801c4b 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php @@ -50,7 +50,7 @@ class PersonJsonNormalizer implements private PersonRepository $repository; - private CenterResolverManagerInterface $centerResolverDispatcher; + private CenterResolverManagerInterface $centerResolverManager; use NormalizerAwareTrait; @@ -61,11 +61,11 @@ class PersonJsonNormalizer implements public function __construct( ChillEntityRenderExtension $render, PersonRepository $repository, - CenterResolverManagerInterface $centerResolverDispatcher + CenterResolverManagerInterface $centerResolverManager ) { $this->render = $render; $this->repository = $repository; - $this->centerResolverDispatcher = $centerResolverDispatcher; + $this->centerResolverManager = $centerResolverManager; } public function normalize($person, string $format = null, array $context = []) @@ -80,15 +80,15 @@ class PersonJsonNormalizer implements 'text' => $this->render->renderString($person), 'firstName' => $person->getFirstName(), 'lastName' => $person->getLastName(), - 'birthdate' => $this->normalizer->normalize($person->getBirthdate()), - 'deathdate' => $this->normalizer->normalize($person->getDeathdate()), - 'center' => $this->normalizer->normalize($this->centerResolverDispatcher->resolveCenters($person), $format, $context), + 'birthdate' => $this->normalizer->normalize($person->getBirthdate(), $format, $context), + 'deathdate' => $this->normalizer->normalize($person->getDeathdate(), $format, $context), + 'centers' => $this->normalizer->normalize($this->centerResolverManager->resolveCenters($person), $format, $context), 'phonenumber' => $person->getPhonenumber(), 'mobilenumber' => $person->getMobilenumber(), 'altNames' => $this->normalizeAltNames($person->getAltNames()), 'gender' => $person->getGender(), - 'current_household_address' => $this->normalizer->normalize($person->getCurrentHouseholdAddress()), - 'current_household_id' => $household ? $this->normalizer->normalize($household->getId()) : null, + 'current_household_address' => $this->normalizer->normalize($person->getCurrentHouseholdAddress(), $format, $context), + 'current_household_id' => $household ? $this->normalizer->normalize($household->getId(), $format, $context) : null, ]; }