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