improve editing of evaluation

- an evaluation type can be repeated multiple times on the same action;
- in vue, evaluation are listed by key, not id,
- adding an evaluation make appears directly in "edit" mode;
- ...
This commit is contained in:
2021-08-19 10:14:10 +02:00
parent 9447516694
commit bab06796f1
6 changed files with 134 additions and 83 deletions

View File

@@ -96,7 +96,7 @@
<div v-if="showAddEvaluation">
<p>{{ $t('available_evaluations_text') }}</p>
<ul class="list-evaluations">
<li v-for="e in availableForCheckEvaluation" class="badge bg-primary" @click="addEvaluation(e)">
<li v-for="e in evaluationsForAction" class="badge bg-primary" @click="addEvaluation(e)">
<i class="fa fa-plus"></i>
{{ e.title.fr }}
</li>
@@ -349,12 +349,6 @@ export default {
return this.$store.state.goalsForAction.filter(g => !pickedIds.includes(g.id));
},
availableForCheckEvaluation() {
//console.log('evaluationsPicked', this.$store.state.evaluationsPicked);
//console.log('evaluationsForAction', this.$store.state.evaluationsForAction);
let pickedIds = this.$store.state.evaluationsPicked.map(e => e.evaluation.id);
return this.$store.state.evaluationsForAction.filter(e => !pickedIds.includes(e.id));
},
pickedEvaluations() {
return this.$store.state.evaluationsPicked;
},