mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
activity component split added persons between 'Usagers du parcours' and 'Tiers non pros.'
This commit is contained in:
parent
e123ee5d03
commit
66776eed01
@ -80,16 +80,26 @@ export default {
|
||||
this.setPersonsInBloc();
|
||||
},
|
||||
setPersonsInBloc() {
|
||||
this.courseParticipations();
|
||||
console.log('setPersonsInBloc');
|
||||
let participations = this.getCourseParticipations();
|
||||
let personsAssociated = [];
|
||||
let personsNotAssociated = this.persons;
|
||||
|
||||
this.persons.forEach(person => {
|
||||
participations.forEach(participation => {
|
||||
if (person.id === participation.id) {
|
||||
personsAssociated.push(person);
|
||||
personsNotAssociated = personsNotAssociated.filter(p => p !== person);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
this.personsBlocs.forEach(bloc => {
|
||||
|
||||
switch (bloc.key) {
|
||||
case 'personsAssociated':
|
||||
bloc.persons = this.persons;
|
||||
bloc.persons = personsAssociated;
|
||||
break;
|
||||
case 'personsNotAssociated':
|
||||
//bloc.persons = this.persons;
|
||||
bloc.persons = personsNotAssociated;
|
||||
break;
|
||||
case 'thirdparty':
|
||||
bloc.persons = this.thirdParties;
|
||||
@ -100,12 +110,14 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
courseParticipations() {
|
||||
getCourseParticipations() {
|
||||
let participations = [];
|
||||
this.accompanyingCourse.participations.forEach(participation => {
|
||||
if (participation.endDate) {
|
||||
console.log('usager du parcours', participation.person.text);
|
||||
participations.push(participation.person);
|
||||
}
|
||||
});
|
||||
return participations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user