mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
AccompanyingCourseWorkEdit: fix bug, remove goal one by one
(adding a temporary negative index on just created goals)
This commit is contained in:
parent
c7e992fd1a
commit
6a4d7fbece
@ -7,7 +7,7 @@ and this project adheres to
|
||||
|
||||
* [Semantic Versioning](https://semver.org/spec/v2.0.0.html) for stable releases;
|
||||
* date versioning for test releases
|
||||
* [accompanyingCourse_work] fix styles conflicts
|
||||
* [accompanyingCourse_work] fix styles conflicts + fix bug with remove goal (remove goals one at a time)
|
||||
|
||||
## Unreleased
|
||||
|
||||
|
@ -50,10 +50,10 @@
|
||||
</div>
|
||||
|
||||
<!-- results which **are** attached to an objective -->
|
||||
<div v-for="g in goalsPicked" :key="g.id">
|
||||
<div class="item-title" @click="removeGoal(g)">
|
||||
<span class="removable">{{ g.goal.title.fr }}</span>
|
||||
</div>
|
||||
<div v-for="g in goalsPicked" :key="g.goal.id">
|
||||
<div class="item-title" @click="removeGoal(g)">
|
||||
<span class="removable">{{ g.goal.title.fr }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<add-result :goal="g.goal" destination="goal"></add-result>
|
||||
</div>
|
||||
@ -428,11 +428,9 @@ export default {
|
||||
this.isExpanded = !this.isExpanded;
|
||||
},
|
||||
addGoal(g) {
|
||||
|
||||
this.$store.commit('addGoal', g);
|
||||
},
|
||||
removeGoal(g) {
|
||||
|
||||
this.$store.commit('removeGoal', g);
|
||||
},
|
||||
addEvaluation(e) {
|
||||
|
@ -164,7 +164,14 @@ const store = createStore({
|
||||
note: '',
|
||||
results: []
|
||||
}
|
||||
const tmpIndex = () => {
|
||||
let ar = state.goalsPicked.map(g => g.id),
|
||||
s = Math.min(...ar);
|
||||
return (s < 0) ? s : 0
|
||||
};
|
||||
g.id = tmpIndex() -1
|
||||
state.goalsPicked.push(g);
|
||||
//console.log('goals picked ids', state.goalsPicked.map(g => g.id))
|
||||
},
|
||||
removeGoal(state, goal) {
|
||||
state.goalsPicked = state.goalsPicked.filter(g => g.id !== goal.id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user