From c1232037a9c3488ff8e832b3c51a69f0f320ccb4 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jan 2022 13:52:26 +0100 Subject: [PATCH 001/147] minor bug fix for view page of thirdparty property 'types' -> 'thirdPartyTypes' --- .../Resources/views/ThirdParty/view.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/view.html.twig b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/view.html.twig index 06c5e1391..8d40a8a34 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/view.html.twig +++ b/src/Bundle/ChillThirdPartyBundle/Resources/views/ThirdParty/view.html.twig @@ -50,7 +50,7 @@
{{ 'thirdparty.Categories'|trans }}
{% set types = [] %} - {% for t in thirdParty.types %} + {% for t in thirdParty.thirdPartyTypes %} {% set types = types|merge( [ ('chill_3party.key_label.'~t)|trans ] ) %} {% endfor %} {% for c in thirdParty.categories %} From ea66fb4c379b5fbd86ec86ccf7d4f0b3d7c18706 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jan 2022 17:38:24 +0100 Subject: [PATCH 002/147] button added to add contact to personne morale (styling not correct yet) + opening of onTheFly thirdparty, but conditions and parameters not yet correct --- .../vuejs/OnTheFly/components/OnTheFly.vue | 26 +++-- .../_components/AddPersons/TypeThirdParty.vue | 87 +++++++------- .../vuejs/_components/OnTheFly/ThirdParty.vue | 107 ++++++++++-------- 3 files changed, 126 insertions(+), 94 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue index d64ae274e..1e8c057d2 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -1,11 +1,11 @@ + + @@ -48,36 +53,36 @@ const i18n = { }; export default { - name: 'SuggestionThirdParty', - components: { - OnTheFly, - BadgeEntity - }, - props: ['item'], - i18n, - computed: { - hasAddress() { - if (this.$props.item.result.address !== null) { - return true; - } - if (this.$props.item.result.parent !== null) { - this.$props.item.result.parent.address !== null; - } - }, - hasParent() { - return this.$props.item.result.parent !== null; - }, - getAddress() { - if (this.$props.item.result.address !== null) { - return this.$props.item.result.address; - } - if (this.$props.item.result.parent.address !== null) { - return this.$props.item.result.parent.address; - } + name: 'SuggestionThirdParty', + components: { + OnTheFly, + BadgeEntity + }, + props: ['item'], + i18n, + computed: { + hasAddress() { + if (this.$props.item.result.address !== null) { + return true; + } + if (this.$props.item.result.parent !== null) { + this.$props.item.result.parent.address !== null; + } + }, + hasParent() { + return this.$props.item.result.parent !== null; + }, + getAddress() { + if (this.$props.item.result.address !== null) { + return this.$props.item.result.address; + } + if (this.$props.item.result.parent.address !== null) { + return this.$props.item.result.parent.address; + } - return null; - } - } + return null; + } + } } 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 dc9025886..0d0fd2543 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -21,58 +21,73 @@
- -
-
- - -
-
- - -
-
-
-

Contact de :

- +
+ + +
+
+ + +
+
+
+

Contact de :

+ + -
+
- +
From de7de22492f58c7ec9bfac3af60885d08db36784 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jan 2022 17:40:36 +0100 Subject: [PATCH 003/147] unsaved changes --- .../Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 0d0fd2543..c852a1a36 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -21,7 +21,7 @@
- {{ action }} +
From 9bf41bbd3441423408918f7e2c37adfac4f19abf Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 12 Jan 2022 17:40:36 +0100 Subject: [PATCH 004/147] unsaved changes --- .../public/vuejs/_components/AddPersons/TypeThirdParty.vue | 3 +-- .../Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue index 22fe7ebea..6a7a4a62e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/TypeThirdParty.vue @@ -24,8 +24,7 @@ :options="{ displayLong: true }">
- {{ action }} +
From 65daf2d0cf0eab9601193e75268c3d4d634ad623 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 13 Jan 2022 14:33:57 +0100 Subject: [PATCH 005/147] endpoints created for profession and civility for use in vue component --- .../DependencyInjection/ChillMainExtension.php | 14 ++++++++++++++ src/Bundle/ChillMainBundle/Entity/Civility.php | 1 + src/Bundle/ChillMainBundle/chill.api.specs.yaml | 10 ++++++++++ .../ChillThirdPartyExtension.php | 15 +++++++++++++++ .../Entity/ThirdPartyProfession.php | 5 +++-- .../ChillThirdPartyBundle/chill.api.specs.yaml | 11 +++++++++++ 6 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 772f4d8ee..0880a049f 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -538,6 +538,20 @@ class ChillMainExtension extends Extension implements ], ], ], + [ + 'class' => \Chill\MainBundle\Entity\Civility::class, + 'name' => 'civility', + 'base_path' => '/api/1.0/main/civility', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_index' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + ], + ], + ], + ], ], ]); } diff --git a/src/Bundle/ChillMainBundle/Entity/Civility.php b/src/Bundle/ChillMainBundle/Entity/Civility.php index c91016a63..cd4a75e5f 100644 --- a/src/Bundle/ChillMainBundle/Entity/Civility.php +++ b/src/Bundle/ChillMainBundle/Entity/Civility.php @@ -29,6 +29,7 @@ class Civility /** * @ORM\Column(type="boolean") + * @Serializer\Groups({"read"}) */ private bool $active = true; diff --git a/src/Bundle/ChillMainBundle/chill.api.specs.yaml b/src/Bundle/ChillMainBundle/chill.api.specs.yaml index 753cb855c..0f97335a2 100644 --- a/src/Bundle/ChillMainBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillMainBundle/chill.api.specs.yaml @@ -771,5 +771,15 @@ paths: description: "accepted" 403: description: "unauthorized" + /1.0/main/civility.json: + get: + tags: + - civility + summary: Return all civility types + responses: + 200: + description: "ok" + 401: + description: "Unauthorized" diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php index 1981d6daf..124f5b7f3 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php @@ -126,6 +126,21 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte ], ], ], + [ + 'class' => \Chill\ThirdPartyBundle\Entity\ThirdPartyProfession::class, + // 'controller' => \Chill\MainBundle\Controller\ProfessionApiController::class, + 'name' => 'profession', + 'base_path' => '/api/1.0/thirdparty/professions', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_index' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + ], + ], + ], + ], ], ]); } diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php index 1963b34a7..bf10c7cf1 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php @@ -23,6 +23,7 @@ class ThirdPartyProfession { /** * @ORM\Column(type="boolean") + * @Serializer\Groups({"read"}) */ private bool $active = true; @@ -30,13 +31,13 @@ class ThirdPartyProfession * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") - * @Serializer\Groups({"docgen:read"}) + * @Serializer\Groups({"docgen:read", "read"}) */ private ?int $id = null; /** * @ORM\Column(type="json") - * @Serializer\Groups({"docgen:read"}) + * @Serializer\Groups({"docgen:read", "read"}) */ private array $name = []; diff --git a/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml b/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml index 52db7589c..eb303a4f0 100644 --- a/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillThirdPartyBundle/chill.api.specs.yaml @@ -110,3 +110,14 @@ paths: description: "OK" 422: description: "Object with validation errors" + + /1.0/thirdparty/professions.json: + get: + tags: + - thirdparty + summary: Return all thirdparty professions + responses: + 200: + description: "ok" + 401: + description: "Unauthorized" From 3860adc435761641d5a3f3ae02ae53d8d20ec6e2 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 13 Jan 2022 14:34:28 +0100 Subject: [PATCH 006/147] translations added --- .../Resources/public/vuejs/OnTheFly/i18n.js | 3 +++ .../ChillMainBundle/Resources/public/vuejs/_js/i18n.js | 3 ++- .../Resources/public/vuejs/_js/i18n.js | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js index 3cba67149..2400f8e80 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js @@ -17,6 +17,9 @@ const ontheflyMessages = { person: "un nouvel usager", thirdparty: "un nouveau tiers professionnel" }, + addContact: { + title: "Créer un contact pour ..." + } } } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js index 1ab8eb29a..d075dfacd 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js @@ -46,7 +46,8 @@ const messages = { person: "Quitter la page et ouvrir la fiche de l'usager", thirdparty: "Quitter la page et voir le tiers", }, - refresh: 'Rafraîchir' + refresh: 'Rafraîchir', + addContact: 'Ajouter un contact' }, nav: { next: "Suivant", diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js index 37d09320d..86b39ae36 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_js/i18n.js @@ -4,7 +4,12 @@ const thirdpartyMessages = { name: "Dénomination", email: "Courriel", phonenumber: "Téléphone", - } + comment: "Comment", + profession: "Qualité", + civility: "Civilité" + }, + child_of: "Contact de: ", + children: "Personnes de contact: ", } }; From 6a3f17962b2d68a836a5d279a35a8bceab61c6b8 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Thu, 13 Jan 2022 14:35:53 +0100 Subject: [PATCH 007/147] onTheFly modal to add contact to thirdparty - form fields for profession,civility, and comment added - no saving possible yet --- .../vuejs/OnTheFly/components/OnTheFly.vue | 15 +- .../_components/AddPersons/TypeThirdParty.vue | 2 +- .../vuejs/_components/OnTheFly/ThirdParty.vue | 158 ++++++++++++------ 3 files changed, 119 insertions(+), 56 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue index 1e8c057d2..d56fe3c48 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -39,13 +39,12 @@ - - @@ -45,10 +45,10 @@ ref="castThirdparty">
-

{{ $t('onthefly.resource_comment_title') }}

-
- {{ parent.comment }} -
+

{{ $t('onthefly.resource_comment_title') }}

+
+ {{ parent.comment }} +
@@ -61,15 +61,6 @@ - - @@ -114,11 +114,11 @@ export default { computed: { hasResourceComment() { //console.log('hasResourceComment', this.parent); - return (typeof this.parent !== 'undefined' && this.parent !== null) - && this.action === 'show' - && this.parent.type === 'accompanying_period_resource' - && (this.parent.comment !== null && this.parent.comment !== '') - ; + return (typeof this.parent !== 'undefined' && this.parent !== null) + && this.action === 'show' + && this.parent.type === 'accompanying_period_resource' + && (this.parent.comment !== null && this.parent.comment !== '') + ; }, classAction() { switch (this.action) { diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js index 178203807..0f4d4098a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js @@ -19,8 +19,8 @@ const ontheflyMessages = { }, addContact: { title: "Créer un contact pour {q}" - } - resource_comment_title: "Un commentaire est associé à cet interlocuteur" + }, + resource_comment_title: "Un commentaire est associé à cet interlocuteur", addContact: { title: "Créer un contact pour {q}" } From 20d22b726c1696331e47137354d9064adad0df72 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 19 Jan 2022 10:57:31 +0100 Subject: [PATCH 055/147] possible to add a contact to a thirdparty --- .../vuejs/OnTheFly/components/OnTheFly.vue | 18 +++++++++++++++--- .../Entity/ThirdParty.php | 6 +++--- .../Entity/ThirdPartyProfession.php | 2 +- .../vuejs/_components/OnTheFly/ThirdParty.vue | 10 ++-------- .../Normalizer/ThirdPartyNormalizer.php | 1 + 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue index b65a2c26b..531d4f739 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -218,10 +218,22 @@ export default { type = 'thirdparty' data = this.$refs.castThirdparty.$data.thirdparty; // create the new contact here, bypassing saveFormOnTheFly() -> not working here? - console.log('addContact data', data) - postThirdparty(data) + const body = { + "type": "thirdparty", + "kind": "child", + "name": data.text, + "isChild": true, + "parent": {"type": "thirdparty", "id": this.parent.id}, + "civility": {"id": data.civility}, + "profession": {"id": data.profession}, + "comment": data.comment, + "phonenumber": data.phonenumber, + } + // console.log('body', body) + postThirdparty(body) .then(thirdparty => new Promise((resolve, reject) => { - this.newPriorSuggestion(thirdparty); + // this.newPriorSuggestion(thirdparty); + console.log('thirdparty created', thirdparty) resolve(); })); } else { diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index 7404846e4..5679ea1f2 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -126,7 +126,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface * @var Civility * @ORM\ManyToOne(targetEntity=Civility::class) * ORM\JoinColumn(name="civility", referencedColumnName="id", nullable=true) - * @Groups({"docgen:read", "docgen:read:3party:parent"}) + * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) * @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"}) */ private ?Civility $civility = null; @@ -199,7 +199,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface * * @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", inversedBy="children") * @ORM\JoinColumn(name="parent_id", referencedColumnName="id") - * @Groups({"docgen:read"}) + * @Groups({"read", "write", "docgen:read"}) * @Context(normalizationContext={"groups": "docgen:read:3party:parent"}, groups={"docgen:read"}) */ private ?ThirdParty $parent = null; @@ -210,7 +210,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface * @var ThirdPartyProfession * @ORM\ManyToOne(targetEntity="Chill\ThirdPartyBundle\Entity\ThirdPartyProfession") * ORM\JoinColumn(name="profession", referencedColumnName="id", nullable=true) - * @Groups({"docgen:read", "docgen:read:3party:parent"}) + * @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"}) * @Context(normalizationContext={"groups": "docgen:read"}, groups={"docgen:read:3party:parent"}) */ private ?ThirdPartyProfession $profession = null; diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php index bf10c7cf1..12b0818b5 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdPartyProfession.php @@ -31,7 +31,7 @@ class ThirdPartyProfession * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") - * @Serializer\Groups({"docgen:read", "read"}) + * @Serializer\Groups({"docgen:read", "read", "write"}) */ private ?int $id = null; 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 5299319fa..4b7bade24 100644 --- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue +++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/OnTheFly/ThirdParty.vue @@ -48,7 +48,6 @@
- -
-
- - +
@@ -89,7 +89,7 @@