From c58d1eccc5c03e6e8115c1cffd528804f9102d1c Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Thu, 16 Sep 2021 20:49:46 +0200 Subject: [PATCH] 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); } - */ } }