mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Feature: [update accompanying course] do not show "locate to person" button if the person is already locating the course
This commit is contained in:
parent
204c28d373
commit
99cdf0ebaf
@ -19,7 +19,7 @@
|
|||||||
<div class="item-row separator">
|
<div class="item-row separator">
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<button-location
|
<button-location
|
||||||
v-if="hasCurrentHouseholdAddress"
|
v-if="hasCurrentHouseholdAddress && !isPersonLocatingCourse(participation.person)"
|
||||||
v-bind:person="participation.person">
|
v-bind:person="participation.person">
|
||||||
</button-location>
|
</button-location>
|
||||||
<li v-if="participation.person.current_household_id">
|
<li v-if="participation.person.current_household_id">
|
||||||
@ -109,9 +109,12 @@ export default {
|
|||||||
},
|
},
|
||||||
getCurrentHouseholdUrl() {
|
getCurrentHouseholdUrl() {
|
||||||
return `/fr/person/household/${this.participation.person.current_household_id}/summary?returnPath=${this.getAccompanyingCourseReturnPath}`
|
return `/fr/person/household/${this.participation.person.current_household_id}/summary?returnPath=${this.getAccompanyingCourseReturnPath}`
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
isPersonLocatingCourse(person) {
|
||||||
|
return this.$store.getters.isPersonLocatingCourse(person);
|
||||||
|
},
|
||||||
saveFormOnTheFly(payload) {
|
saveFormOnTheFly(payload) {
|
||||||
console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
|
console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
|
||||||
payload.target = 'participation';
|
payload.target = 'participation';
|
||||||
|
@ -49,6 +49,13 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou
|
|||||||
postFirstPinnedCommentResponse: null,
|
postFirstPinnedCommentResponse: null,
|
||||||
},
|
},
|
||||||
getters: {
|
getters: {
|
||||||
|
isPersonLocatingCourse: (state) => (person) => {
|
||||||
|
if (state.accompanyingCourse.locationStatus !== 'person') {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return state.accompanyingCourse.personLocation.id === person.id;
|
||||||
|
},
|
||||||
isParticipationValid(state) {
|
isParticipationValid(state) {
|
||||||
return state.accompanyingCourse.participations.length > 0;
|
return state.accompanyingCourse.participations.length > 0;
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user