From f66df3b77c7ac99939f3973a9dd18c5337a4e34c Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 16 Sep 2021 20:36:11 +0200 Subject: [PATCH 1/2] fix include parameters missing comma --- .../Resources/views/Household/address_edit.html.twig | 2 +- .../Resources/views/Household/address_move.html.twig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_edit.html.twig index 353ba09a5..2bc2b6cd0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_edit.html.twig @@ -9,7 +9,7 @@ {# include vue_address component #} {% include '@ChillMain/Address/_insert_vue_address.html.twig' with { targetEntity: { name: 'household', id: household.id }, - backUrl: path('chill_person_household_addresses', { 'household_id': household.id }) + backUrl: path('chill_person_household_addresses', { 'household_id': household.id }), bindModalStep1: false, bindModalStep2: false, } %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig index b6fc39dd9..6d65c0a7f 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig @@ -9,7 +9,7 @@ {# include vue_address component #} {% include '@ChillMain/Address/_insert_vue_address.html.twig' with { targetEntity: { name: 'household', id: household.id }, - backUrl: path('chill_person_household_addresses', { 'household_id': household.id }) + backUrl: path('chill_person_household_addresses', { 'household_id': household.id }), bindModalStep1: false, bindModalStep2: false, } %} From c58d1eccc5c03e6e8115c1cffd528804f9102d1c Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 16 Sep 2021 20:49:46 +0200 Subject: [PATCH 2/2] AddAddress: rename callback method --- .../Resources/public/vuejs/Address/App.vue | 2 +- .../vuejs/Address/components/AddAddress.vue | 27 +++++++------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue index 15635842d..e4d332289 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue @@ -3,7 +3,7 @@ v-bind:key="key" v-bind:context="context" v-bind:options="options" - v-bind:addressChanged="submitAddress" + v-bind:addressChangedCallback="submitAddress" ref="addAddress"> diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue index 3ab9fe12e..88e4d8be3 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue @@ -128,7 +128,7 @@ import EditAddressPane from './EditAddressPane.vue'; export default { name: "AddAddress", - props: ['context', 'options', 'addressChanged'], + props: ['context', 'options', 'addressChangedCallback'], components: { Modal, ShowAddressPane, @@ -413,16 +413,14 @@ export default { }) .then(payload => { console.log('payload', payload); - this.addressChanged(payload); + this.closePaneAndCallbackSubmit(payload); } ); } else { this.addNewAddress(newAddress) - .then(payload => this.addressChanged(payload)); + .then(payload => this.closePaneAndCallbackSubmit(payload)); } - - }, /* @@ -518,24 +516,19 @@ export default { }, /* - * Method called by parent when submitting address + * Method just add closing pane to the callback method * (get out step1 show pane, submit button) - submitNewAddress() + */ + closePaneAndCallbackSubmit(payload) { - let payload = { - entity: this.context.entity.name, - entityId: this.context.entity.id, - addressId: this.entity.address.address_id - }; + console.log('close pane and call parent callback method', payload); - console.log('submitNewAddress return', payload); - - this.initForm(); + //this.initForm(); this.flag.showPane = false; - return payload; + // callback props method from parent + this.addressChangedCallback(payload); } - */ } }