1
0

Don't show a success message if it is obvious the action has been successful

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

View File

@ -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 => {

View File

@ -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 => {

View File

@ -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})
})

View File

@ -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)

View File

@ -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)

View File

@ -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 => {

View File

@ -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)