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;
|
* [Semantic Versioning](https://semver.org/spec/v2.0.0.html) for stable releases;
|
||||||
* date versioning for test 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
|
## Unreleased
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- results which **are** attached to an objective -->
|
<!-- results which **are** attached to an objective -->
|
||||||
<div v-for="g in goalsPicked" :key="g.id">
|
<div v-for="g in goalsPicked" :key="g.goal.id">
|
||||||
<div class="item-title" @click="removeGoal(g)">
|
<div class="item-title" @click="removeGoal(g)">
|
||||||
<span class="removable">{{ g.goal.title.fr }}</span>
|
<span class="removable">{{ g.goal.title.fr }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -428,11 +428,9 @@ export default {
|
|||||||
this.isExpanded = !this.isExpanded;
|
this.isExpanded = !this.isExpanded;
|
||||||
},
|
},
|
||||||
addGoal(g) {
|
addGoal(g) {
|
||||||
|
|
||||||
this.$store.commit('addGoal', g);
|
this.$store.commit('addGoal', g);
|
||||||
},
|
},
|
||||||
removeGoal(g) {
|
removeGoal(g) {
|
||||||
|
|
||||||
this.$store.commit('removeGoal', g);
|
this.$store.commit('removeGoal', g);
|
||||||
},
|
},
|
||||||
addEvaluation(e) {
|
addEvaluation(e) {
|
||||||
|
@ -164,7 +164,14 @@ const store = createStore({
|
|||||||
note: '',
|
note: '',
|
||||||
results: []
|
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);
|
state.goalsPicked.push(g);
|
||||||
|
//console.log('goals picked ids', state.goalsPicked.map(g => g.id))
|
||||||
},
|
},
|
||||||
removeGoal(state, goal) {
|
removeGoal(state, goal) {
|
||||||
state.goalsPicked = state.goalsPicked.filter(g => g.id !== goal.id);
|
state.goalsPicked = state.goalsPicked.filter(g => g.id !== goal.id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user