activity: new activity: show address in parcours location

This commit is contained in:
nobohan 2021-11-24 11:45:29 +01:00
parent a2f6f2b5cb
commit c7f2717676

View File

@ -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
}
}