mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
47abe9db5e
* style: gantt chart polishing * chore: sidebar y-axis drag and drop * chore: remove y-axis drag and drop from the main content * refactor: drop end function * refactor: resizing logic * chore: x-axis block move * chore: x-axis block move flag * chore: update scroll end logic * style: modules gantt chart * style: block background tint * refactor: context dispatcher types * refactor: draggable component * chore: filters added to gantt chart * refactor: folder structure * style: cycle blocks * chore: move to block arrow * chore: move to block on the right side arrow * chore: added proper comments for functions * refactor: blocks render logic * fix: x-axis drag and drop * chore: minor ui fixes * chore: remove link tag from blocks --------- Co-authored-by: Aaryan Khandelwal <aaryan610@Aaryans-MacBook-Pro.local>
39 lines
1.0 KiB
TypeScript
39 lines
1.0 KiB
TypeScript
import useSWR from "swr";
|
|
|
|
// services
|
|
import issuesService from "services/issues.service";
|
|
// hooks
|
|
import useIssuesView from "hooks/use-issues-view";
|
|
// fetch-keys
|
|
import { VIEW_ISSUES } from "constants/fetch-keys";
|
|
|
|
const useGanttChartViewIssues = (
|
|
workspaceSlug: string | undefined,
|
|
projectId: string | undefined,
|
|
viewId: string | undefined
|
|
) => {
|
|
const { params } = useIssuesView();
|
|
const { order_by, group_by, ...viewGanttParams } = params;
|
|
|
|
// all issues under the view
|
|
const { data: ganttIssues, mutate: mutateGanttIssues } = useSWR(
|
|
workspaceSlug && projectId && viewId
|
|
? VIEW_ISSUES(viewId.toString(), { ...viewGanttParams, order_by, start_target_date: true })
|
|
: null,
|
|
workspaceSlug && projectId && viewId
|
|
? () =>
|
|
issuesService.getIssuesWithParams(workspaceSlug.toString(), projectId.toString(), {
|
|
...viewGanttParams,
|
|
start_target_date: true,
|
|
})
|
|
: null
|
|
);
|
|
|
|
return {
|
|
ganttIssues,
|
|
mutateGanttIssues,
|
|
};
|
|
};
|
|
|
|
export default useGanttChartViewIssues;
|