From d51752fa4118ac8d9009c63fe3fbd44f680c97ce Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Sat, 4 Sep 2021 12:40:42 +0200 Subject: [PATCH] Address, city/address selector: update writeNew flag when choose existing or create new --- .../Address/components/AddAddress/AddressSelection.vue | 3 +++ .../vuejs/Address/components/AddAddress/CitySelection.vue | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) 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 6f27b5fbf..50a1bd8c1 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 @@ -97,6 +97,7 @@ export default { this.entity.selected.address = value; this.entity.selected.address.street = value.street; this.entity.selected.address.streetNumber = value.streetNumber; + this.entity.selected.writeNew.address = false; this.updateMapCenter(value.point); }, listenInputSearch(query) { @@ -107,6 +108,7 @@ export default { let addr = this.splitAddress(this.$data.value.text); this.entity.selected.address.street = addr.street; this.entity.selected.address.streetNumber = addr.number; + this.entity.selected.writeNew.address = true; } }, splitAddress(address) { @@ -136,6 +138,7 @@ 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 5bad8ed83..828c3ed96 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 @@ -95,11 +95,12 @@ export default { this.entity.selected.city = value; this.entity.selected.postcode.name = value.name; this.entity.selected.postcode.code = value.code; + this.entity.selected.writeNew.postcode = false; this.$emit('getReferenceAddresses', value); this.focusOnAddress(); }, listenInputSearch(query) { - console.log('listenInputSearch', query, this.isCitySelectorOpen); + //console.log('listenInputSearch', query, this.isCitySelectorOpen); if (this.isCitySelectorOpen) { this.$data.value = { text: query }; } else if (this.isEnteredCustomCity) { @@ -108,6 +109,7 @@ export default { this.entity.selected.city = city; this.entity.selected.postcode.name = city.name; this.entity.selected.postcode.code = city.code; + this.entity.selected.writeNew.postcode = true; } }, splitCity(city) { @@ -117,7 +119,7 @@ export default { if (substr.length === 1) { substr = city.split(' '); } - console.log('substr', substr); + //console.log('substr', substr); let decimal = []; substr.forEach((s, i) => { decimal[i] = /^\d+$/.test(s) }); if (decimal[0] === true) { @@ -138,6 +140,7 @@ export default { } }, addPostcode() { + console.log('addPostcode: pass here ?? never, it seems'); this.entity.selected.writeNew.postcode = true; } }