From 5781f2af890bd1800f4dbda5651ab230ed968507 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 24 Nov 2021 17:21:43 +0100 Subject: [PATCH] main: add the coordinates of the postal code if no full address is selected --- .../public/vuejs/Address/components/AddAddress.vue | 6 ++++++ .../Address/components/AddAddress/AddressSelection.vue | 1 - .../vuejs/Address/components/AddAddress/CitySelection.vue | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) 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 7bf088fb6..87ecff7fb 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue @@ -588,6 +588,12 @@ export default { newAddress = Object.assign(newAddress, { 'point': this.entity.selected.address.point.coordinates }); + } else { + if (this.entity.selected.postcode.coordinates) { + newAddress = Object.assign(newAddress, { + 'point': this.entity.selected.postcode.coordinates + }); + } } // add the address reference, if any diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue index ca2f5d634..f3d5a9adc 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue @@ -141,7 +141,6 @@ export default { } }, addAddress() { - console.log('addAddress: pass here ?? never, it seems'); this.entity.selected.writeNew.address = true; } } 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 3e3dd98d4..aeb5be613 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 @@ -101,6 +101,7 @@ export default { this.entity.selected.city = value; this.entity.selected.postcode.name = value.name; this.entity.selected.postcode.code = value.code; + this.entity.selected.postcode.coordinates = value.center.coordinates; this.entity.selected.writeNew.postcode = false; console.log('writeNew.postcode false, in selectCity'); this.$emit('getReferenceAddresses', value);