From 6e1b95aa60740458dbf98b86723340ab5c8ac745 Mon Sep 17 00:00:00 2001 From: nobohan Date: Thu, 17 Feb 2022 18:05:34 +0100 Subject: [PATCH] residential address: show residential address or info in PersonRenderBox + add ThirdPartyText --- .../Resources/public/vuejs/_js/i18n.js | 3 +- .../Entity/Person/ResidentialAddress.php | 6 ++ .../_components/Entity/PersonRenderBox.vue | 58 +++++++++++++++---- .../views/ResidentialAddress/list.html.twig | 2 +- .../_components/Entity/ThirdPartyText.vue | 29 ++++++++++ 5 files changed, 84 insertions(+), 14 deletions(-) create mode 100644 src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyText.vue diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js index 0f2b52568..32049dcdd 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js @@ -69,7 +69,8 @@ const messages = { }, holder: "Titulaire", years_old: "an | {n} an | {n} ans", - + residential_address: "Adresse de résidence", + located_at: "réside chez" } } }; diff --git a/src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php b/src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php index b2f10ac08..c59511552 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person/ResidentialAddress.php @@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\PersonBundle\Repository\ResidentialAddressRepository; use Chill\PersonBundle\Entity\Person; use Chill\ThirdPartyBundle\Entity\ThirdParty; +use Symfony\Component\Serializer\Annotation\Groups; use DateTimeImmutable; use Doctrine\ORM\Mapping as ORM; @@ -28,6 +29,7 @@ class ResidentialAddress /** * @ORM\ManyToOne(targetEntity=Address::class) * @ORM\JoinColumn(nullable=true) + * @Groups({"read"}) */ private ?Address $address = null; @@ -38,18 +40,21 @@ class ResidentialAddress /** * @ORM\Column(type="datetime_immutable", nullable=true) + * @Groups({"read"}) */ private ?DateTimeImmutable $endDate = null; /** * @ORM\ManyToOne(targetEntity=Person::class) * @ORM\JoinColumn(nullable=true) + * @Groups({"read"}) */ private ?Person $hostPerson = null; /** * @ORM\ManyToOne(targetEntity=ThirdParty::class) * @ORM\JoinColumn(nullable=true) + * @Groups({"read"}) */ private ?ThirdParty $hostThirdParty = null; @@ -68,6 +73,7 @@ class ResidentialAddress /** * @ORM\Column(type="datetime_immutable") + * @Groups({"read"}) */ private ?DateTimeImmutable $startDate = null; 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 84c1f25e6..648319079 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/Entity/PersonRenderBox.vue @@ -117,18 +117,50 @@ -
+
+
+
+
    +
  • + +
    + + +

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

    +
    +
    +

    {{ $t('renderbox.located_at') }}:

    + + + + + +
    +
    +

    {{ $t('renderbox.located_at') }}:

    + + + + + +
    -
      -
    • - ICI l'adresse de résidence, if any - - - -
    • -
    +
  • +
+
+
@@ -162,6 +194,7 @@ import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRe import Confidential from 'ChillMainAssets/vuejs/_components/Confidential.vue'; import BadgeEntity from 'ChillMainAssets/vuejs/_components/BadgeEntity.vue'; import PersonText from 'ChillPersonAssets/vuejs/_components/Entity/PersonText.vue'; +import ThirdPartyText from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyText.vue'; export default { name: "PersonRenderBox", @@ -169,7 +202,8 @@ export default { AddressRenderBox, Confidential, BadgeEntity, - PersonText + PersonText, + ThirdPartyText }, props: ['person', 'options', 'render', 'returnPath'], computed: { diff --git a/src/Bundle/ChillPersonBundle/Resources/views/ResidentialAddress/list.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/ResidentialAddress/list.html.twig index 69e12f36d..4cba32e47 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/ResidentialAddress/list.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/ResidentialAddress/list.html.twig @@ -62,7 +62,7 @@
  • {{ "Address of"|trans}} - {{ a.hostThirdParty|chill_entity_render_box }} + {{ a.hostThirdParty|chill_entity_render_box }}
  • {% if a.hostThirdParty.address is not null %} diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyText.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyText.vue new file mode 100644 index 000000000..621a9f8b8 --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyText.vue @@ -0,0 +1,29 @@ + + +