Don't allow dragging a list when the user does not have the rights

This commit is contained in:
kolaente 2021-07-29 13:05:33 +02:00
parent 8a08a41a3c
commit 3c2d89a0f6
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
4 changed files with 10 additions and 0 deletions

View file

@ -85,6 +85,8 @@
@end="e => saveListPosition(e, nk)" @end="e => saveListPosition(e, nk)"
v-bind="dragOptions" v-bind="dragOptions"
handle=".handle" handle=".handle"
:disabled="n.id < 0"
:class="{'dragging-disabled': n.id < 0}"
> >
<transition-group <transition-group
type="transition" type="transition"

View file

@ -157,3 +157,7 @@ button.table {
.is-touch .handle { .is-touch .handle {
opacity: 1 !important; opacity: 1 !important;
} }
.dragging-disabled .handle {
opacity: 0 !important;
}

View file

@ -24,6 +24,7 @@
group="buckets" group="buckets"
v-bind="dragOptions" v-bind="dragOptions"
:disabled="!canWrite" :disabled="!canWrite"
:class="{'dragging-disabled': !canWrite}"
> >
<transition-group type="transition" :name="!dragBucket ? 'move-bucket': null" tag="div" class="kanban-bucket-container"> <transition-group type="transition" :name="!dragBucket ? 'move-bucket': null" tag="div" class="kanban-bucket-container">
<div <div
@ -128,6 +129,7 @@
:group="{name: 'tasks', put: shouldAcceptDrop(bucket) && !dragBucket}" :group="{name: 'tasks', put: shouldAcceptDrop(bucket) && !dragBucket}"
v-bind="dragOptions" v-bind="dragOptions"
:disabled="!canWrite" :disabled="!canWrite"
:class="{'dragging-disabled': !canWrite}"
:data-bucket-index="k" :data-bucket-index="k"
class="dropper" class="dropper"
> >

View file

@ -87,6 +87,8 @@
@end="saveTaskPosition" @end="saveTaskPosition"
v-bind="dragOptions" v-bind="dragOptions"
handle=".handle" handle=".handle"
:disabled="!canWrite"
:class="{'dragging-disabled': !canWrite}"
> >
<single-task-in-list <single-task-in-list
:show-list-color="false" :show-list-color="false"