fix: task sorting by position in list view
Resolves https://kolaente.dev/vikunja/frontend/issues/2119
This commit is contained in:
parent
4a8b7a726a
commit
99a5afc817
2 changed files with 6 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
import { ref, shallowReactive, watch, computed } from 'vue'
|
||||
import {ref, shallowReactive, watch, computed} from 'vue'
|
||||
import {useRoute} from 'vue-router'
|
||||
|
||||
import TaskCollectionService from '@/services/taskCollection'
|
||||
|
@ -20,14 +20,13 @@ const SORT_BY_DEFAULT = {
|
|||
/**
|
||||
* This mixin provides a base set of methods and properties to get tasks on a list.
|
||||
*/
|
||||
export function useTaskList(listId) {
|
||||
export function useTaskList(listId, sortByDefault = SORT_BY_DEFAULT) {
|
||||
const params = ref({...getDefaultParams()})
|
||||
|
||||
const search = ref('')
|
||||
const page = ref(1)
|
||||
|
||||
const sortBy = ref({ ...SORT_BY_DEFAULT })
|
||||
|
||||
const sortBy = ref({ ...sortByDefault })
|
||||
|
||||
// This makes sure an id sort order is always sorted last.
|
||||
// When tasks would be sorted first by id and then by whatever else was specified, the id sort takes
|
||||
|
|
|
@ -214,7 +214,9 @@ export default defineComponent({
|
|||
// isTaskEdit.value = false
|
||||
// }
|
||||
|
||||
const taskList = useTaskList(toRef(props, 'listId'))
|
||||
const taskList = useTaskList(toRef(props, 'listId'), {
|
||||
position: 'asc',
|
||||
})
|
||||
|
||||
return {
|
||||
taskEditTask,
|
||||
|
|
Loading…
Reference in a new issue