diff --git a/src/components/home/contentAuth.vue b/src/components/home/contentAuth.vue index 576d77bf..55ab90f8 100644 --- a/src/components/home/contentAuth.vue +++ b/src/components/home/contentAuth.vue @@ -130,7 +130,7 @@ export default { loadLabels() { this.$store.dispatch('labels/loadAllLabels') .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/components/home/navigation.vue b/src/components/home/navigation.vue index a2933d75..05b8cd2a 100644 --- a/src/components/home/navigation.vue +++ b/src/components/home/navigation.vue @@ -161,7 +161,7 @@ export default { return } this.$store.dispatch('lists/toggleListFavorite', list) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, resize() { // Hide the menu by default on mobile diff --git a/src/components/list/partials/filters.vue b/src/components/list/partials/filters.vue index a28f339e..448222d0 100644 --- a/src/components/list/partials/filters.vue +++ b/src/components/list/partials/filters.vue @@ -490,7 +490,7 @@ export default { .then(r => { this.$set(this, kind, r) }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) } }, setDoneFilter() { @@ -545,7 +545,7 @@ export default { })) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, add(kind, filterName) { diff --git a/src/components/migrator/migration.vue b/src/components/migrator/migration.vue index 4b65fc9f..c6de5f2b 100644 --- a/src/components/migrator/migration.vue +++ b/src/components/migrator/migration.vue @@ -105,7 +105,7 @@ export default { this.migrate() }) .catch(e => { - this.error(e, this) + this.error(e) }) } }, @@ -116,7 +116,7 @@ export default { this.authUrl = r.url }) .catch(e => { - this.error(e, this) + this.error(e) }) }, migrate() { @@ -129,7 +129,7 @@ export default { this.$store.dispatch('namespaces/loadNamespaces') }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.isMigrating = false diff --git a/src/components/misc/subscription.vue b/src/components/misc/subscription.vue index d59a491c..82ad2f62 100644 --- a/src/components/misc/subscription.vue +++ b/src/components/misc/subscription.vue @@ -96,10 +96,10 @@ export default { this.subscriptionService.create(subscription) .then(() => { this.$emit('change', subscription) - this.success({message: `You are now subscribed to this ${this.entity}`}, this) + this.success({message: `You are now subscribed to this ${this.entity}`}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, unsubscribe() { @@ -110,10 +110,10 @@ export default { this.subscriptionService.delete(subscription) .then(() => { this.$emit('change', null) - this.success({message: `You are now unsubscribed to this ${this.entity}`}, this) + this.success({message: `You are now unsubscribed to this ${this.entity}`}) }) .catch(e => { - this.error(e, this) + this.error(e) }) } }, diff --git a/src/components/namespace/namespace-search.vue b/src/components/namespace/namespace-search.vue index d2fbc556..8444d616 100644 --- a/src/components/namespace/namespace-search.vue +++ b/src/components/namespace/namespace-search.vue @@ -43,7 +43,7 @@ export default { this.$set(this, 'namespaces', response) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, clearAll() { diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index e0f72422..00a76250 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -98,7 +98,7 @@ export default { this.$set(this, 'allNotifications', r) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, to(n, index) { @@ -136,7 +136,7 @@ export default { .then(r => { this.$set(this.allNotifications, index, r) }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) } }, }, diff --git a/src/components/quick-actions/quick-actions.vue b/src/components/quick-actions/quick-actions.vue index 02279db4..c55b887f 100644 --- a/src/components/quick-actions/quick-actions.vue +++ b/src/components/quick-actions/quick-actions.vue @@ -361,12 +361,12 @@ export default { }) this.taskService.create(newTask) .then(r => { - this.success({message: 'The task was successfully created.'}, this) + this.success({message: 'The task was successfully created.'}) this.$router.push({name: 'task.detail', params: {id: r.id}}) this.closeQuickActions() }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, newList() { @@ -380,12 +380,12 @@ export default { }) this.listService.create(newList) .then(r => { - this.success({message: 'The list was successfully created.'}, this) + this.success({message: 'The list was successfully created.'}) this.$router.push({name: 'list.index', params: {listId: r.id}}) this.closeQuickActions() }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, newNamespace() { @@ -393,11 +393,11 @@ export default { this.namespaceService.create(newNamespace) .then(r => { this.$store.commit('namespaces/addNamespace', r) - this.success({message: 'The namespace was successfully created.'}, this) + this.success({message: 'The namespace was successfully created.'}) this.closeQuickActions() }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, newTeam() { @@ -408,11 +408,11 @@ export default { name: 'teams.edit', params: {id: r.id}, }) - this.success({message: 'The team was successfully created.'}, this) + this.success({message: 'The team was successfully created.'}) this.closeQuickActions() }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, select(parentIndex, index) { diff --git a/src/components/sharing/linkSharing.vue b/src/components/sharing/linkSharing.vue index 8094649a..80201577 100644 --- a/src/components/sharing/linkSharing.vue +++ b/src/components/sharing/linkSharing.vue @@ -231,7 +231,7 @@ export default { this.linkShares = r }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, add() { @@ -248,14 +248,11 @@ export default { this.name = '' this.password = '' this.showNewForm = false - this.success( - {message: 'The link share was successfully created'}, - this - ) + this.success({message: 'The link share was successfully created'}) this.load() }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, remove() { @@ -266,14 +263,11 @@ export default { this.linkShareService .delete(linkshare) .then(() => { - this.success( - {message: 'The link share was successfully deleted'}, - this - ) + this.success({message: 'The link share was successfully deleted'}) this.load() }) .catch((e) => { - this.error(e, this) + this.error(e) }) .finally(() => { this.showDeleteModal = false diff --git a/src/components/sharing/userTeam.vue b/src/components/sharing/userTeam.vue index cad550ce..3a72d7e3 100644 --- a/src/components/sharing/userTeam.vue +++ b/src/components/sharing/userTeam.vue @@ -249,7 +249,7 @@ export default { ) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, deleteSharable() { @@ -271,10 +271,10 @@ export default { this.sharables.splice(i, 1) } } - this.success({message: `The ${this.shareType} was successfully deleted from the ${this.typeString}.`}, this) + this.success({message: `The ${this.shareType} was successfully deleted from the ${this.typeString}.`}) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, add(admin) { @@ -295,19 +295,16 @@ export default { this.stuffService .create(this.stuffModel) .then(() => { - this.success( - { - message: - 'The ' + - this.shareType + - ' was successfully added.', - }, - this - ) + this.success({ + message: + 'The ' + + this.shareType + + ' was successfully added.', + }) this.load() }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, toggleType(sharable) { @@ -340,18 +337,15 @@ export default { this.$set(this.sharables[i], 'right', r.right) } } - this.success( - { - message: - 'The ' + - this.shareType + - ' right was successfully updated.', - }, - this - ) + this.success({ + message: + 'The ' + + this.shareType + + ' right was successfully updated.', + }) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, find(query) { @@ -366,7 +360,7 @@ export default { this.$set(this, 'found', response) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, clearAll() { diff --git a/src/components/tasks/edit-task.vue b/src/components/tasks/edit-task.vue index 0e4f6393..208818bf 100644 --- a/src/components/tasks/edit-task.vue +++ b/src/components/tasks/edit-task.vue @@ -150,10 +150,10 @@ export default { .then((r) => { this.$set(this, 'taskEditTask', r) this.initTaskFields() - this.success({message: 'The task has been saved successfully.'}, this) + this.success({message: 'The task has been saved successfully.'}) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/components/tasks/gantt-component.vue b/src/components/tasks/gantt-component.vue index d27bd37f..8147ca3d 100644 --- a/src/components/tasks/gantt-component.vue +++ b/src/components/tasks/gantt-component.vue @@ -362,7 +362,7 @@ export default { }) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, addGantAttributes(t) { @@ -447,7 +447,7 @@ export default { } }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, editTask(task) { @@ -484,7 +484,7 @@ export default { this.hideCrateNewTask() }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/components/tasks/mixins/attachmentUpload.js b/src/components/tasks/mixins/attachmentUpload.js index 7d033081..1e08e0fc 100644 --- a/src/components/tasks/mixins/attachmentUpload.js +++ b/src/components/tasks/mixins/attachmentUpload.js @@ -31,7 +31,7 @@ export default { } }) .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/components/tasks/mixins/taskList.js b/src/components/tasks/mixins/taskList.js index 6748ad06..a6e91c2d 100644 --- a/src/components/tasks/mixins/taskList.js +++ b/src/components/tasks/mixins/taskList.js @@ -115,7 +115,7 @@ export default { this.loadedList = cloneDeep(currentList) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, loadTasksForPage(e) { diff --git a/src/components/tasks/partials/attachments.vue b/src/components/tasks/partials/attachments.vue index 3e20b36b..59c2be26 100644 --- a/src/components/tasks/partials/attachments.vue +++ b/src/components/tasks/partials/attachments.vue @@ -226,10 +226,10 @@ export default { 'attachments/removeById', this.attachmentToDelete.id ) - this.success(r, this) + this.success(r) }) .catch((e) => { - this.error(e, this) + this.error(e) }) .finally(() => { this.showDeleteModal = false diff --git a/src/components/tasks/partials/comments.vue b/src/components/tasks/partials/comments.vue index 848731b5..838bbe1b 100644 --- a/src/components/tasks/partials/comments.vue +++ b/src/components/tasks/partials/comments.vue @@ -236,7 +236,7 @@ export default { this.makeActions() }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, addComment() { @@ -258,13 +258,10 @@ export default { .then((r) => { this.comments.push(r) this.newComment.comment = '' - this.success( - {message: 'The comment was added successfully.'}, - this - ) + this.success({message: 'The comment was added successfully.'}) }) .catch((e) => { - this.error(e, this) + this.error(e) }) .finally(() => { this.creating = false @@ -300,7 +297,7 @@ export default { }, 2000) }) .catch((e) => { - this.error(e, this) + this.error(e) }) .finally(() => { this.isCommentEdit = false @@ -318,7 +315,7 @@ export default { } }) .catch((e) => { - this.error(e, this) + this.error(e) }) .finally(() => { this.showDeleteModal = false diff --git a/src/components/tasks/partials/defer-task.vue b/src/components/tasks/partials/defer-task.vue index 0f6c0c47..93a1f183 100644 --- a/src/components/tasks/partials/defer-task.vue +++ b/src/components/tasks/partials/defer-task.vue @@ -131,7 +131,7 @@ export default { this.$emit('input', r) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/components/tasks/partials/description.vue b/src/components/tasks/partials/description.vue index 738973f7..fed48252 100644 --- a/src/components/tasks/partials/description.vue +++ b/src/components/tasks/partials/description.vue @@ -86,7 +86,7 @@ export default { }, 2000) }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.saving = false diff --git a/src/components/tasks/partials/editAssignees.vue b/src/components/tasks/partials/editAssignees.vue index bb3f04cd..ec98ac13 100644 --- a/src/components/tasks/partials/editAssignees.vue +++ b/src/components/tasks/partials/editAssignees.vue @@ -84,10 +84,10 @@ export default { this.$store.dispatch('tasks/addAssignee', {user: user, taskId: this.taskId}) .then(() => { this.$emit('input', this.assignees) - this.success({message: 'The user has been assigned successfully.'}, this) + this.success({message: 'The user has been assigned successfully.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, removeAssignee(user) { @@ -99,10 +99,10 @@ export default { this.assignees.splice(a, 1) } } - this.success({message: 'The user has been unassinged successfully.'}, this) + this.success({message: 'The user has been unassinged successfully.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, findUser(query) { @@ -119,7 +119,7 @@ export default { })) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, clearAllFoundUsers() { diff --git a/src/components/tasks/partials/editLabels.vue b/src/components/tasks/partials/editLabels.vue index 5c03449c..92f3ba28 100644 --- a/src/components/tasks/partials/editLabels.vue +++ b/src/components/tasks/partials/editLabels.vue @@ -104,11 +104,11 @@ export default { .then(() => { this.$emit('input', this.labels) if (showNotification) { - this.success({message: 'The label has been added successfully.'}, this) + this.success({message: 'The label has been added successfully.'}) } }) .catch(e => { - this.error(e, this) + this.error(e) }) }, removeLabel(label) { @@ -121,10 +121,10 @@ export default { } } this.$emit('input', this.labels) - this.success({message: 'The label has been removed successfully.'}, this) + this.success({message: 'The label has been removed successfully.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, createAndAddLabel(title) { @@ -133,10 +133,10 @@ export default { .then(r => { this.addLabel(r, false) this.labels.push(r) - this.success({message: 'The label has been created successfully.'}, this) + this.success({message: 'The label has been created successfully.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, diff --git a/src/components/tasks/partials/heading.vue b/src/components/tasks/partials/heading.vue index 35dc55c9..e4b70ab4 100644 --- a/src/components/tasks/partials/heading.vue +++ b/src/components/tasks/partials/heading.vue @@ -90,7 +90,7 @@ export default { }, 2000) }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.saving = false diff --git a/src/components/tasks/partials/listSearch.vue b/src/components/tasks/partials/listSearch.vue index 9d1582f2..3c281ea1 100644 --- a/src/components/tasks/partials/listSearch.vue +++ b/src/components/tasks/partials/listSearch.vue @@ -51,7 +51,7 @@ export default { this.$set(this, 'foundLists', response) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, clearAll() { diff --git a/src/components/tasks/partials/relatedTasks.vue b/src/components/tasks/partials/relatedTasks.vue index d2a0c544..40de796c 100644 --- a/src/components/tasks/partials/relatedTasks.vue +++ b/src/components/tasks/partials/relatedTasks.vue @@ -192,7 +192,7 @@ export default { this.$set(this, 'foundTasks', response) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, addTaskRelation() { @@ -215,7 +215,7 @@ export default { }, 2000) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, removeTaskRelation() { @@ -239,7 +239,7 @@ export default { }, 2000) }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.showDeleteModal = false @@ -253,7 +253,7 @@ export default { this.addTaskRelation() }) .catch(e => { - this.error(e, this) + this.error(e) }) }, relationKindTitle(kind, length) { diff --git a/src/components/tasks/partials/singleTaskInList.vue b/src/components/tasks/partials/singleTaskInList.vue index 7031e7c1..a1537077 100644 --- a/src/components/tasks/partials/singleTaskInList.vue +++ b/src/components/tasks/partials/singleTaskInList.vue @@ -175,20 +175,16 @@ export default { } this.task = t this.$emit('task-updated', t) - this.success( - {message: 'The task was successfully ' + (this.task.done ? '' : 'un-') + 'marked as done.'}, - this, - [{ - title: 'Undo', - callback: () => { - this.task.done = !this.task.done - this.markAsDone(!checked) - } - }], - ) + this.success({message: 'The task was successfully ' + (this.task.done ? '' : 'un-') + 'marked as done.'}, [{ + title: 'Undo', + callback: () => { + this.task.done = !this.task.done + this.markAsDone(!checked) + } + }]) }) .catch(e => { - this.error(e, this) + this.error(e) }) } @@ -207,7 +203,7 @@ export default { this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist') }) .catch(e => { - this.error(e, this) + this.error(e) }) }, hideDeferDueDatePopup(e) { diff --git a/src/components/user/avatar-settings.vue b/src/components/user/avatar-settings.vue index 319da320..47de56b8 100644 --- a/src/components/user/avatar-settings.vue +++ b/src/components/user/avatar-settings.vue @@ -93,16 +93,16 @@ export default { .then(r => { this.avatarProvider = r.avatarProvider }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, updateAvatarStatus() { const avatarStatus = new AvatarModel({avatarProvider: this.avatarProvider}) this.avatarService.update(avatarStatus) .then(() => { - this.success({message: 'Avatar status was updated successfully!'}, this) + this.success({message: 'Avatar status was updated successfully!'}) this.$store.commit('auth/reloadAvatar') }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, uploadAvatar() { this.loading = true @@ -112,10 +112,10 @@ export default { canvas.toBlob(blob => { this.avatarService.create(blob) .then(() => { - this.success({message: 'The avatar has been set successfully!'}, this) + this.success({message: 'The avatar has been set successfully!'}) this.$store.commit('auth/reloadAvatar') }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) .finally(() => { this.loading = false this.isCropAvatar = false diff --git a/src/main.js b/src/main.js index 07c0880c..012d5929 100644 --- a/src/main.js +++ b/src/main.js @@ -215,8 +215,12 @@ Vue.mixin({ }, formatDate: date => formatDate(date, 'PPPPpppp'), formatDateShort: date => formatDate(date, 'PPpp'), - error: (e, context, actions = []) => message.error(e, context, actions), - success: (s, context, actions = []) => message.success(s, context, actions), + error(e, actions = []) { + return message.error(e, this, actions) + }, + success(s, actions = []) { + return message.success(s, this, actions) + }, colorIsDark: colorIsDark, setTitle: setTitle, }, diff --git a/src/message/index.js b/src/message/index.js index 6f4569ad..7d3f06b2 100644 --- a/src/message/index.js +++ b/src/message/index.js @@ -1,13 +1,4 @@ export default { - setLoading(context) { - const timeout = setTimeout(function () { - context.loading = true - }, 100) - return () => { - clearTimeout(timeout) - context.loading = false - } - }, error(e, context, actions = []) { // Build the notification text from error response let err = e.message diff --git a/src/views/filters/CreateSavedFilter.vue b/src/views/filters/CreateSavedFilter.vue index abd52146..b028ac33 100644 --- a/src/views/filters/CreateSavedFilter.vue +++ b/src/views/filters/CreateSavedFilter.vue @@ -110,7 +110,7 @@ export default { this.$store.dispatch('namespaces/loadNamespaces') this.$router.push({name: 'list.index', params: {listId: r.getListId()}}) }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, }, } diff --git a/src/views/filters/settings/delete.vue b/src/views/filters/settings/delete.vue index 9102c3d6..6a8ccc96 100644 --- a/src/views/filters/settings/delete.vue +++ b/src/views/filters/settings/delete.vue @@ -34,10 +34,10 @@ export default { this.filterService.delete(filter) .then(() => { this.$store.dispatch('namespaces/loadNamespaces') - this.success({message: 'The filter was deleted successfully.'}, this) + this.success({message: 'The filter was deleted successfully.'}) this.$router.push({name: 'namespaces.index'}) }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, }, } diff --git a/src/views/filters/settings/edit.vue b/src/views/filters/settings/edit.vue index 9e7dbdc5..0a7d8945 100644 --- a/src/views/filters/settings/edit.vue +++ b/src/views/filters/settings/edit.vue @@ -110,19 +110,19 @@ export default { this.filter = r this.filters = objectToSnakeCase(this.filter.filters) }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, save() { this.filter.filters = this.filters this.filterService.update(this.filter) .then(r => { this.$store.dispatch('namespaces/loadNamespaces') - this.success({message: 'The filter was saved successfully.'}, this) + this.success({message: 'The filter was saved successfully.'}) this.filter = r this.filters = objectToSnakeCase(this.filter.filters) this.$router.back() }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, }, } diff --git a/src/views/labels/ListLabels.vue b/src/views/labels/ListLabels.vue index ddeeca4a..5bbe9f05 100644 --- a/src/views/labels/ListLabels.vue +++ b/src/views/labels/ListLabels.vue @@ -141,25 +141,25 @@ export default { loadLabels() { this.$store.dispatch('labels/loadAllLabels') .catch(e => { - this.error(e, this) + this.error(e) }) }, deleteLabel(label) { this.$store.dispatch('labels/deleteLabel', label) .then(() => { - this.success({message: 'The label was successfully deleted.'}, this) + this.success({message: 'The label was successfully deleted.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, editLabelSubmit() { this.$store.dispatch('labels/updateLabel', this.labelEditLabel) .then(() => { - this.success({message: 'The label was successfully updated.'}, this) + this.success({message: 'The label was successfully updated.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, editLabel(label) { diff --git a/src/views/labels/NewLabel.vue b/src/views/labels/NewLabel.vue index a0925d1b..88594831 100644 --- a/src/views/labels/NewLabel.vue +++ b/src/views/labels/NewLabel.vue @@ -77,10 +77,10 @@ export default { name: 'labels.index', params: {id: r.id}, }) - this.success({message: 'The label was successfully created.'}, this) + this.success({message: 'The label was successfully created.'}) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/list/NewList.vue b/src/views/list/NewList.vue index 2aa6bd03..89d917ce 100644 --- a/src/views/list/NewList.vue +++ b/src/views/list/NewList.vue @@ -69,17 +69,14 @@ export default { this.$store .dispatch('lists/createList', this.list) .then((r) => { - this.success( - { message: 'The list was successfully created.' }, - this - ) + this.success({message: 'The list was successfully created.'}) this.$router.push({ name: 'list.index', params: { listId: r.id }, }) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/list/ShowList.vue b/src/views/list/ShowList.vue index ccadc6de..1643de35 100644 --- a/src/views/list/ShowList.vue +++ b/src/views/list/ShowList.vue @@ -142,7 +142,7 @@ export default { this.$store.commit(CURRENT_LIST, r) }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.listLoaded = this.$route.params.listId diff --git a/src/views/list/settings/archive.vue b/src/views/list/settings/archive.vue index 87a63cd7..a8a19e86 100644 --- a/src/views/list/settings/archive.vue +++ b/src/views/list/settings/archive.vue @@ -38,10 +38,10 @@ export default { .then(r => { this.$store.commit('currentList', r) this.$store.commit('namespaces/setListInNamespaceById', r) - this.success({message: 'The list was successfully archived.'}, this) + this.success({message: 'The list was successfully archived.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.$router.back() diff --git a/src/views/list/settings/background.vue b/src/views/list/settings/background.vue index 689905de..51dc73ae 100644 --- a/src/views/list/settings/background.vue +++ b/src/views/list/settings/background.vue @@ -130,7 +130,7 @@ export default { }) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, 300) }, @@ -144,10 +144,10 @@ export default { .then(l => { this.$store.commit(CURRENT_LIST, l) this.$store.commit('namespaces/setListInNamespaceById', l) - this.success({message: 'The background has been set successfully!'}, this) + this.success({message: 'The background has been set successfully!'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, uploadBackground() { @@ -159,10 +159,10 @@ export default { .then(l => { this.$store.commit(CURRENT_LIST, l) this.$store.commit('namespaces/setListInNamespaceById', l) - this.success({message: 'The background has been set successfully!'}, this) + this.success({message: 'The background has been set successfully!'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, removeBackground() { @@ -170,11 +170,11 @@ export default { .then(l => { this.$store.commit(CURRENT_LIST, l) this.$store.commit('namespaces/setListInNamespaceById', l) - this.success({message: 'The background has been removed successfully!'}, this) + this.success({message: 'The background has been removed successfully!'}) this.$router.back() }) .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/list/settings/delete.vue b/src/views/list/settings/delete.vue index 94285346..b5857958 100644 --- a/src/views/list/settings/delete.vue +++ b/src/views/list/settings/delete.vue @@ -31,11 +31,11 @@ export default { this.listService.delete(list) .then(() => { this.$store.commit('namespaces/removeListFromNamespaceById', list) - this.success({message: 'The list was successfully deleted.'}, this) + this.success({message: 'The list was successfully deleted.'}) this.$router.push({name: 'home'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/list/settings/duplicate.vue b/src/views/list/settings/duplicate.vue index d15cb6bc..d03701de 100644 --- a/src/views/list/settings/duplicate.vue +++ b/src/views/list/settings/duplicate.vue @@ -46,11 +46,11 @@ export default { .then(r => { this.$store.commit('namespaces/addListToNamespace', r.list) this.$store.commit('lists/setList', r.list) - this.success({message: 'The list was successfully duplicated.'}, this) + this.success({message: 'The list was successfully duplicated.'}) this.$router.push({name: 'list.index', params: {listId: r.list.id}}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/list/settings/edit.vue b/src/views/list/settings/edit.vue index ffc29c85..226cc99a 100644 --- a/src/views/list/settings/edit.vue +++ b/src/views/list/settings/edit.vue @@ -109,17 +109,17 @@ export default { this.setTitle(`Edit "${this.list.title}"`) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, save() { this.$store.dispatch('lists/updateList', this.list) .then(() => { - this.success({message: 'The list was successfully updated.'}, this) + this.success({message: 'The list was successfully updated.'}) this.$router.back() }) .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/list/settings/share.vue b/src/views/list/settings/share.vue index e0c76362..1955745e 100644 --- a/src/views/list/settings/share.vue +++ b/src/views/list/settings/share.vue @@ -70,7 +70,7 @@ export default { this.setTitle(`Share "${this.list.title}"`) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/list/views/Kanban.vue b/src/views/list/views/Kanban.vue index 59515dec..7da19a73 100644 --- a/src/views/list/views/Kanban.vue +++ b/src/views/list/views/Kanban.vue @@ -387,14 +387,14 @@ export default { bucketId: b.id, }) .catch(e => { - this.error(e, this) + this.error(e) }) } }) }) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, onDrop(bucketId, dropResult) { @@ -449,7 +449,7 @@ export default { this.$store.dispatch('tasks/update', task) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.$set(this.taskUpdating, task.id, false) @@ -468,7 +468,7 @@ export default { } }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.$set(this.taskUpdating, task.id, false) @@ -516,7 +516,7 @@ export default { this.$store.commit('kanban/addTaskToBucket', r) }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { if (!this.$refs[`tasks-container${task.bucketId}`][0]) { @@ -541,7 +541,7 @@ export default { this.showNewBucketInput = false }) .catch(e => { - this.error(e, this) + this.error(e) }) }, deleteBucketModal(bucketId) { @@ -560,10 +560,10 @@ export default { this.$store.dispatch('kanban/deleteBucket', {bucket: bucket, params: this.params}) .then(() => { - this.success({message: 'The bucket has been deleted successfully.'}, this) + this.success({message: 'The bucket has been deleted successfully.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.showBucketDeleteModal = false @@ -590,20 +590,20 @@ export default { .then(r => { realBucket.title = r.title bucketTitleElement.blur() - this.success({message: 'The bucket title has been saved successfully.'}, this) + this.success({message: 'The bucket title has been saved successfully.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, updateBucket(bucket) { bucket.limit = parseInt(bucket.limit) this.$store.dispatch('kanban/updateBucket', bucket) .then(() => { - this.success({message: 'The bucket limit been saved successfully.'}, this) + this.success({message: 'The bucket limit been saved successfully.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, setBucketLimit(bucket) { @@ -622,10 +622,10 @@ export default { bucket.isDoneBucket = !bucket.isDoneBucket this.$store.dispatch('kanban/updateBucket', bucket) .then(() => { - this.success({message: 'The done bucket has been saved successfully.'}, this) + this.success({message: 'The done bucket has been saved successfully.'}) }) .catch(e => { - this.error(e, this) + this.error(e) bucket.isDoneBucket = !bucket.isDoneBucket }) }, diff --git a/src/views/list/views/List.vue b/src/views/list/views/List.vue index 46b5bd7e..7ee21552 100644 --- a/src/views/list/views/List.vue +++ b/src/views/list/views/List.vue @@ -323,7 +323,7 @@ export default { labelAddings[index - 1].resolve(result) }) .catch(e => { - this.error(e, this) + this.error(e) }) } else { // label not found, create it @@ -345,11 +345,11 @@ export default { labelAddings[index - 1].resolve(result) }) .catch(e => { - this.error(e, this) + this.error(e) }) }) .catch(e => { - this.error(e, this) + this.error(e) }) } }) @@ -365,13 +365,13 @@ export default { this.$store.commit(HAS_TASKS, true) }) .catch(e => { - this.error(e, this) + this.error(e) }) }) } }) .catch(e => { - this.error(e, this) + this.error(e) }) }, editTask(id) { diff --git a/src/views/namespaces/ListNamespaces.vue b/src/views/namespaces/ListNamespaces.vue index 7edf311c..dbd74c2b 100644 --- a/src/views/namespaces/ListNamespaces.vue +++ b/src/views/namespaces/ListNamespaces.vue @@ -131,7 +131,7 @@ export default { this.$set(this.backgrounds, l.id, b) }) .catch(e => { - this.error(e, this) + this.error(e) }) } }) @@ -144,7 +144,7 @@ export default { return } this.$store.dispatch('lists/toggleListFavorite', list) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, saveShowArchivedState() { localStorage.setItem('showArchived', JSON.stringify(this.showArchived)) diff --git a/src/views/namespaces/NewNamespace.vue b/src/views/namespaces/NewNamespace.vue index 4d041d74..05df04d3 100644 --- a/src/views/namespaces/NewNamespace.vue +++ b/src/views/namespaces/NewNamespace.vue @@ -80,14 +80,11 @@ export default { .create(this.namespace) .then((r) => { this.$store.commit('namespaces/addNamespace', r) - this.success( - { message: 'The namespace was successfully created.' }, - this - ) + this.success({message: 'The namespace was successfully created.'}) this.$router.back() }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/namespaces/settings/archive.vue b/src/views/namespaces/settings/archive.vue index 3e4e5f5e..c57aed03 100644 --- a/src/views/namespaces/settings/archive.vue +++ b/src/views/namespaces/settings/archive.vue @@ -38,10 +38,10 @@ export default { this.namespaceService.update(this.namespace) .then(r => { this.$store.commit('namespaces/setNamespaceById', r) - this.success({message: 'The namespace was successfully archived.'}, this) + this.success({message: 'The namespace was successfully archived.'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.$router.back() diff --git a/src/views/namespaces/settings/delete.vue b/src/views/namespaces/settings/delete.vue index dd58a749..6f9b5b58 100644 --- a/src/views/namespaces/settings/delete.vue +++ b/src/views/namespaces/settings/delete.vue @@ -31,11 +31,11 @@ export default { this.$store.dispatch('namespaces/deleteNamespace', namespace) .then(() => { - this.success({message: 'The namespace was successfully deleted.'}, this) + this.success({message: 'The namespace was successfully deleted.'}) this.$router.push({name: 'home'}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/namespaces/settings/edit.vue b/src/views/namespaces/settings/edit.vue index 489bd60d..c5e8dc84 100644 --- a/src/views/namespaces/settings/edit.vue +++ b/src/views/namespaces/settings/edit.vue @@ -118,7 +118,7 @@ export default { this.setTitle(`Edit "${r.title}"`) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, save() { @@ -126,11 +126,11 @@ export default { .then(r => { // Update the namespace in the parent this.$store.commit('namespaces/setNamespaceById', r) - this.success({message: 'The namespace was successfully updated.'}, this) + this.success({message: 'The namespace was successfully updated.'}) this.$router.back() }) .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/namespaces/settings/share.vue b/src/views/namespaces/settings/share.vue index 7836aa31..d7bfd5ba 100644 --- a/src/views/namespaces/settings/share.vue +++ b/src/views/namespaces/settings/share.vue @@ -69,7 +69,7 @@ export default { this.setTitle(`Share "${this.namespace.title}"`) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/tasks/ShowTasks.vue b/src/views/tasks/ShowTasks.vue index bf0b976f..dd005fa0 100644 --- a/src/views/tasks/ShowTasks.vue +++ b/src/views/tasks/ShowTasks.vue @@ -203,7 +203,7 @@ export default { this.$store.commit(HAS_TASKS, r.length > 0) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, updateTasks(updatedTask) { diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index 65c7cd2c..8f4c9e75 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -559,7 +559,7 @@ export default { this.setTitle(this.task.title) }) .catch(e => { - this.error(e, this) + this.error(e) }) .finally(() => { this.$nextTick(() => this.visible = true) @@ -620,10 +620,10 @@ export default { callback: undoCallback, }] } - this.success({message: 'The task was saved successfully.'}, this, actions) + this.success({message: 'The task was saved successfully.'}, actions) }) .catch(e => { - this.error(e, this) + this.error(e) }) }) }, @@ -648,11 +648,11 @@ export default { deleteTask() { this.$store.dispatch('tasks/delete', this.task) .then(() => { - this.success({message: 'The task has been deleted successfully.'}, this) + this.success({message: 'The task has been deleted successfully.'}) this.$router.push({name: 'list.index', params: {listId: this.task.listId}}) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, toggleTaskDone() { diff --git a/src/views/teams/EditTeam.vue b/src/views/teams/EditTeam.vue index 72fdad59..8c6c313e 100644 --- a/src/views/teams/EditTeam.vue +++ b/src/views/teams/EditTeam.vue @@ -249,7 +249,7 @@ export default { this.setTitle(`Edit Team ${this.team.name}`) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, save() { @@ -263,44 +263,35 @@ export default { .update(this.team) .then((response) => { this.team = response - this.success( - {message: 'The team was successfully updated.'}, - this - ) + this.success({message: 'The team was successfully updated.'}) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, deleteTeam() { this.teamService .delete(this.team) .then(() => { - this.success( - {message: 'The team was successfully deleted.'}, - this - ) + this.success({message: 'The team was successfully deleted.'}) router.push({name: 'teams.index'}) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, deleteUser() { this.teamMemberService .delete(this.member) .then(() => { - this.success( - { - message: - 'The user was successfully deleted from the team.', - }, - this - ) + this.success({ + message: + 'The user was successfully deleted from the team.', + }) this.loadTeam() }) .catch((e) => { - this.error(e, this) + this.error(e) }) .finally(() => { this.showUserDeleteModal = false @@ -315,13 +306,10 @@ export default { .create(newMember) .then(() => { this.loadTeam() - this.success( - {message: 'The team member was successfully added.'}, - this - ) + this.success({message: 'The team member was successfully added.'}) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, toggleUserType(member) { @@ -336,18 +324,15 @@ export default { break } } - this.success( - { - message: - 'The team member was successfully made ' + - (member.admin ? 'admin' : 'member') + - '.', - }, - this - ) + this.success({ + message: + 'The team member was successfully made ' + + (member.admin ? 'admin' : 'member') + + '.', + }) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, findUser(query) { @@ -362,7 +347,7 @@ export default { this.$set(this, 'foundUsers', response) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, clearAll() { diff --git a/src/views/teams/ListTeams.vue b/src/views/teams/ListTeams.vue index 832987ec..e3f962ef 100644 --- a/src/views/teams/ListTeams.vue +++ b/src/views/teams/ListTeams.vue @@ -50,7 +50,7 @@ export default { this.$set(this, 'teams', response) }) .catch(e => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/teams/NewTeam.vue b/src/views/teams/NewTeam.vue index 22708923..594c9798 100644 --- a/src/views/teams/NewTeam.vue +++ b/src/views/teams/NewTeam.vue @@ -67,13 +67,10 @@ export default { name: 'teams.edit', params: { id: response.id }, }) - this.success( - { message: 'The team was successfully created.' }, - this - ) + this.success({message: 'The team was successfully created.'}) }) .catch((e) => { - this.error(e, this) + this.error(e) }) }, }, diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index d097185f..3fcd8215 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -82,7 +82,9 @@ -
+
{ localStorage.removeItem('emailConfirmToken') @@ -158,6 +159,15 @@ export default { openidConnect: state => state.config.auth.openidConnect, }), methods: { + setLoading() { + const timeout = setTimeout(() => { + this.loading = true + }, 100) + return () => { + clearTimeout(timeout) + this.loading = false + } + }, submit() { this.$store.commit(ERROR_MESSAGE, '') // Some browsers prevent Vue bindings from working with autofilled values. @@ -173,7 +183,8 @@ export default { } this.$store.dispatch('auth/login', credentials) - .catch(() => {}) + .catch(() => { + }) }, redirectToProvider(provider) { const state = Math.random().toString(36).substring(2, 24) diff --git a/src/views/user/Settings.vue b/src/views/user/Settings.vue index 95651570..adbf3832 100644 --- a/src/views/user/Settings.vue +++ b/src/views/user/Settings.vue @@ -338,22 +338,22 @@ export default { methods: { updatePassword() { if (this.passwordConfirm !== this.passwordUpdate.newPassword) { - this.error({message: 'The new password and its confirmation don\'t match.'}, this) + this.error({message: 'The new password and its confirmation don\'t match.'}) return } this.passwordUpdateService.update(this.passwordUpdate) .then(() => { - this.success({message: 'The password was successfully updated.'}, this) + this.success({message: 'The password was successfully updated.'}) }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, updateEmail() { this.emailUpdateService.update(this.emailUpdate) .then(() => { - this.success({message: 'Your email address was successfully updated. We\'ve sent you a link to confirm it.'}, this) + this.success({message: 'Your email address was successfully updated. We\'ve sent you a link to confirm it.'}) }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, totpStatus() { if (!this.totpEnabled) { @@ -371,7 +371,7 @@ export default { return } - this.error(e, this) + this.error(e) }) }, totpSetQrCode() { @@ -388,24 +388,24 @@ export default { this.$set(this, 'totp', r) this.totpSetQrCode() }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, totpConfirm() { this.totpService.enable({passcode: this.totpConfirmPasscode}) .then(() => { this.$set(this.totp, 'enabled', true) - this.success({message: 'You\'ve successfully confirmed your totp setup and can use it from now on!'}, this) + this.success({message: 'You\'ve successfully confirmed your totp setup and can use it from now on!'}) }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, totpDisable() { this.totpService.disable({password: this.totpDisablePassword}) .then(() => { this.totpEnrolled = false this.$set(this, 'totp', new TotpModel()) - this.success({message: 'Two factor authentication was sucessfully disabled.'}, this) + this.success({message: 'Two factor authentication was sucessfully disabled.'}) }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, updateSettings() { localStorage.setItem(playSoundWhenDoneKey, this.playSoundWhenDone) @@ -413,9 +413,9 @@ export default { this.userSettingsService.update(this.settings) .then(() => { this.$store.commit('auth/setUserSettings', this.settings) - this.success({message: 'The name was successfully changed.'}, this) + this.success({message: 'The name was successfully changed.'}) }) - .catch(e => this.error(e, this)) + .catch(e => this.error(e)) }, copy(text) { copy(text)