diff --git a/CHANGELOG.md b/CHANGELOG.md index 50bea47b4..caf9a9249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to ## Unreleased +* [main] translate multiselect messages when selecting/creating address +* [main] set the coordinates of the city when creating a new address OR choosing "pas d'adresse complète" * Use the user.label in accompanying course banner, instead of username; * fix: show validation message when closing accompanying course; * [thirdparty] link from modal to thirdparty detail page fixed (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/228) 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..2409dca53 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 @@ -4,6 +4,10 @@ @@ -141,7 +143,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..6e6c064b5 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 @@ -12,6 +12,8 @@ label="value" :custom-label="transName" :placeholder="$t('select_city')" + :select-label="$t('press_enter_to_select')" + :deselect-label="$t('create_postal_code')" :taggable="true" :multiple="false" @tag="addPostcode" @@ -101,6 +103,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); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue index 2e6ec86a7..c15db8d2a 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/CountrySelection.vue @@ -9,6 +9,8 @@ v-bind:placeholder="$t('select_country')" v-bind:options="sortedCountries" v-model="value" + :select-label="$t('press_enter_to_select')" + :deselect-label="$t('press_enter_to_remove')" @select="selectCountry"> diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/i18n.js index 9d7185696..ab0032de6 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/i18n.js @@ -1,5 +1,7 @@ const addressMessages = { fr: { + press_enter_to_select: 'Appuyer sur Entrée pour sélectionner', + press_enter_to_remove: 'Appuyer sur Entrée pour désélectionner', add_an_address_title: 'Créer une adresse', edit_an_address_title: 'Modifier une adresse', create_a_new_address: 'Créer une nouvelle adresse',