mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-07-16 06:42:23 -05:00
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:
@@ -14,7 +14,7 @@
|
||||
>
|
||||
<FancyCheckbox
|
||||
v-model="task.done"
|
||||
:disabled="(isArchived || disabled) && !canMarkAsDone"
|
||||
:disabled="isArchived || disabled || !canMarkAsDone"
|
||||
@update:modelValue="markAsDone"
|
||||
@click.stop
|
||||
/>
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user