Don't show a success message if it is obvious the action has been successful
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
kolaente 2020-06-01 00:09:21 +02:00
parent 5a7c07ca4d
commit 25579f5da2
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
9 changed files with 3 additions and 28 deletions

View File

@ -319,11 +319,6 @@
task.bucketId = bucketId task.bucketId = bucketId
this.$store.dispatch('tasks/update', task) 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 => { .catch(e => {
this.error(e, this) this.error(e, this)
}) })
@ -374,7 +369,6 @@
.then(r => { .then(r => {
this.newTaskText = '' this.newTaskText = ''
this.$store.commit('kanban/addTaskToBucket', r) this.$store.commit('kanban/addTaskToBucket', r)
this.success({message: 'The task was created successfully!'}, this)
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)
@ -391,7 +385,6 @@
.then(() => { .then(() => {
this.newBucketTitle = '' this.newBucketTitle = ''
this.showNewBucketInput = false this.showNewBucketInput = false
this.success({message: 'The bucket was created successfully!'}, this)
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)
@ -412,9 +405,6 @@
}) })
this.$store.dispatch('kanban/deleteBucket', bucket) this.$store.dispatch('kanban/deleteBucket', bucket)
.then(r => {
this.success(r, this)
})
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)
}) })
@ -440,7 +430,6 @@
this.$store.dispatch('kanban/updateBucket', bucket) this.$store.dispatch('kanban/updateBucket', bucket)
.then(r => { .then(r => {
this.success({message: 'The bucket title was updated successfully!'}, this)
realBucket.title = r.title realBucket.title = r.title
}) })
.catch(e => { .catch(e => {

View File

@ -161,7 +161,6 @@
this.tasks.push(r) this.tasks.push(r)
this.sortTasks() this.sortTasks()
this.newTaskText = '' this.newTaskText = ''
this.success({message: 'The task was successfully created.'}, this)
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)

View File

@ -477,9 +477,9 @@
title: 'Undo', title: 'Undo',
callback: undoCallback, callback: undoCallback,
}] }]
this.success({message: 'The task was saved successfully.'}, this, actions)
} }
this.dueDate = this.task.dueDate this.dueDate = this.task.dueDate
this.success({message: 'The task was saved successfully.'}, this, actions)
this.setActiveFields() this.setActiveFields()
}) })
.catch(e => { .catch(e => {

View File

@ -220,7 +220,6 @@
this.taskService.update(this.taskEditTask) this.taskService.update(this.taskEditTask)
.then(r => { .then(r => {
this.$set(this, 'taskEditTask', r) this.$set(this, 'taskEditTask', r)
this.success({message: 'The task was successfully updated.'}, this)
this.initTaskFields() this.initTaskFields()
}) })
.catch(e => { .catch(e => {

View File

@ -158,7 +158,6 @@
.then(r => { .then(r => {
if(r.success !== null) { if(r.success !== null) {
r.success.forEach(a => { r.success.forEach(a => {
this.success({message: 'Successfully uploaded ' + a.file.name}, this)
this.attachments.push(a) this.attachments.push(a)
this.$store.dispatch('tasks/addTaskAttachment', {taskId: this.taskId, attachment: a}) this.$store.dispatch('tasks/addTaskAttachment', {taskId: this.taskId, attachment: a})
}) })

View File

@ -127,7 +127,6 @@
this.taskCommentService.create(this.newComment) this.taskCommentService.create(this.newComment)
.then(r => { .then(r => {
this.comments.push(r) this.comments.push(r)
this.success({message: 'The comment was sucessfully added.'}, this)
this.newComment.comment = '' this.newComment.comment = ''
}) })
.catch(e => { .catch(e => {
@ -154,7 +153,6 @@
this.$set(this.comments, c, r) this.$set(this.comments, c, r)
} }
} }
this.success({message: 'The comment was successfully updated.'}, this)
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)
@ -165,13 +163,12 @@
}, },
deleteComment() { deleteComment() {
this.taskCommentService.delete(this.commentToDelete) this.taskCommentService.delete(this.commentToDelete)
.then(r => { .then(() => {
for (const a in this.comments) { for (const a in this.comments) {
if (this.comments[a].id === this.commentToDelete.id) { if (this.comments[a].id === this.commentToDelete.id) {
this.comments.splice(a, 1) this.comments.splice(a, 1)
} }
} }
this.success(r, this)
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)

View File

@ -84,9 +84,6 @@
methods: { methods: {
addAssignee(user) { addAssignee(user) {
this.$store.dispatch('tasks/addAssignee', {user: user, taskId: this.taskId}) this.$store.dispatch('tasks/addAssignee', {user: user, taskId: this.taskId})
.then(() => {
this.success({message: 'The user was successfully assigned.'}, this)
})
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)
}) })
@ -100,7 +97,6 @@
this.assignees.splice(a, 1) this.assignees.splice(a, 1)
} }
} }
this.success({message: 'The user was successfully unassigned.'}, this)
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)

View File

@ -109,7 +109,6 @@
addLabel(label) { addLabel(label) {
this.$store.dispatch('tasks/addLabel', {label: label, taskId: this.taskId}) this.$store.dispatch('tasks/addLabel', {label: label, taskId: this.taskId})
.then(() => { .then(() => {
this.success({message: 'The label was successfully added.'}, this)
this.$emit('input', this.labels) this.$emit('input', this.labels)
}) })
.catch(e => { .catch(e => {
@ -125,7 +124,6 @@
this.labels.splice(l, 1) this.labels.splice(l, 1)
} }
} }
this.success({message: 'The label was successfully removed.'}, this)
this.$emit('input', this.labels) this.$emit('input', this.labels)
}) })
.catch(e => { .catch(e => {

View File

@ -172,7 +172,6 @@
this.relatedTasks[this.newTaskRelationKind].push(this.newTaskRelationTask) this.relatedTasks[this.newTaskRelationKind].push(this.newTaskRelationTask)
this.newTaskRelationKind = 'unset' this.newTaskRelationKind = 'unset'
this.newTaskRelationTask = new TaskModel() this.newTaskRelationTask = new TaskModel()
this.success({message: 'The task relation was created successfully'}, this)
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)
@ -185,7 +184,7 @@
otherTaskId: this.relationToDelete.otherTaskId, otherTaskId: this.relationToDelete.otherTaskId,
}) })
this.taskRelationService.delete(rel) this.taskRelationService.delete(rel)
.then(r => { .then(() => {
Object.keys(this.relatedTasks).forEach(relationKind => { Object.keys(this.relatedTasks).forEach(relationKind => {
for (const t in this.relatedTasks[relationKind]) { for (const t in this.relatedTasks[relationKind]) {
if (this.relatedTasks[relationKind][t].id === this.relationToDelete.otherTaskId && relationKind === this.relationToDelete.relationKind) { if (this.relatedTasks[relationKind][t].id === this.relationToDelete.otherTaskId && relationKind === this.relationToDelete.relationKind) {
@ -193,7 +192,6 @@
} }
} }
}) })
this.success(r, this)
}) })
.catch(e => { .catch(e => {
this.error(e, this) this.error(e, this)