Commit e3bafd79 authored by Jonathan Foucher's avatar Jonathan Foucher
Browse files

Save nextLevel to expectedLevel when changing date or person name

parent c4e47d16
Pipeline #31673 passed with stages
in 24 minutes and 35 seconds
......@@ -99,8 +99,10 @@ export default {
},
set(newValue) {
const evaluation = { ...this.evaluation }
evaluation.measure_levels = this.evaluation.measure_levels.map(m => m.measure_id === this.measure.id ? ({...m, end_date : moment(newValue.startDate).format('YYYY-MM-DD') }) : m)
if (!this.expected_level && this.nextLevel) {
this.expected_level = this.nextLevel;
}
evaluation.measure_levels = this.evaluation.measure_levels.map(m => m.measure_id === this.measure.id ? ({...m, end_date : moment(newValue.startDate).format('YYYY-MM-DD'), expected_level : parseInt(this.expected_level, 10) }) : m)
this.$store.commit('updateEvaluation', evaluation)
}
},
......@@ -110,8 +112,10 @@ export default {
},
set(newValue) {
const evaluation = { ...this.evaluation }
evaluation.measure_levels = this.evaluation.measure_levels.map(m => m.measure_id === this.measure.id ? ({...m, manager : newValue }) : m)
if (!this.expected_level && this.nextLevel) {
this.expected_level = this.nextLevel;
}
evaluation.measure_levels = this.evaluation.measure_levels.map(m => m.measure_id === this.measure.id ? ({...m, manager : newValue, expected_level : parseInt(this.expected_level, 10) }) : m)
this.$store.commit('updateEvaluation', evaluation)
}
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment