Merge remote-tracking branch 'origin/master' into issue294_suggestPersonInActivity

This commit is contained in:
2021-11-22 14:06:27 +01:00
110 changed files with 3491 additions and 1141 deletions

View File

@@ -10,9 +10,12 @@
</persons-bloc>
</div>
<div v-if="getContext === 'accompanyingCourse' && suggestedEntities.length > 0">
<ul>
<ul class="list-unstyled">
<li v-for="p in suggestedEntities" @click="addSuggestedEntity(p)">
{{ p.text }}
<span class="badge bg-primary" style="cursor: pointer;">
<i class="fa fa-plus fa-fw text-success"></i>
{{ p.text }}
</span>
</li>
</ul>
</div>

View File

@@ -4,7 +4,7 @@
<span class="chill_denomination">
{{ textCutted }}
</span>
<a class="fa fa-fw fa-times"
<a class="fa fa-fw fa-times text-danger text-decoration-none"
@click.prevent="$emit('remove', person)">
</a>
</span>

View File

@@ -55,16 +55,17 @@ export default {
}
},
mounted() {
this.getLocationsList();
getLocations().then(response => new Promise(resolve => {
console.log('getLocations', response);
this.locations = response.results;
if (window.default_location_id) {
let location = this.locations.filter(l => l.id === window.default_location_id);
this.$store.dispatch('updateLocation', location);
}
resolve();
}))
},
methods: {
getLocationsList() {
getLocations().then(response => new Promise(resolve => {
console.log('getLocations', response);
this.locations = response.results;
resolve();
}))
},
customLabel(value) {
return `${value.locationType.title.fr} ${value.name ? value.name : ''}`;
}

View File

@@ -55,6 +55,9 @@ const store = createStore({
.filter((p) => !existingPersonIds.includes(p.id));
},
suggestedRequestor(state) {
if (state.activity.accompanyingPeriod.requestor === null) {
return [];
}
const existingPersonIds = state.activity.persons.map((p) => p.id);
const existingThirdPartyIds = state.activity.thirdParties.map(
(p) => p.id
@@ -74,7 +77,7 @@ const store = createStore({
return state.activity.activityType.usersVisible === 0
? []
: [state.activity.accompanyingPeriod.user].filter(
(u) => !existingUserIds.includes(u.id)
(u) => u !== null && !existingUserIds.includes(u.id)
);
},
suggestedResources(state) {