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 @@ - {{ $t('action.edit')}} + class="btn btn-create"> + {{ $t('create_a_new_address')}} - @@ -55,12 +50,26 @@ + + + + {{ $t('action.cancel') }} + + + + + + {{ $t('create_a_new_address')}} + + + + @@ -83,7 +92,7 @@ - + {{ $t('action.cancel') }} - - {{ $t('action.valid')}} + + {{ $t('action.save')}} @@ -107,13 +115,26 @@ + + + + {{ $t('action.cancel') }} + + + + + + {{ $t('action.save')}} + + + + @@ -136,7 +157,7 @@ @@ -144,13 +165,14 @@ - + {{ $t('action.edit')}} + @@ -159,12 +181,20 @@ + + + + + {{ $t('action.edit')}} + + + + @@ -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 @@ - +step3 @@ -40,23 +40,16 @@ + :defaultz="this.defaultz"> + + + - - - {{ $t('action.edit')}} - - - + + + + @@ -76,13 +69,12 @@ export default { props: [ 'context', 'options', - 'default', + 'defaultz', 'flag', 'entity', 'errorMsg', 'insideModal' ], - emits: ['openEditPane'], computed: { address() { return this.entity.address; diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue index 16fc335c8..1876ae375 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue @@ -1,4 +1,4 @@ - +step2 @@ -55,20 +55,16 @@ + :defaultz="this.defaultz"> + + + - - - {{ $t('action.cancel') }} - - - - - {{ $t('action.save')}} - - + + + + @@ -96,13 +92,13 @@ export default { props: [ 'context', 'options', - 'default', + 'defaultz', 'flag', 'entity', 'errorMsg', 'insideModal' ], - emits: ['closeEditPane', 'getCities', 'getReferenceAddresses'], + emits: ['getCities', 'getReferenceAddresses'], data() { return { value: false diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue index 2738f7775..8ee8f0f46 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue @@ -11,9 +11,11 @@ {{ $t(getSuccessText) }} - + - + +step1 {{ $t('loading') }} - - {{ errorMsg }} - + {{ errorMsg }} - - {{ $t(getSuccessText) }} - + {{ $t(getSuccessText) }} - suggestions + {{ $t('address_suggestions') }} + :defaultz="this.defaultz"> + + + - - - {{ $t('action.edit')}} - - + + + + + - - diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/i18n.js index b41da821f..27ef5d565 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/i18n.js @@ -33,6 +33,7 @@ const addressMessages = { validTo: "L'adresse est valable jusqu'au", back_to_the_list: 'Retour à la liste', loading: 'chargement en cours...', + address_suggestions: "Suggestion d'adresses", address_new_success: 'La nouvelle adresse est enregistrée', address_edit_success: 'L\'adresse a été mise à jour', diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js index 193900c21..17be4ec25 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/index.js @@ -48,7 +48,9 @@ containers.forEach((container) => { validTo: container.dataset.useValidTo === 'true' //boolean, default: false }, /// Force redirection after last step (cfr. backUrl) - forceRedirect: container.dataset.forceRedirect === 'true' //boolean, default: false + forceRedirect: container.dataset.forceRedirect === 'true', //boolean, default: false + /// Don't display show renderbox Address + onlyButton: container.dataset.onlyButton === 'true' //boolean, default: false } } } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue index a7638a5f1..d9bd5f52b 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/CourseLocation.vue @@ -93,7 +93,8 @@ export default { // Use Date fields useDate: { validFrom: true - } + }, + onlyButton: true } } } 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 49dad3619..bd2cce5ec 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_edit.html.twig @@ -10,9 +10,11 @@ {% 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 }), - openPanesInModal: false, - stickyActions: true } %} + {# + stickyActions: true + openPanesInModal: false, + #} {% endblock %} 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 2b7dfa8f0..ccb9f20cc 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/address_move.html.twig @@ -11,6 +11,7 @@ targetEntity: { name: 'household', id: household.id }, backUrl: path('chill_person_household_addresses', { 'household_id': household.id }), openPanesInModal: false, + stickyActions: true } %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig index 3bee011dd..2f359c3ed 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/Household/addresses.html.twig @@ -17,8 +17,10 @@ {# include vue_address component #} {% include '@ChillMain/Address/_insert_vue_address.html.twig' with { targetEntity: { name: 'household', id: household.id }, - backUrl: path('chill_person_household_address_move', { 'household_id': household.id }), + backUrl: path('chill_person_household_addresses', { 'household_id': household.id }), + forceRedirect: true, mode: 'new', + useValidFrom: true, buttonSize: 'btn-lg', buttonText: 'Move household', modalTitle: 'Move household',