mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
key "centers" for person is an array. key center deprecated
This commit is contained in:
parent
b43a3d394b
commit
2826e079e8
@ -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
|
||||
|
@ -96,14 +96,9 @@
|
||||
<p class="chill-no-data-statement">{{ $t('renderbox.no_data') }}</p>
|
||||
</li>
|
||||
|
||||
<li v-if="person.center && options.addCenter">
|
||||
<li v-if="person.centers !== undefined && person.centers.length > 0 && options.addCenter">
|
||||
<i class="fa fa-li fa-long-arrow-right"></i>
|
||||
<template v-if="person.center.type !== undefined">
|
||||
{{ person.center.name }}
|
||||
</template>
|
||||
<template v-else>
|
||||
<template v-for="c in person.center">{{ c.name }}</template>
|
||||
</template>
|
||||
<template v-for="c in person.centers">{{ c.name }}</template>
|
||||
</li>
|
||||
<li v-else-if="options.addNoData">
|
||||
<i class="fa fa-li fa-long-arrow-right"></i>
|
||||
|
@ -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,
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user