1
0

fix: directly set arrays, objects and delete directly

Not needed since vue3 uses proxies
This commit is contained in:
Dominik Pschenitschni
2021-08-19 21:35:38 +02:00
parent 2b20f328cb
commit db49b9b532
33 changed files with 104 additions and 113 deletions

View File

@ -143,7 +143,7 @@ export default {
this.taskService
.update(this.taskEditTask)
.then((r) => {
this.$set(this, 'taskEditTask', r)
this.taskEditTask = r
this.initTaskFields()
this.$message.success({message: this.$t('task.detail.updateSuccess')})
})

View File

@ -299,15 +299,15 @@ export default {
this.fullWidth += this.dayWidth
}
console.debug('prepareGanttDays; years:', years)
this.$set(this, 'days', years)
this.days = years
},
parseTasks() {
this.setDates()
this.loadTasks()
},
loadTasks() {
this.$set(this, 'theTasks', [])
this.$set(this, 'tasksWithoutDates', [])
this.theTasks = []
this.tasksWithoutDates = []
const getAllTasks = (page = 1) => {
return this.taskCollectionService
@ -392,7 +392,7 @@ export default {
// prevent it from containing outdated Data in the first place.
for (const tt in this.theTasks) {
if (this.theTasks[tt].id === this.taskDragged.id) {
this.$set(this, 'taskDragged', this.theTasks[tt])
this.taskDragged = this.theTasks[tt]
break
}
}
@ -422,11 +422,7 @@ export default {
} else {
for (const tt in this.theTasks) {
if (this.theTasks[tt].id === r.id) {
this.$set(
this.theTasks,
tt,
this.addGantAttributes(r),
)
this.theTasks[tt] = this.addGantAttributes(r)
break
}
}

View File

@ -229,7 +229,7 @@ export default {
this.taskCommentService
.getAll({taskId: this.taskId})
.then(r => {
this.$set(this, 'comments', r)
this.comments = r
this.makeActions()
})
.catch((e) => {
@ -286,7 +286,7 @@ export default {
.then((r) => {
for (const c in this.comments) {
if (this.comments[c].id === this.commentEdit.id) {
this.$set(this.comments, c, r)
this.comments[c] = r
}
}
this.saved = this.commentEdit.id
@ -322,12 +322,12 @@ export default {
makeActions() {
if (this.canWrite) {
this.comments.forEach((c) => {
this.$set(this.actions, c.id, [
this.actions[c.id] = [
{
action: () => this.toggleDelete(c.id),
title: this.$t('misc.delete'),
},
])
]
})
}
},

View File

@ -111,16 +111,16 @@ export default {
this.listUserService.getAll({listId: this.listId}, {s: query})
.then(response => {
// Filter the results to not include users who are already assigned
this.$set(this, 'foundUsers', differenceWith(response, this.assignees, (first, second) => {
this.foundUsers = differenceWith(response, this.assignees, (first, second) => {
return first.id === second.id
}))
})
})
.catch(e => {
this.$message.error(e)
})
},
clearAllFoundUsers() {
this.$set(this, 'foundUsers', [])
this.foundUsers = []
},
focus() {
this.$refs.multiselect.focus()

View File

@ -56,14 +56,14 @@ export default {
this.listSerivce.getAll({}, {s: query})
.then(response => {
this.$set(this, 'foundLists', response)
this.foundLists = response
})
.catch(e => {
this.$message.error(e)
})
},
clearAll() {
this.$set(this, 'foundLists', [])
this.foundLists = []
},
select(list) {
this.list = list

View File

@ -188,7 +188,7 @@ export default {
findTasks(query) {
this.taskService.getAll({}, {s: query})
.then(response => {
this.$set(this, 'foundTasks', response)
this.foundTasks = response
})
.catch(e => {
this.$message.error(e)
@ -203,7 +203,7 @@ export default {
this.taskRelationService.create(rel)
.then(() => {
if (!this.relatedTasks[this.newTaskRelationKind]) {
this.$set(this.relatedTasks, this.newTaskRelationKind, [])
this.relatedTasks[this.newTaskRelationKind] = []
}
this.relatedTasks[this.newTaskRelationKind].push(this.newTaskRelationTask)
this.newTaskRelationTask = null