From 617a6a0c21e86a9fae340d31b61c3f7f8eb7270a Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 28 Jul 2021 22:13:24 +0200 Subject: [PATCH] Add making tasks favorite from the task detail view --- src/i18n/lang/en.json | 4 +++- src/views/tasks/TaskDetailView.vue | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 05eb9515..ebd6fd5c 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -512,7 +512,9 @@ "relatedTasks": "Add task relations", "moveList": "Move task", "color": "Set task color", - "delete": "Delete task" + "delete": "Delete task", + "favorite": "Make this task as a favorite", + "unfavorite": "Don't make this task a favorite" } }, "attributes": { diff --git a/src/views/tasks/TaskDetailView.vue b/src/views/tasks/TaskDetailView.vue index 4007985a..cc7d30a8 100644 --- a/src/views/tasks/TaskDetailView.vue +++ b/src/views/tasks/TaskDetailView.vue @@ -361,6 +361,13 @@ > {{ $t('task.detail.actions.color') }} + + {{ task.isFavorite ? $t('task.detail.actions.favorite') : $t('task.detail.actions.unfavorite') }} + { + this.task = t + this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist') + }) + .catch(e => { + this.error(e) + }) + }, }, }