fix(overview): disable checkbox for read-only tasks on overview page

The Overview's ShowTasks component was not passing the canMarkAsDone prop
to SingleTaskInProject, which defaults to true. This caused read-only tasks
to show an interactive checkbox even though the user doesn't have write
permission.

Use the project's maxPermission from the project store to determine if the
user can mark the task as done. Also fix the disabled condition to use OR
logic so the checkbox is disabled when ANY condition applies: archived,
disabled, or when the user lacks write permission.

Fixes #2399
This commit is contained in:
kolaente 2026-04-02 16:12:21 +02:00 committed by kolaente
parent 4f232957c4
commit 063155a46b
2 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,7 @@
>
<FancyCheckbox
v-model="task.done"
:disabled="(isArchived || disabled) && !canMarkAsDone"
:disabled="isArchived || disabled || !canMarkAsDone"
@update:modelValue="markAsDone"
@click.stop
/>

View File

@ -87,6 +87,7 @@
:key="task.id"
:show-project="true"
:the-task="task"
:can-mark-as-done="(projectStore.projects[task.projectId]?.maxPermission ?? 0) > PERMISSIONS.READ"
@taskUpdated="updateTasks"
/>
</div>
@ -123,6 +124,7 @@ import {useProjectStore} from '@/stores/projects'
import {useLabelStore} from '@/stores/labels'
import type {TaskFilterParams} from '@/services/taskCollection'
import TaskCollectionService from '@/services/taskCollection'
import {PERMISSIONS} from '@/constants/permissions'
const props = withDefaults(defineProps<{
dateFrom?: Date | string,