diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue index e72e26c14..884849ba6 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue @@ -10,7 +10,6 @@ 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 27a9b6299..d5bf8f9e2 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue @@ -4,7 +4,7 @@ @@ -39,14 +39,9 @@ @@ -55,12 +50,26 @@ + + + + @@ -83,7 +92,7 @@ @@ -107,13 +115,26 @@ + + + + @@ -136,7 +157,7 @@ @@ -144,13 +165,14 @@ @@ -159,12 +181,20 @@ + + + @@ -199,7 +229,7 @@ export default { loading: false, success: false }, - default: { + defaultz: { button: { text: { create: 'add_an_address_title', edit: 'edit_address' }, type: { create: 'btn-create', edit: 'btn-update'}, @@ -211,7 +241,9 @@ export default { useDate: { validFrom: false, validTo: false - } + }, + forceRedirect: false, + onlyButton: false }, entity: { address: {}, // <== loaded and returned @@ -251,15 +283,15 @@ export default { computed: { inModal() { return (typeof this.options.openPanesInModal !== 'undefined') ? - this.options.openPanesInModal : this.default.openPanesInModal; + this.options.openPanesInModal : this.defaultz.openPanesInModal; }, useDatePane() { let vFrom = (typeof this.options.useDate !== 'undefined' && typeof this.options.useDate.validFrom !== 'undefined') ? - this.options.useDate.validFrom : this.default.useDate.validFrom ; + this.options.useDate.validFrom : this.defaultz.useDate.validFrom ; let vTo = (typeof this.options.useDate !== 'undefined' && typeof this.options.useDate.validTo !== 'undefined') ? - this.options.useDate.validTo : this.default.useDate.validTo ; + this.options.useDate.validTo : this.defaultz.useDate.validTo ; return (vFrom || vTo) ? true : false; }, hasSuggestions() { @@ -267,6 +299,10 @@ export default { //return addressSuggestions.length > 0 return true; }, + displaySuggestions() { + console.log('displaySuggestions'); + return !this.context.edit && this.hasSuggestions; + }, getTextTitle() { if ( typeof this.options.title !== 'undefined' && ( this.options.title.edit !== null @@ -274,11 +310,12 @@ export default { )) { return (this.context.edit) ? this.options.title.edit : this.options.title.create; } - return (this.context.edit) ? this.default.title.edit : this.default.title.create; + return (this.context.edit) ? this.defaultz.title.edit : this.defaultz.title.create; }, bypassFirstStep() { // exception: passing step0 if new address and pane are not in modal - return !this.context.edit && !this.inModal && this.flag.editPane === false + console.log('bypassFirstStep'); + return !this.context.edit && !this.inModal; } }, mounted() { @@ -290,7 +327,7 @@ export default { //console.log('options useDate.validTo', this.options.useDate.validTo); console.log('useDatePane', this.useDatePane); - //console.log('Mounted now !'); + console.log('Mounted now !'); this.openShowPane(); }, @@ -304,7 +341,7 @@ export default { console.log('getInitialAddress'); this.getInitialAddress(this.context.addressId); } - if (this.bypassFirstStep) { + if (this.flag.editPane === false && this.bypassFirstStep) { this.closeShowPane(); this.openEditPane(); } else { @@ -328,28 +365,27 @@ export default { console.log('step1: close the Suggestion Panel'); }, openEditPane() { - /* - if (!this.context.edit && this.hasSuggestions) { + if (this.flag.suggestPane === false && this.displaySuggestions) { this.openSuggestPane(); } else { + if (this.flag.suggestPane === true) { + this.closeSuggestPane(); + } + this.initForm(); + this.getCountries(); + this.flag.editPane = true; + console.log('step2: open the Edit panel'); } - */ - this.initForm(); - this.getCountries(); - this.flag.editPane = true; - console.log('step2: open the Edit panel'); }, closeEditPane() { this.applyChanges(); this.flag.editPane = false; console.log('step2: close the Edit Panel'); - /* if (!this.context.edit && this.useDatePane) { this.openDatePane(); } else { + this.openShowPane() } - */ - this.openShowPane() }, openDatePane() { this.flag.datePane = true; @@ -363,7 +399,7 @@ export default { this.flag.suggestPane = false; this.flag.editPane = false; this.flag.datePane = false; - this.flag.showPane = true; + this.openShowPane(); }, /* @@ -494,16 +530,13 @@ export default { }); } + console.log('apply changes'); if (this.context.edit) { this.updateAddress({ addressId: this.context.addressId, newAddress: newAddress }) - .then(payload => { - console.log('payload', payload); - this.closePaneAndCallbackSubmit(payload); - } - ); + .then(payload => this.closePaneAndCallbackSubmit(payload)); } else { this.addNewAddress(newAddress) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue index ed461ffb5..6b707a8dd 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/DatePane.vue @@ -1,4 +1,4 @@ -