activity: label location

This commit is contained in:
nobohan 2021-11-23 17:32:11 +01:00
parent c1a2112d48
commit 1b579f7930

View File

@ -61,7 +61,7 @@ export default {
new Promise((resolve) => {
getLocationTypeByDefaultFor('person').then(
personLocationType => {
const personLocation = this.makePersonLocation(personLocationType);
const personLocation = this.makeAccompanyingPeriodLocation(personLocationType);
const concernedPersonsLocation =
this.makeConcernedPersonsLocation(personLocationType);
getLocationTypeByDefaultFor('thirdparty').then(
@ -91,9 +91,11 @@ export default {
},
methods: {
customLabel(value) {
return `${value.locationType.title.fr} ${
value.name ? value.name : ""
}`;
return value.name ?
value.name === '__AccompanyingCourseLocation__' ?
'Localisation du parcours' :
`${value.name} (${value.locationType.title.fr})` :
value.locationType.title.fr;
},
makeConcernedPersonsLocation(locationType) {
let locations = [];
@ -127,12 +129,12 @@ export default {
)
return locations;
},
makePersonLocation(locationType) {
makeAccompanyingPeriodLocation(locationType) {
console.log(this.activity)
const accPeriodLocation = this.activity.accompanyingPeriod.location;
return {
type: 'location',
name: 'Adresse du parcours', //TODO trans
name: '__AccompanyingCourseLocation__', //TODO not perfect...
address: { id: accPeriodLocation.address_id }, //TODO is the id sufficient?
locationType: locationType
}