Fix id params not being named correctly
This commit is contained in:
@ -113,7 +113,7 @@
|
||||
name: 'ListView',
|
||||
data() {
|
||||
return {
|
||||
listID: this.$route.params.id,
|
||||
listId: this.$route.params.id,
|
||||
taskService: TaskService,
|
||||
list: {},
|
||||
isTaskEdit: false,
|
||||
@ -172,11 +172,11 @@
|
||||
},
|
||||
editTask(id) {
|
||||
// Find the selected task and set it to the current object
|
||||
let theTask = this.getTaskByID(id) // Somehow this does not work if we directly assign this to this.taskEditTask
|
||||
let theTask = this.getTaskById(id) // Somehow this does not work if we directly assign this to this.taskEditTask
|
||||
this.taskEditTask = theTask
|
||||
this.isTaskEdit = true
|
||||
},
|
||||
getTaskByID(id) {
|
||||
getTaskById(id) {
|
||||
for (const t in this.tasks) {
|
||||
if (this.tasks[t].id === parseInt(id)) {
|
||||
return this.tasks[t]
|
||||
|
@ -27,8 +27,8 @@
|
||||
Assignees
|
||||
</div>
|
||||
<edit-assignees
|
||||
:task-i-d="task.id"
|
||||
:list-i-d="task.listId"
|
||||
:task-id="task.id"
|
||||
:list-id="task.listId"
|
||||
:initial-assignees="task.assignees"
|
||||
ref="assignees"
|
||||
/>
|
||||
@ -150,7 +150,7 @@
|
||||
</span>
|
||||
Labels
|
||||
</div>
|
||||
<edit-labels :task-i-d="taskID" v-model="task.labels" ref="labels"/>
|
||||
<edit-labels :task-id="taskId" v-model="task.labels" ref="labels"/>
|
||||
</div>
|
||||
|
||||
<!-- Description -->
|
||||
@ -177,7 +177,7 @@
|
||||
<!-- Attachments -->
|
||||
<div class="content attachments has-top-border" v-if="activeFields.attachments">
|
||||
<attachments
|
||||
:task-i-d="taskID"
|
||||
:task-id="taskId"
|
||||
:initial-attachments="task.attachments"
|
||||
ref="attachments"
|
||||
/>
|
||||
@ -192,7 +192,7 @@
|
||||
Related Tasks
|
||||
</h3>
|
||||
<related-tasks
|
||||
:task-i-d="taskID"
|
||||
:task-id="taskId"
|
||||
:list-id="task.listId"
|
||||
:initial-related-tasks="task.relatedTasks"
|
||||
:show-no-relations-notice="true"
|
||||
@ -201,7 +201,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Comments -->
|
||||
<comments :task-i-d="taskID"/>
|
||||
<comments :task-id="taskId"/>
|
||||
</div>
|
||||
<div class="column is-one-fifth action-buttons">
|
||||
<a class="button is-outlined noshadow has-no-border" :class="{'is-success': !task.done}" @click="toggleTaskDone()">
|
||||
@ -319,7 +319,7 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
taskID: Number(this.$route.params.id),
|
||||
taskId: Number(this.$route.params.id),
|
||||
taskService: TaskService,
|
||||
task: TaskModel,
|
||||
relationKinds: relationKinds,
|
||||
@ -365,8 +365,8 @@
|
||||
},
|
||||
methods: {
|
||||
loadTask() {
|
||||
this.taskID = Number(this.$route.params.id)
|
||||
this.taskService.get({id: this.taskID})
|
||||
this.taskId = Number(this.$route.params.id)
|
||||
this.taskService.get({id: this.taskId})
|
||||
.then(r => {
|
||||
this.$set(this, 'task', r)
|
||||
this.setListAndNamespaceTitleFromParent()
|
||||
|
@ -114,20 +114,20 @@
|
||||
|
||||
<div class="field has-addons">
|
||||
<div class="control is-expanded">
|
||||
<edit-assignees :task-i-d="taskEditTask.id" :list-i-d="taskEditTask.listId" :initial-assignees="taskEditTask.assignees"/>
|
||||
<edit-assignees :task-id="taskEditTask.id" :list-id="taskEditTask.listId" :initial-assignees="taskEditTask.assignees"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label class="label">Labels</label>
|
||||
<div class="control">
|
||||
<edit-labels :task-i-d="taskEditTask.id" v-model="taskEditTask.labels"/>
|
||||
<edit-labels :task-id="taskEditTask.id" v-model="taskEditTask.labels"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<related-tasks
|
||||
class="is-narrow"
|
||||
:task-i-d="task.id"
|
||||
:task-id="task.id"
|
||||
:list-id="task.listId"
|
||||
:initial-related-tasks="task.relatedTasks"
|
||||
/>
|
||||
@ -161,7 +161,7 @@
|
||||
name: 'edit-task',
|
||||
data() {
|
||||
return {
|
||||
listID: this.$route.params.id,
|
||||
listId: this.$route.params.id,
|
||||
listService: ListService,
|
||||
taskService: TaskService,
|
||||
|
||||
|
@ -96,7 +96,7 @@
|
||||
}
|
||||
},
|
||||
props: {
|
||||
taskID: {
|
||||
taskId: {
|
||||
required: true,
|
||||
type: Number,
|
||||
},
|
||||
@ -153,7 +153,7 @@
|
||||
this.uploadFiles(this.$refs.files.files)
|
||||
},
|
||||
uploadFiles(files) {
|
||||
const attachmentModel = new AttachmentModel({taskId: this.taskID})
|
||||
const attachmentModel = new AttachmentModel({taskId: this.taskId})
|
||||
this.attachmentService.create(attachmentModel, files)
|
||||
.then(r => {
|
||||
if(r.success !== null) {
|
||||
|
@ -72,7 +72,7 @@
|
||||
export default {
|
||||
name: 'comments',
|
||||
props: {
|
||||
taskID: {
|
||||
taskId: {
|
||||
type: Number,
|
||||
required: true,
|
||||
}
|
||||
@ -94,22 +94,22 @@
|
||||
},
|
||||
created() {
|
||||
this.taskCommentService = new TaskCommentService()
|
||||
this.newComment = new TaskCommentModel({taskId: this.taskID})
|
||||
this.commentEdit = new TaskCommentModel({taskId: this.taskID})
|
||||
this.commentToDelete = new TaskCommentModel({taskId: this.taskID})
|
||||
this.newComment = new TaskCommentModel({taskId: this.taskId})
|
||||
this.commentEdit = new TaskCommentModel({taskId: this.taskId})
|
||||
this.commentToDelete = new TaskCommentModel({taskId: this.taskId})
|
||||
this.comments = []
|
||||
},
|
||||
mounted() {
|
||||
this.loadComments()
|
||||
},
|
||||
watch: {
|
||||
taskID() {
|
||||
taskId() {
|
||||
this.loadComments()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadComments() {
|
||||
this.taskCommentService.getAll({taskId: this.taskID})
|
||||
this.taskCommentService.getAll({taskId: this.taskId})
|
||||
.then(r => {
|
||||
this.$set(this, 'comments', r)
|
||||
})
|
||||
@ -143,7 +143,7 @@
|
||||
if (this.commentEdit.comment === '') {
|
||||
return
|
||||
}
|
||||
this.commentEdit.taskId = this.taskID
|
||||
this.commentEdit.taskId = this.taskId
|
||||
this.taskCommentService.update(this.commentEdit)
|
||||
.then(r => {
|
||||
for (const c in this.comments) {
|
||||
|
@ -49,11 +49,11 @@
|
||||
multiselect,
|
||||
},
|
||||
props: {
|
||||
taskID: {
|
||||
taskId: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
listID: {
|
||||
listId: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
@ -84,7 +84,7 @@
|
||||
},
|
||||
methods: {
|
||||
addAssignee(user) {
|
||||
const taskAssignee = new TaskAssigneeModel({userId: user.id, taskId: this.taskID})
|
||||
const taskAssignee = new TaskAssigneeModel({userId: user.id, taskId: this.taskId})
|
||||
this.taskAssigneeService.create(taskAssignee)
|
||||
.then(() => {
|
||||
this.success({message: 'The user was successfully assigned.'}, this)
|
||||
@ -94,7 +94,7 @@
|
||||
})
|
||||
},
|
||||
removeAssignee(user) {
|
||||
const taskAssignee = new TaskAssigneeModel({userId: user.id, taskId: this.taskID})
|
||||
const taskAssignee = new TaskAssigneeModel({userId: user.id, taskId: this.taskId})
|
||||
this.taskAssigneeService.delete(taskAssignee)
|
||||
.then(() => {
|
||||
// Remove the assignee from the list
|
||||
@ -115,7 +115,7 @@
|
||||
return
|
||||
}
|
||||
|
||||
this.listUserService.getAll({listId: this.listID}, {s: query})
|
||||
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) => {
|
||||
|
@ -50,7 +50,7 @@
|
||||
default: () => [],
|
||||
type: Array,
|
||||
},
|
||||
taskID: {
|
||||
taskId: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
@ -108,7 +108,7 @@
|
||||
this.$set(this, 'foundLabels', [])
|
||||
},
|
||||
addLabel(label) {
|
||||
let labelTask = new LabelTaskModel({taskID: this.taskID, labelId: label.id})
|
||||
let labelTask = new LabelTaskModel({taskId: this.taskId, labelId: label.id})
|
||||
this.labelTaskService.create(labelTask)
|
||||
.then(() => {
|
||||
this.success({message: 'The label was successfully added.'}, this)
|
||||
@ -119,7 +119,7 @@
|
||||
})
|
||||
},
|
||||
removeLabel(label) {
|
||||
let labelTask = new LabelTaskModel({taskID: this.taskID, labelId: label.id})
|
||||
let labelTask = new LabelTaskModel({taskId: this.taskId, labelId: label.id})
|
||||
this.labelTaskService.delete(labelTask)
|
||||
.then(() => {
|
||||
// Remove the label from the list
|
||||
|
@ -105,7 +105,7 @@
|
||||
multiselect,
|
||||
},
|
||||
props: {
|
||||
taskID: {
|
||||
taskId: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
@ -156,7 +156,7 @@
|
||||
},
|
||||
addTaskRelation() {
|
||||
let rel = new TaskRelationModel({
|
||||
taskId: this.taskID,
|
||||
taskId: this.taskId,
|
||||
otherTaskId: this.newTaskRelationTask.id,
|
||||
relationKind: this.newTaskRelationKind,
|
||||
})
|
||||
@ -177,7 +177,7 @@
|
||||
removeTaskRelation() {
|
||||
let rel = new TaskRelationModel({
|
||||
relationKind: this.relationToDelete.relationKind,
|
||||
taskId: this.taskID,
|
||||
taskId: this.taskId,
|
||||
otherTaskId: this.relationToDelete.otherTaskId,
|
||||
})
|
||||
this.taskRelationService.delete(rel)
|
||||
|
Reference in New Issue
Block a user