1
0

Add making tasks favorite from the task detail view

This commit is contained in:
kolaente
2021-07-28 22:13:24 +02:00
parent ccf466c31c
commit 617a6a0c21
2 changed files with 21 additions and 1 deletions

View File

@ -361,6 +361,13 @@
>
{{ $t('task.detail.actions.color') }}
</x-button>
<x-button
@click="toggleFavorite"
type="secondary"
:icon="task.isFavorite ? ['far', 'star'] : 'star'"
>
{{ task.isFavorite ? $t('task.detail.actions.favorite') : $t('task.detail.actions.unfavorite') }}
</x-button>
<x-button
@click="showDeleteModal = true"
icon="trash-alt"
@ -682,6 +689,17 @@ export default {
this.saveTask()
this.$store.commit('kanban/removeTaskInBucket', this.task)
},
toggleFavorite() {
this.task.isFavorite = !this.task.isFavorite
this.taskService.update(this.task)
.then(t => {
this.task = t
this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist')
})
.catch(e => {
this.error(e)
})
},
},
}
</script>