Make sure to not use the computed property
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
60ffa462a9
commit
d7761732e0
|
@ -44,6 +44,7 @@ import TaskAssigneeService from '../../../services/taskAssignee'
|
|||
import User from '../../misc/user'
|
||||
import LoadingComponent from '../../misc/loading'
|
||||
import ErrorComponent from '../../misc/error'
|
||||
import {CURRENT_TASK} from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: 'editAssignees',
|
||||
|
@ -96,6 +97,11 @@ export default {
|
|||
methods: {
|
||||
addAssignee(user) {
|
||||
this.$store.dispatch('tasks/addAssignee', {user: user, taskId: this.taskId})
|
||||
.then(() => {
|
||||
const task = this.$store.state[CURRENT_TASK]
|
||||
task.assignees = this.assignees
|
||||
this.$store.commit(CURRENT_TASK, task)
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
})
|
||||
|
@ -109,6 +115,9 @@ export default {
|
|||
this.assignees.splice(a, 1)
|
||||
}
|
||||
}
|
||||
const task = this.$store.state[CURRENT_TASK]
|
||||
task.assignees = this.assignees
|
||||
this.$store.commit(CURRENT_TASK, task)
|
||||
})
|
||||
.catch(e => {
|
||||
this.error(e, this)
|
||||
|
|
|
@ -50,7 +50,7 @@ export default {
|
|||
.then(r => {
|
||||
const t = ctx.rootGetters['kanban/getTaskById'](taskId)
|
||||
if (t.task === null) {
|
||||
// Don't try further adding a label if the task is not in kanban
|
||||
// Don't try further adding an assignee if the task is not in kanban
|
||||
// Usually this means the kanban board hasn't been accessed until now.
|
||||
// Vuex seems to have its difficulties with that, so we just log the error and fail silently.
|
||||
console.debug('Could not add assignee to task in kanban, task not found', t)
|
||||
|
|
|
@ -360,7 +360,6 @@
|
|||
|
||||
<script>
|
||||
import TaskService from '../../services/task'
|
||||
import TaskModel from '../../models/task'
|
||||
import relationKinds from '../../models/relationKinds.json'
|
||||
|
||||
import priorites from '../../models/priorities.json'
|
||||
|
@ -415,7 +414,6 @@ export default {
|
|||
return {
|
||||
taskId: Number(this.$route.params.id),
|
||||
taskService: TaskService,
|
||||
//task: TaskModel,
|
||||
relationKinds: relationKinds,
|
||||
// The due date is a seperate property in the task to prevent flatpickr from modifying the task model
|
||||
// in store right after updating it from the api resulting in the wrong due date format being saved in the task.
|
||||
|
@ -463,7 +461,6 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.taskService = new TaskService()
|
||||
// this.task = new TaskModel()
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
@ -502,7 +499,7 @@ export default {
|
|||
this.taskId = Number(this.$route.params.id)
|
||||
this.taskService.get({id: this.taskId})
|
||||
.then(r => {
|
||||
this.$set(this, 'task', r)
|
||||
this.$store.commit(CURRENT_TASK, r)
|
||||
this.$store.commit('attachments/set', r.attachments)
|
||||
this.taskTitle = this.task.title
|
||||
this.taskColor = this.task.hexColor
|
||||
|
@ -514,13 +511,11 @@ export default {
|
|||
})
|
||||
},
|
||||
setActiveFields() {
|
||||
|
||||
// TODO: Make sure all modifications to the current task are made through the store
|
||||
// -> Setter
|
||||
|
||||
const task = this.task
|
||||
this.dueDate = this.task.dueDate ? this.task.dueDate : null
|
||||
// this.task.startDate = this.task.startDate ? this.task.startDate : null
|
||||
// this.task.endDate = this.task.endDate ? this.task.endDate : null
|
||||
task.startDate = this.task.startDate ? this.task.startDate : null
|
||||
task.endDate = this.task.endDate ? this.task.endDate : null
|
||||
this.$store.commit(CURRENT_TASK, task)
|
||||
|
||||
// Set all active fields based on values in the model
|
||||
this.activeFields.assignees = this.task.assignees.length > 0
|
||||
|
@ -574,11 +569,9 @@ export default {
|
|||
|
||||
this.$store.commit(CURRENT_TASK, task)
|
||||
|
||||
console.log(this.task.assignees)
|
||||
|
||||
this.$store.dispatch('tasks/update', this.task)
|
||||
.then(r => {
|
||||
this.$set(this, 'task', r)
|
||||
this.$store.commit(CURRENT_TASK, r)
|
||||
let actions = []
|
||||
if (undoCallback !== null) {
|
||||
actions = [{
|
||||
|
@ -613,7 +606,7 @@ export default {
|
|||
})
|
||||
},
|
||||
toggleTaskDone() {
|
||||
const task = task
|
||||
const task = this.task
|
||||
task.done = !this.task.done
|
||||
this.$store.commit(CURRENT_TASK, task)
|
||||
this.saveTask(() => this.toggleTaskDone())
|
||||
|
|
Reference in New Issue