From 25579f5da2a491cd118c0099858d6ad778b43f2d Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 1 Jun 2020 00:09:21 +0200 Subject: [PATCH] Don't show a success message if it is obvious the action has been successful --- src/components/lists/views/Kanban.vue | 11 ----------- src/components/lists/views/List.vue | 1 - src/components/tasks/TaskDetailView.vue | 2 +- src/components/tasks/edit-task.vue | 1 - src/components/tasks/reusable/attachments.vue | 1 - src/components/tasks/reusable/comments.vue | 5 +---- src/components/tasks/reusable/editAssignees.vue | 4 ---- src/components/tasks/reusable/editLabels.vue | 2 -- src/components/tasks/reusable/relatedTasks.vue | 4 +--- 9 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/components/lists/views/Kanban.vue b/src/components/lists/views/Kanban.vue index 2aabc2aac..1e643f5bc 100644 --- a/src/components/lists/views/Kanban.vue +++ b/src/components/lists/views/Kanban.vue @@ -319,11 +319,6 @@ task.bucketId = bucketId this.$store.dispatch('tasks/update', task) - .then(() => { - // Update the block with the new task details - // this.$store.commit('kanban/setTaskInBucketByIndex', {bucketIndex, taskIndex, task: t}) - this.success({message: 'The task was moved successfully!'}, this) - }) .catch(e => { this.error(e, this) }) @@ -374,7 +369,6 @@ .then(r => { this.newTaskText = '' this.$store.commit('kanban/addTaskToBucket', r) - this.success({message: 'The task was created successfully!'}, this) }) .catch(e => { this.error(e, this) @@ -391,7 +385,6 @@ .then(() => { this.newBucketTitle = '' this.showNewBucketInput = false - this.success({message: 'The bucket was created successfully!'}, this) }) .catch(e => { this.error(e, this) @@ -412,9 +405,6 @@ }) this.$store.dispatch('kanban/deleteBucket', bucket) - .then(r => { - this.success(r, this) - }) .catch(e => { this.error(e, this) }) @@ -440,7 +430,6 @@ this.$store.dispatch('kanban/updateBucket', bucket) .then(r => { - this.success({message: 'The bucket title was updated successfully!'}, this) realBucket.title = r.title }) .catch(e => { diff --git a/src/components/lists/views/List.vue b/src/components/lists/views/List.vue index 4a49dcc74..15bf95fb9 100644 --- a/src/components/lists/views/List.vue +++ b/src/components/lists/views/List.vue @@ -161,7 +161,6 @@ this.tasks.push(r) this.sortTasks() this.newTaskText = '' - this.success({message: 'The task was successfully created.'}, this) }) .catch(e => { this.error(e, this) diff --git a/src/components/tasks/TaskDetailView.vue b/src/components/tasks/TaskDetailView.vue index 47616bf70..f84afb85d 100644 --- a/src/components/tasks/TaskDetailView.vue +++ b/src/components/tasks/TaskDetailView.vue @@ -477,9 +477,9 @@ title: 'Undo', callback: undoCallback, }] + this.success({message: 'The task was saved successfully.'}, this, actions) } this.dueDate = this.task.dueDate - this.success({message: 'The task was saved successfully.'}, this, actions) this.setActiveFields() }) .catch(e => { diff --git a/src/components/tasks/edit-task.vue b/src/components/tasks/edit-task.vue index 0394ae9ee..01981dd4d 100644 --- a/src/components/tasks/edit-task.vue +++ b/src/components/tasks/edit-task.vue @@ -220,7 +220,6 @@ this.taskService.update(this.taskEditTask) .then(r => { this.$set(this, 'taskEditTask', r) - this.success({message: 'The task was successfully updated.'}, this) this.initTaskFields() }) .catch(e => { diff --git a/src/components/tasks/reusable/attachments.vue b/src/components/tasks/reusable/attachments.vue index 48ed4f12f..c93a805b8 100644 --- a/src/components/tasks/reusable/attachments.vue +++ b/src/components/tasks/reusable/attachments.vue @@ -158,7 +158,6 @@ .then(r => { if(r.success !== null) { r.success.forEach(a => { - this.success({message: 'Successfully uploaded ' + a.file.name}, this) this.attachments.push(a) this.$store.dispatch('tasks/addTaskAttachment', {taskId: this.taskId, attachment: a}) }) diff --git a/src/components/tasks/reusable/comments.vue b/src/components/tasks/reusable/comments.vue index 44783384e..4dbf98f15 100644 --- a/src/components/tasks/reusable/comments.vue +++ b/src/components/tasks/reusable/comments.vue @@ -127,7 +127,6 @@ this.taskCommentService.create(this.newComment) .then(r => { this.comments.push(r) - this.success({message: 'The comment was sucessfully added.'}, this) this.newComment.comment = '' }) .catch(e => { @@ -154,7 +153,6 @@ this.$set(this.comments, c, r) } } - this.success({message: 'The comment was successfully updated.'}, this) }) .catch(e => { this.error(e, this) @@ -165,13 +163,12 @@ }, deleteComment() { this.taskCommentService.delete(this.commentToDelete) - .then(r => { + .then(() => { for (const a in this.comments) { if (this.comments[a].id === this.commentToDelete.id) { this.comments.splice(a, 1) } } - this.success(r, this) }) .catch(e => { this.error(e, this) diff --git a/src/components/tasks/reusable/editAssignees.vue b/src/components/tasks/reusable/editAssignees.vue index 8db4b1837..af24995ef 100644 --- a/src/components/tasks/reusable/editAssignees.vue +++ b/src/components/tasks/reusable/editAssignees.vue @@ -84,9 +84,6 @@ methods: { addAssignee(user) { this.$store.dispatch('tasks/addAssignee', {user: user, taskId: this.taskId}) - .then(() => { - this.success({message: 'The user was successfully assigned.'}, this) - }) .catch(e => { this.error(e, this) }) @@ -100,7 +97,6 @@ this.assignees.splice(a, 1) } } - this.success({message: 'The user was successfully unassigned.'}, this) }) .catch(e => { this.error(e, this) diff --git a/src/components/tasks/reusable/editLabels.vue b/src/components/tasks/reusable/editLabels.vue index 3ac6d7b2c..bab3c2f0c 100644 --- a/src/components/tasks/reusable/editLabels.vue +++ b/src/components/tasks/reusable/editLabels.vue @@ -109,7 +109,6 @@ addLabel(label) { this.$store.dispatch('tasks/addLabel', {label: label, taskId: this.taskId}) .then(() => { - this.success({message: 'The label was successfully added.'}, this) this.$emit('input', this.labels) }) .catch(e => { @@ -125,7 +124,6 @@ this.labels.splice(l, 1) } } - this.success({message: 'The label was successfully removed.'}, this) this.$emit('input', this.labels) }) .catch(e => { diff --git a/src/components/tasks/reusable/relatedTasks.vue b/src/components/tasks/reusable/relatedTasks.vue index 1662e9e59..af401e0af 100644 --- a/src/components/tasks/reusable/relatedTasks.vue +++ b/src/components/tasks/reusable/relatedTasks.vue @@ -172,7 +172,6 @@ this.relatedTasks[this.newTaskRelationKind].push(this.newTaskRelationTask) this.newTaskRelationKind = 'unset' this.newTaskRelationTask = new TaskModel() - this.success({message: 'The task relation was created successfully'}, this) }) .catch(e => { this.error(e, this) @@ -185,7 +184,7 @@ otherTaskId: this.relationToDelete.otherTaskId, }) this.taskRelationService.delete(rel) - .then(r => { + .then(() => { Object.keys(this.relatedTasks).forEach(relationKind => { for (const t in this.relatedTasks[relationKind]) { if (this.relatedTasks[relationKind][t].id === this.relationToDelete.otherTaskId && relationKind === this.relationToDelete.relationKind) { @@ -193,7 +192,6 @@ } } }) - this.success(r, this) }) .catch(e => { this.error(e, this)