diff --git a/frontend/src/components/project/partials/Filters.vue b/frontend/src/components/project/partials/Filters.vue index 797f39975..4ef688575 100644 --- a/frontend/src/components/project/partials/Filters.vue +++ b/frontend/src/components/project/partials/Filters.vue @@ -55,10 +55,6 @@ - - + + diff --git a/frontend/src/components/project/views/ProjectList.vue b/frontend/src/components/project/views/ProjectList.vue index ae889955d..114549081 100644 --- a/frontend/src/components/project/views/ProjectList.vue +++ b/frontend/src/components/project/views/ProjectList.vue @@ -7,12 +7,15 @@ > @@ -49,13 +52,13 @@ v-if="tasks && tasks.length > 0" v-model="tasks" :group="{name: 'tasks', put: false}" - :disabled="!canDragTasks" + :disabled="!canDragTasks || !isPositionSorting" item-key="id" tag="ul" :component-data="{ class: { tasks: true, - 'dragging-disabled': !canDragTasks || isAlphabeticalSorting + 'dragging-disabled': !canDragTasks || !isPositionSorting }, type: 'transition-group' }" @@ -71,14 +74,13 @@ @@ -109,7 +111,7 @@ import SingleTaskInProject from '@/components/tasks/partials/SingleTaskInProject import FilterPopup from '@/components/project/partials/FilterPopup.vue' import Nothing from '@/components/misc/Nothing.vue' import Pagination from '@/components/misc/Pagination.vue' -import {ALPHABETICAL_SORT} from '@/components/project/partials/Filters.vue' +import SortPopup from '@/components/project/partials/SortPopup.vue' import {useTaskList} from '@/composables/useTaskList' import {useTaskDragToProject} from '@/composables/useTaskDragToProject' @@ -172,9 +174,7 @@ watch( }, ) -const isAlphabeticalSorting = computed(() => { - return params.value.sort_by.find(sortBy => sortBy === ALPHABETICAL_SORT) !== undefined -}) +const isPositionSorting = computed(() => 'position' in sortByParam.value) const firstNewPosition = computed(() => { if (tasks.value.length === 0) { @@ -215,7 +215,7 @@ function focusNewTaskInput() { } function updateTaskList(task: ITask) { - if (isAlphabeticalSorting.value) { + if (!isPositionSorting.value) { // reload tasks with current filter and sorting loadTasks() } else { @@ -287,15 +287,6 @@ async function saveTaskPosition(e: { originalEvent?: MouseEvent, to: HTMLElement } } -function prepareFiltersAndLoadTasks() { - if (isAlphabeticalSorting.value) { - sortByParam.value = {} - sortByParam.value[ALPHABETICAL_SORT] = 'asc' - } - - loadTasks() -} - const taskRefs = ref<(InstanceType | null)[]>([]) const focusedIndex = ref(-1) @@ -365,6 +356,12 @@ onBeforeUnmount(() => {