From c7f27176763274e5a566d284cd6f84a21e211c3a Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 24 Nov 2021 11:45:29 +0100 Subject: [PATCH] activity: new activity: show address in parcours location --- .../vuejs/Activity/components/Location.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue index e9f4e39e6..3a7841cd9 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue +++ b/src/Bundle/ChillActivityBundle/Resources/public/vuejs/Activity/components/Location.vue @@ -90,15 +90,19 @@ export default { ); }, methods: { + labelAccompanyingCourseLocation(value) { + return `${value.address.text} (Localisation du parcours)` + }, customLabel(value) { return value.name ? value.name === '__AccompanyingCourseLocation__' ? - 'Localisation du parcours' : + this.labelAccompanyingCourseLocation(value) : `${value.name} (${value.locationType.title.fr})` : value.locationType.title.fr; }, makeConcernedPersonsLocation(locationType) { let locations = []; + console.log(this.suggestedEntities) this.suggestedEntities.forEach( (e) => { if (e.type === 'person' && e.current_household_address !== null){ @@ -106,7 +110,9 @@ export default { type: 'location', onthefly: true, name: e.text, - address: { id: e.current_household_address.id }, + address: { + id: e.current_household_address.id, + }, locationType: locationType }); } @@ -137,8 +143,11 @@ export default { return { type: 'location', onthefly: true, - name: '__AccompanyingCourseLocation__', //TODO not perfect... shoould show the address - address: { id: accPeriodLocation.address_id }, //TODO is the id sufficient? + name: '__AccompanyingCourseLocation__', + address: { + id: accPeriodLocation.address_id, + text: `${accPeriodLocation.text} - ${accPeriodLocation.postcode.code} ${accPeriodLocation.postcode.name}` + }, //TODO is the id sufficient? locationType: locationType } }