feat: allow marking a task done from a filter

Resolves https://kolaente.dev/vikunja/frontend/issues/2113
This commit is contained in:
kolaente 2022-07-12 11:59:39 +02:00
parent 2a20c95ba5
commit 579cff647d
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
2 changed files with 9 additions and 5 deletions

View file

@ -1,6 +1,6 @@
<template> <template>
<div :class="{'is-loading': taskService.loading}" class="task loader-container"> <div :class="{'is-loading': taskService.loading}" class="task loader-container">
<fancycheckbox :disabled="isArchived || disabled" @change="markAsDone" v-model="task.done"/> <fancycheckbox :disabled="(isArchived || disabled) && !canMarkAsDone" @change="markAsDone" v-model="task.done"/>
<span <span
v-if="showListColor && listColor !== ''" v-if="showListColor && listColor !== ''"
:style="{backgroundColor: listColor }" :style="{backgroundColor: listColor }"
@ -149,6 +149,10 @@ export default defineComponent({
type: Boolean, type: Boolean,
default: true, default: true,
}, },
canMarkAsDone: {
type: Boolean,
default: true,
},
}, },
emits: ['task-updated'], emits: ['task-updated'],
watch: { watch: {

View file

@ -54,7 +54,7 @@
> >
<card :padding="false" :has-content="false" class="has-overflow"> <card :padding="false" :has-content="false" class="has-overflow">
<template <template
v-if="!list.isArchived && canWrite && list.id > 0" v-if="!list.isArchived && canWrite"
> >
<add-task <add-task
@taskAdded="updateTaskList" @taskAdded="updateTaskList"
@ -137,9 +137,9 @@ import { ref, toRef, defineComponent } from 'vue'
import BaseButton from '@/components/base/BaseButton.vue' import BaseButton from '@/components/base/BaseButton.vue'
import ButtonLink from '@/components/misc/ButtonLink.vue' import ButtonLink from '@/components/misc/ButtonLink.vue'
import ListWrapper from './ListWrapper.vue' import ListWrapper from './ListWrapper.vue'
import EditTask from '@/components/tasks/edit-task' import EditTask from '@/components/tasks/edit-task.vue'
import AddTask from '@/components/tasks/add-task' import AddTask from '@/components/tasks/add-task.vue'
import SingleTaskInList from '@/components/tasks/partials/singleTaskInList' import SingleTaskInList from '@/components/tasks/partials/singleTaskInList.vue'
import { useTaskList } from '@/composables/taskList' import { useTaskList } from '@/composables/taskList'
import Rights from '../../models/constants/rights.json' import Rights from '../../models/constants/rights.json'
import FilterPopup from '@/components/list/partials/filter-popup.vue' import FilterPopup from '@/components/list/partials/filter-popup.vue'