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 7160d7cec..7bf088fb6 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue @@ -617,7 +617,7 @@ export default { let newPostcode = this.entity.selected.postcode; newPostcode = Object.assign(newPostcode, { 'country': {'id': this.entity.selected.country.id }, - }); + });//TODO why not assign postcodeBody here = Object.assign(postcodeBody, {'origin': 3}); ? console.log('writeNew postcode is true! newPostcode: ', newPostcode); newAddress = Object.assign(newAddress, { 'newPostcode': newPostcode @@ -649,9 +649,7 @@ export default { if ('newPostcode' in payload) { let postcodeBody = payload.newPostcode; - if (this.context.target.name === 'person') { // !!! maintain here ? - postcodeBody = Object.assign(postcodeBody, {'origin': 3}); - } + postcodeBody = Object.assign(postcodeBody, {'origin': 3}); console.log('juste before post new postcode', postcodeBody); return postPostalCode(postcodeBody) .then(postalCode => { diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue index 9b6a7b87f..ef3683ec4 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CitySelection.vue @@ -50,7 +50,7 @@ import VueMultiselect from 'vue-multiselect'; export default { name: 'CitySelection', components: { VueMultiselect }, - props: ['entity', 'focusOnAddress'], + props: ['entity', 'focusOnAddress', 'updateMapCenter'], emits: ['getReferenceAddresses'], data() { return { @@ -95,6 +95,7 @@ export default { return (value.code && value.name) ? `${value.code}-${value.name}` : ''; }, selectCity(value) { + console.log(value) this.entity.selected.city = value; this.entity.selected.postcode.name = value.name; this.entity.selected.postcode.code = value.code; @@ -102,6 +103,7 @@ export default { console.log('writeNew.postcode false, in selectCity'); this.$emit('getReferenceAddresses', value); this.focusOnAddress(); + this.updateMapCenter(value.center); }, listenInputSearch(query) { //console.log('listenInputSearch', query, this.isCitySelectorOpen); 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 9e257fe4a..2129a69d1 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue @@ -31,6 +31,7 @@ @@ -135,7 +136,7 @@ export default { } }, updateMapCenter(point) { - //console.log('point', point); + console.log('point', point); this.addressMap.center[0] = point.coordinates[1]; // TODO use reverse() this.addressMap.center[1] = point.coordinates[0]; this.$refs.addressMap.update(); // cast child methods