firstname added to onthefly for child or contact

This commit is contained in:
Julie Lenaerts 2022-03-14 11:48:39 +01:00
parent f44f9d356b
commit 09e6872724
5 changed files with 21 additions and 4 deletions

View File

@ -65,7 +65,7 @@
</div>
<div v-if="thirdparty.kind === 'child' || thirdparty.kind === 'contact'">
<div id="child-info">
<div class="child-info">
<div class="input-group mb-3">
<select class="form-select form-select-lg" id="profession"
v-model="thirdparty.civility">
@ -81,9 +81,19 @@
</select>
</div>
</div>
<div class="child-info">
<div class="form-floating mb-3">
<input class="form-control form-control-lg" id="firstname" v-model="thirdparty.firstname" v-bind:placeholder="$t('thirdparty.firstname')" />
<label for="firstname">{{ $t('thirdparty.firstname') }}</label>
</div>
<div class="form-floating mb-3">
<input class="form-control form-control-lg" id="name" v-model="thirdparty.name" v-bind:placeholder="$t('thirdparty.lastname')" />
<label for="name">{{ $t('thirdparty.lastname') }}</label>
</div>
</div>
</div>
<div class="form-floating mb-3">
<div class="form-floating mb-3" v-if="thirdparty.kind === 'company'">
<input class="form-control form-control-lg" id="name" v-model="thirdparty.name" v-bind:placeholder="$t('thirdparty.name')" />
<label for="name">{{ $t('thirdparty.name') }}</label>
</div>
@ -307,7 +317,7 @@ dl {
margin-bottom: 1rem;
}
#child-info {
.child-info {
display: flex;
justify-content: space-between;
div {

View File

@ -1,6 +1,8 @@
const thirdpartyMessages = {
fr: {
thirdparty: {
firstname: "Prénom",
lastname: "Nom",
name: "Dénomination",
email: "Courriel",
phonenumber: "Téléphone",

View File

@ -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(),

View File

@ -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

View File

@ -20,6 +20,8 @@ components:
type: string
enum:
- "thirdparty"
firstname:
type: string
name:
type: string
email: