Add making tasks favorite from the task detail view
This commit is contained in:
parent
ccf466c31c
commit
617a6a0c21
2 changed files with 21 additions and 1 deletions
|
@ -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": {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue