From 7c30b00668bbfe270120fdfc9f853daf66a80a1d Mon Sep 17 00:00:00 2001 From: kolaente Date: Tue, 19 Mar 2024 13:55:05 +0100 Subject: [PATCH] fix(views): correctly pass project id when loading more tasks in kanban views --- frontend/src/components/project/views/ProjectKanban.vue | 4 ++-- frontend/src/stores/kanban.ts | 9 +++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/project/views/ProjectKanban.vue b/frontend/src/components/project/views/ProjectKanban.vue index d36a63a49..01513f8c1 100644 --- a/frontend/src/components/project/views/ProjectKanban.vue +++ b/frontend/src/components/project/views/ProjectKanban.vue @@ -370,7 +370,7 @@ const params = ref({ const getTaskDraggableTaskComponentData = computed(() => (bucket: IBucket) => { return { ref: (el: HTMLElement) => setTaskContainerRef(bucket.id, el), - onScroll: (event: Event) => handleTaskContainerScroll(bucket.id, bucket.projectId, event.target as HTMLElement), + onScroll: (event: Event) => handleTaskContainerScroll(bucket.id, event.target as HTMLElement), type: 'transition-group', name: !drag.value ? 'move-card' : null, class: [ @@ -420,7 +420,7 @@ function setTaskContainerRef(id: IBucket['id'], el: HTMLElement) { taskContainerRefs.value[id] = el } -function handleTaskContainerScroll(id: IBucket['id'], projectId: IProject['id'], el: HTMLElement) { +function handleTaskContainerScroll(id: IBucket['id'], el: HTMLElement) { if (!el) { return } diff --git a/frontend/src/stores/kanban.ts b/frontend/src/stores/kanban.ts index 9cf8c94d5..05d51e4a1 100644 --- a/frontend/src/stores/kanban.ts +++ b/frontend/src/stores/kanban.ts @@ -175,10 +175,7 @@ export const useKanbanStore = defineStore('kanban', () => { buckets.value[bucketIndex] = newBucket } - function addTasksToBucket({tasks, bucketId}: { - tasks: ITask[]; - bucketId: IBucket['id']; - }) { + function addTasksToBucket(tasks: ITask[], bucketId: IBucket['id']) { const bucketIndex = findIndexById(buckets.value, bucketId) const oldBucket = buckets.value[bucketIndex] const newBucket = { @@ -267,7 +264,7 @@ export const useKanbanStore = defineStore('kanban', () => { const params: TaskFilterParams = JSON.parse(JSON.stringify(ps)) - params.sort_by = ['kanban_position'] + params.sort_by = ['position'] params.order_by = ['asc'] params.filter = `${params.filter === '' ? '' : params.filter + ' && '}bucket_id = ${bucketId}` params.filter_timezone = authStore.settings.timezone @@ -276,7 +273,7 @@ export const useKanbanStore = defineStore('kanban', () => { const taskService = new TaskCollectionService() try { const tasks = await taskService.getAll({projectId, viewId}, params, page) - addTasksToBucket({tasks, bucketId: bucketId}) + addTasksToBucket(tasks, bucketId) setTasksLoadedForBucketPage({bucketId, page}) if (taskService.totalPages <= page) { setAllTasksLoadedForBucket(bucketId)