* chore: added issue relations in issue listing * chore: added pagination for issue detail endpoint * chore: bulk date update endpoint * chore: appended the target date * chore: issue relation new types defined * fix: order by and issue filters * fix: passed order by in pagination * chore: changed the key for issue dates * Revamp Timeline Layout * fix block dragging * minor ui fixes * improve auto scroll UX * remove unused import * fix timeline layout heights * modify base timeline store * Segregate issue relation types --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
26 lines
965 B
TypeScript
26 lines
965 B
TypeScript
import { useContext } from "react";
|
|
// mobx store
|
|
// types
|
|
import { StoreContext } from "@/lib/store-context";
|
|
import { IBaseTimelineStore } from "ee/store/timeline/base-timeline.store";
|
|
import { ETimeLineTypeType, useTimeLineType } from "../components/gantt-chart/contexts";
|
|
|
|
export const useTimeLineChart = (timeLineType: ETimeLineTypeType): IBaseTimelineStore => {
|
|
const context = useContext(StoreContext);
|
|
if (context === undefined) throw new Error("useTimeLineChart must be used within StoreProvider");
|
|
|
|
switch (timeLineType) {
|
|
case ETimeLineTypeType.ISSUE:
|
|
return context.timelineStore.issuesTimeLineStore;
|
|
case ETimeLineTypeType.MODULE:
|
|
return context.timelineStore.modulesTimeLineStore;
|
|
}
|
|
};
|
|
|
|
export const useTimeLineChartStore = () => {
|
|
const timelineType = useTimeLineType();
|
|
|
|
if (!timelineType) throw new Error("useTimeLineChartStore must be used within TimeLineTypeContext");
|
|
|
|
return useTimeLineChart(timelineType);
|
|
};
|