fix(task): do not allow moving a task to the project the task already belongs to
(cherry picked from commit 7efc4d1bc890b4a12ee30274eaeb6062f4e49510)
This commit is contained in:
parent
53605c24f0
commit
715269a5d0
@ -73,7 +73,7 @@
|
|||||||
>
|
>
|
||||||
<template v-if="canWrite">
|
<template v-if="canWrite">
|
||||||
<span class="icon handle">
|
<span class="icon handle">
|
||||||
<Icon icon="grip-lines"/>
|
<Icon icon="grip-lines" />
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</SingleTaskInProject>
|
</SingleTaskInProject>
|
||||||
|
@ -36,9 +36,11 @@ import Multiselect from '@/components/input/Multiselect.vue'
|
|||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
modelValue?: IProject
|
modelValue?: IProject
|
||||||
savedFiltersOnly?: boolean
|
savedFiltersOnly?: boolean
|
||||||
|
filter?: (project: IProject) => boolean,
|
||||||
}>(), {
|
}>(), {
|
||||||
modelValue: () => new ProjectModel(),
|
modelValue: () => new ProjectModel(),
|
||||||
savedFiltersOnly: false,
|
savedFiltersOnly: false,
|
||||||
|
filter: () => true,
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@ -65,11 +67,13 @@ function findProjects(query: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (props.savedFiltersOnly) {
|
if (props.savedFiltersOnly) {
|
||||||
foundProjects.value = projectStore.searchSavedFilter(query)
|
const found = projectStore.searchSavedFilter(query)
|
||||||
|
foundProjects.value = found.filter(props.filter)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
foundProjects.value = projectStore.searchProject(query)
|
const found = projectStore.searchProject(query)
|
||||||
|
foundProjects.value = found.filter(props.filter)
|
||||||
}
|
}
|
||||||
|
|
||||||
function select(p: IProject | null) {
|
function select(p: IProject | null) {
|
||||||
|
@ -381,6 +381,7 @@
|
|||||||
<div class="control is-expanded">
|
<div class="control is-expanded">
|
||||||
<ProjectSearch
|
<ProjectSearch
|
||||||
:ref="e => setFieldRef('moveProject', e)"
|
:ref="e => setFieldRef('moveProject', e)"
|
||||||
|
:filter="project => project.id !== task.projectId"
|
||||||
@update:modelValue="changeProject"
|
@update:modelValue="changeProject"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user