diff --git a/frontend/src/components/project/partials/filters.vue b/frontend/src/components/project/partials/filters.vue index 81fb317d3..d298c454c 100644 --- a/frontend/src/components/project/partials/filters.vue +++ b/frontend/src/components/project/partials/filters.vue @@ -11,194 +11,12 @@ > {{ $t('filters.attributes.includeNulls') }} - - {{ $t('filters.attributes.requireAll') }} - - - {{ $t('filters.attributes.showDoneTasks') }} - - - {{ $t('filters.attributes.sortAlphabetically') }} - - -
- -
- -
-
-
- -
- - - {{ $t('filters.attributes.enablePriority') }} - -
-
-
- -
- - - {{ $t('filters.attributes.enablePercentDone') }} - -
-
-
- -
- - - -
-
-
- -
- - - -
-
-
- -
- - - -
-
-
- -
- - - -
-
- -
- -
- -
-
- -
- -
- -
-
- - @@ -207,47 +25,22 @@ export const ALPHABETICAL_SORT = 'title' diff --git a/frontend/src/services/taskCollection.ts b/frontend/src/services/taskCollection.ts index 71862481d..14abe9a3c 100644 --- a/frontend/src/services/taskCollection.ts +++ b/frontend/src/services/taskCollection.ts @@ -3,15 +3,12 @@ import TaskModel from '@/models/task' import type {ITask} from '@/modelTypes/ITask' -// FIXME: unite with other filter params types -export interface GetAllTasksParams { +export interface TaskFilterParams { sort_by: ('start_date' | 'done' | 'id')[], - order_by: ('asc' | 'asc' | 'desc')[], - filter_by: 'start_date'[], - filter_comparator: ('greater_equals' | 'less_equals')[], - filter_value: [string, string] // [dateFrom, dateTo], - filter_concat: 'and', + order_by: ('asc' | 'desc')[], + filter: string, filter_include_nulls: boolean, + s: string, } export default class TaskCollectionService extends AbstractService { diff --git a/frontend/src/views/project/helpers/useGanttFilters.ts b/frontend/src/views/project/helpers/useGanttFilters.ts index d0fd63b91..812014ac9 100644 --- a/frontend/src/views/project/helpers/useGanttFilters.ts +++ b/frontend/src/views/project/helpers/useGanttFilters.ts @@ -8,7 +8,7 @@ import {useRouteFilters} from '@/composables/useRouteFilters' import {useGanttTaskList} from './useGanttTaskList' import type {IProject} from '@/modelTypes/IProject' -import type {GetAllTasksParams} from '@/services/taskCollection' +import type {TaskFilterParams} from '@/services/taskCollection' import type {DateISO} from '@/types/DateISO' import type {DateKebab} from '@/types/DateKebab' @@ -75,7 +75,7 @@ function ganttFiltersToRoute(filters: GanttFilters): RouteLocationRaw { } } -function ganttFiltersToApiParams(filters: GanttFilters): GetAllTasksParams { +function ganttFiltersToApiParams(filters: GanttFilters): TaskFilterParams { return { sort_by: ['start_date', 'done', 'id'], order_by: ['asc', 'asc', 'desc'], diff --git a/frontend/src/views/project/helpers/useGanttTaskList.ts b/frontend/src/views/project/helpers/useGanttTaskList.ts index a7a13e706..7f094252c 100644 --- a/frontend/src/views/project/helpers/useGanttTaskList.ts +++ b/frontend/src/views/project/helpers/useGanttTaskList.ts @@ -4,7 +4,7 @@ import {klona} from 'klona/lite' import type {Filters} from '@/composables/useRouteFilters' import type {ITask, ITaskPartialWithId} from '@/modelTypes/ITask' -import TaskCollectionService, {type GetAllTasksParams} from '@/services/taskCollection' +import TaskCollectionService, {type TaskFilterParams} from '@/services/taskCollection' import TaskService from '@/services/task' import TaskModel from '@/models/task' @@ -13,7 +13,7 @@ import {error, success} from '@/message' // FIXME: unify with general `useTaskList` export function useGanttTaskList( filters: Ref, - filterToApiParams: (filters: F) => GetAllTasksParams, + filterToApiParams: (filters: F) => TaskFilterParams, options: { loadAll?: boolean, } = { @@ -26,7 +26,7 @@ export function useGanttTaskList( const tasks = ref>(new Map()) - async function fetchTasks(params: GetAllTasksParams, page = 1): Promise { + async function fetchTasks(params: TaskFilterParams, page = 1): Promise { const tasks = await taskCollectionService.getAll({projectId: filters.value.projectId}, params, page) as ITask[] if (options.loadAll && page < taskCollectionService.totalPages) { const nextTasks = await fetchTasks(params, page + 1) @@ -40,7 +40,7 @@ export function useGanttTaskList( * Normally there is no need to trigger this manually */ async function loadTasks() { - const params: GetAllTasksParams = filterToApiParams(filters.value) + const params: TaskFilterParams = filterToApiParams(filters.value) const loadedTasks = await fetchTasks(params) tasks.value = new Map()