Compare commits
1 Commits
main
...
fix/gantt-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b233449c5 |
@@ -104,7 +104,7 @@ const GanttChart = createAsyncComponent(() => import('@/components/tasks/GanttCh
|
||||
const baseStore = useBaseStore()
|
||||
const canWrite = computed(() => baseStore.currentProject?.maxRight > RIGHTS.READ)
|
||||
|
||||
const {route} = toRefs(props)
|
||||
const {route, viewId} = toRefs(props)
|
||||
const {
|
||||
filters,
|
||||
hasDefaultFilters,
|
||||
@@ -113,7 +113,7 @@ const {
|
||||
isLoading,
|
||||
addTask,
|
||||
updateTask,
|
||||
} = useGanttFilters(route, props.viewId)
|
||||
} = useGanttFilters(route, viewId)
|
||||
|
||||
const DEFAULT_DATE_RANGE_DAYS = 7
|
||||
|
||||
@@ -218,4 +218,4 @@ const flatPickerConfig = computed<Options>(() => ({
|
||||
font-size: .9rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -94,7 +94,7 @@ export type UseGanttFiltersReturn =
|
||||
ReturnType<typeof useRouteFilters<GanttFilters>> &
|
||||
ReturnType<typeof useGanttTaskList<GanttFilters>>
|
||||
|
||||
export function useGanttFilters(route: Ref<RouteLocationNormalized>, viewId: IProjectView['id']): UseGanttFiltersReturn {
|
||||
export function useGanttFilters(route: Ref<RouteLocationNormalized>, viewId: Ref<IProjectView['id']>): UseGanttFiltersReturn {
|
||||
const {
|
||||
filters,
|
||||
hasDefaultFilters,
|
||||
@@ -128,4 +128,4 @@ export function useGanttFilters(route: Ref<RouteLocationNormalized>, viewId: IPr
|
||||
addTask,
|
||||
updateTask,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ import type {IProjectView} from '@/modelTypes/IProjectView'
|
||||
export function useGanttTaskList<F extends Filters>(
|
||||
filters: Ref<F>,
|
||||
filterToApiParams: (filters: F) => TaskFilterParams,
|
||||
viewId: IProjectView['id'],
|
||||
viewId: Ref<IProjectView['id']>,
|
||||
loadAll: boolean = true,
|
||||
) {
|
||||
const taskCollectionService = shallowReactive(new TaskCollectionService())
|
||||
@@ -33,7 +33,7 @@ export function useGanttTaskList<F extends Filters>(
|
||||
params.filter_timezone = authStore.settings.timezone
|
||||
}
|
||||
|
||||
const tasks = await taskCollectionService.getAll({projectId: filters.value.projectId, viewId}, params, page) as ITask[]
|
||||
const tasks = await taskCollectionService.getAll({projectId: filters.value.projectId, viewId: viewId.value}, params, page) as ITask[]
|
||||
if (loadAll && page < taskCollectionService.totalPages) {
|
||||
const nextTasks = await fetchTasks(params, page + 1)
|
||||
return tasks.concat(nextTasks)
|
||||
@@ -105,4 +105,4 @@ export function useGanttTaskList<F extends Filters>(
|
||||
addTask,
|
||||
updateTask,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user