2023-01-30 14:05:18 +00:00
|
|
|
import { createContext, useCallback, useEffect, useReducer } from "react";
|
2023-01-26 18:12:20 +00:00
|
|
|
|
|
|
|
import { useRouter } from "next/router";
|
|
|
|
|
2023-03-15 06:14:44 +00:00
|
|
|
import useSWR, { mutate } from "swr";
|
2023-01-26 18:12:20 +00:00
|
|
|
|
|
|
|
// components
|
|
|
|
import ToastAlert from "components/toast-alert";
|
|
|
|
// services
|
|
|
|
import projectService from "services/project.service";
|
2023-03-16 08:37:19 +00:00
|
|
|
import viewsService from "services/views.service";
|
2023-01-26 18:12:20 +00:00
|
|
|
// types
|
2023-03-23 19:41:42 +00:00
|
|
|
import { IIssueFilterOptions, IProjectMember, TIssueGroupByOptions } from "types";
|
2023-01-26 18:12:20 +00:00
|
|
|
// fetch-keys
|
2023-03-22 20:43:52 +00:00
|
|
|
import { USER_PROJECT_VIEW, VIEW_DETAILS } from "constants/fetch-keys";
|
2023-01-26 18:12:20 +00:00
|
|
|
|
|
|
|
export const issueViewContext = createContext<ContextType>({} as ContextType);
|
|
|
|
|
|
|
|
type IssueViewProps = {
|
2023-03-15 06:14:44 +00:00
|
|
|
issueView: "list" | "kanban";
|
2023-03-23 19:41:42 +00:00
|
|
|
groupByProperty: TIssueGroupByOptions;
|
2023-03-15 06:14:44 +00:00
|
|
|
orderBy: "created_at" | "updated_at" | "priority" | "sort_order";
|
2023-03-22 20:43:52 +00:00
|
|
|
showEmptyGroups: boolean;
|
2023-03-15 06:14:44 +00:00
|
|
|
filters: IIssueFilterOptions;
|
2023-01-26 18:12:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
type ReducerActionType = {
|
|
|
|
type:
|
2023-01-30 14:05:18 +00:00
|
|
|
| "REHYDRATE_THEME"
|
2023-01-26 18:12:20 +00:00
|
|
|
| "SET_ISSUE_VIEW"
|
|
|
|
| "SET_ORDER_BY_PROPERTY"
|
2023-03-22 20:43:52 +00:00
|
|
|
| "SET_SHOW_EMPTY_STATES"
|
2023-03-15 06:14:44 +00:00
|
|
|
| "SET_FILTERS"
|
2023-01-26 18:12:20 +00:00
|
|
|
| "SET_GROUP_BY_PROPERTY"
|
|
|
|
| "RESET_TO_DEFAULT";
|
|
|
|
payload?: Partial<IssueViewProps>;
|
|
|
|
};
|
|
|
|
|
2023-03-15 06:14:44 +00:00
|
|
|
type ContextType = IssueViewProps & {
|
2023-03-23 19:41:42 +00:00
|
|
|
setGroupByProperty: (property: TIssueGroupByOptions) => void;
|
2023-03-15 06:14:44 +00:00
|
|
|
setOrderBy: (property: "created_at" | "updated_at" | "priority" | "sort_order") => void;
|
2023-03-22 20:43:52 +00:00
|
|
|
setShowEmptyGroups: (property: boolean) => void;
|
2023-03-22 12:48:19 +00:00
|
|
|
setFilters: (filters: Partial<IIssueFilterOptions>, saveToServer?: boolean) => void;
|
2023-01-26 18:12:20 +00:00
|
|
|
resetFilterToDefault: () => void;
|
|
|
|
setNewFilterDefaultView: () => void;
|
|
|
|
setIssueViewToKanban: () => void;
|
|
|
|
setIssueViewToList: () => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
type StateType = {
|
2023-03-15 06:14:44 +00:00
|
|
|
issueView: "list" | "kanban";
|
2023-03-23 19:41:42 +00:00
|
|
|
groupByProperty: TIssueGroupByOptions;
|
2023-03-15 06:14:44 +00:00
|
|
|
orderBy: "created_at" | "updated_at" | "priority" | "sort_order";
|
2023-03-22 20:43:52 +00:00
|
|
|
showEmptyGroups: boolean;
|
2023-03-15 06:14:44 +00:00
|
|
|
filters: IIssueFilterOptions;
|
2023-01-26 18:12:20 +00:00
|
|
|
};
|
|
|
|
type ReducerFunctionType = (state: StateType, action: ReducerActionType) => StateType;
|
|
|
|
|
|
|
|
export const initialState: StateType = {
|
|
|
|
issueView: "list",
|
|
|
|
groupByProperty: null,
|
2023-02-14 14:35:32 +00:00
|
|
|
orderBy: "created_at",
|
2023-03-23 17:55:30 +00:00
|
|
|
showEmptyGroups: true,
|
2023-03-15 06:14:44 +00:00
|
|
|
filters: {
|
|
|
|
type: null,
|
2023-03-16 08:37:19 +00:00
|
|
|
priority: null,
|
2023-03-15 06:14:44 +00:00
|
|
|
assignees: null,
|
|
|
|
labels: null,
|
2023-03-16 08:37:19 +00:00
|
|
|
state: null,
|
2023-03-15 06:14:44 +00:00
|
|
|
issue__assignees__id: null,
|
|
|
|
issue__labels__id: null,
|
2023-03-24 18:01:56 +00:00
|
|
|
created_by: null,
|
2023-03-15 06:14:44 +00:00
|
|
|
},
|
2023-01-26 18:12:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const reducer: ReducerFunctionType = (state, action) => {
|
|
|
|
const { type, payload } = action;
|
|
|
|
|
|
|
|
switch (type) {
|
2023-01-30 14:05:18 +00:00
|
|
|
case "REHYDRATE_THEME": {
|
|
|
|
let collapsed: any = localStorage.getItem("collapsed");
|
|
|
|
collapsed = collapsed ? JSON.parse(collapsed) : false;
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-30 14:05:18 +00:00
|
|
|
return { ...initialState, ...payload, collapsed };
|
|
|
|
}
|
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
case "SET_ISSUE_VIEW": {
|
|
|
|
const newState = {
|
|
|
|
...state,
|
|
|
|
issueView: payload?.issueView || "list",
|
|
|
|
};
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
...newState,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
case "SET_GROUP_BY_PROPERTY": {
|
|
|
|
const newState = {
|
|
|
|
...state,
|
|
|
|
groupByProperty: payload?.groupByProperty || null,
|
|
|
|
};
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
...newState,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
case "SET_ORDER_BY_PROPERTY": {
|
|
|
|
const newState = {
|
|
|
|
...state,
|
2023-03-15 06:14:44 +00:00
|
|
|
orderBy: payload?.orderBy || "created_at",
|
2023-01-26 18:12:20 +00:00
|
|
|
};
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
...newState,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2023-03-22 20:43:52 +00:00
|
|
|
case "SET_SHOW_EMPTY_STATES": {
|
|
|
|
const newState = {
|
|
|
|
...state,
|
2023-03-23 17:55:30 +00:00
|
|
|
showEmptyGroups: payload?.showEmptyGroups || true,
|
2023-03-22 20:43:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
...newState,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2023-03-15 06:14:44 +00:00
|
|
|
case "SET_FILTERS": {
|
2023-01-26 18:12:20 +00:00
|
|
|
const newState = {
|
|
|
|
...state,
|
2023-03-15 06:14:44 +00:00
|
|
|
filters: {
|
|
|
|
...state.filters,
|
|
|
|
...payload,
|
|
|
|
},
|
2023-01-26 18:12:20 +00:00
|
|
|
};
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
...newState,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
case "RESET_TO_DEFAULT": {
|
|
|
|
return {
|
|
|
|
...initialState,
|
|
|
|
...payload,
|
|
|
|
};
|
|
|
|
}
|
2023-02-14 14:35:32 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
default: {
|
|
|
|
return state;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const saveDataToServer = async (workspaceSlug: string, projectID: string, state: any) => {
|
|
|
|
await projectService.setProjectView(workspaceSlug, projectID, {
|
|
|
|
view_props: state,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2023-03-16 08:37:19 +00:00
|
|
|
const sendFilterDataToServer = async (
|
|
|
|
workspaceSlug: string,
|
2023-03-23 19:41:42 +00:00
|
|
|
projectId: string,
|
2023-03-16 08:37:19 +00:00
|
|
|
viewId: string,
|
|
|
|
state: any
|
|
|
|
) => {
|
2023-03-23 19:41:42 +00:00
|
|
|
await viewsService.patchView(workspaceSlug, projectId, viewId, {
|
2023-03-16 08:37:19 +00:00
|
|
|
...state,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2023-03-15 06:14:44 +00:00
|
|
|
const setNewDefault = async (workspaceSlug: string, projectId: string, state: any) => {
|
|
|
|
mutate<IProjectMember>(
|
|
|
|
workspaceSlug && projectId ? USER_PROJECT_VIEW(projectId as string) : null,
|
|
|
|
(prevData) => {
|
|
|
|
if (!prevData) return prevData;
|
|
|
|
|
|
|
|
return {
|
|
|
|
...prevData,
|
|
|
|
view_props: state,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
false
|
|
|
|
);
|
|
|
|
|
|
|
|
await projectService.setProjectView(workspaceSlug, projectId, {
|
2023-01-26 18:12:20 +00:00
|
|
|
view_props: state,
|
|
|
|
default_props: state,
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
export const IssueViewContextProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
|
|
|
const [state, dispatch] = useReducer(reducer, initialState);
|
|
|
|
|
|
|
|
const router = useRouter();
|
2023-03-22 20:43:52 +00:00
|
|
|
const { workspaceSlug, projectId, viewId } = router.query;
|
2023-01-26 18:12:20 +00:00
|
|
|
|
|
|
|
const { data: myViewProps, mutate: mutateMyViewProps } = useSWR(
|
|
|
|
workspaceSlug && projectId ? USER_PROJECT_VIEW(projectId as string) : null,
|
|
|
|
workspaceSlug && projectId
|
|
|
|
? () => projectService.projectMemberMe(workspaceSlug as string, projectId as string)
|
|
|
|
: null
|
|
|
|
);
|
|
|
|
|
2023-03-16 08:37:19 +00:00
|
|
|
const { data: viewDetails, mutate: mutateViewDetails } = useSWR(
|
|
|
|
workspaceSlug && projectId && viewId ? VIEW_DETAILS(viewId as string) : null,
|
|
|
|
workspaceSlug && projectId && viewId
|
|
|
|
? () =>
|
|
|
|
viewsService.getViewDetails(
|
|
|
|
workspaceSlug as string,
|
|
|
|
projectId as string,
|
|
|
|
viewId as string
|
|
|
|
)
|
|
|
|
: null
|
|
|
|
);
|
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
const setIssueViewToKanban = useCallback(() => {
|
|
|
|
dispatch({
|
|
|
|
type: "SET_ISSUE_VIEW",
|
|
|
|
payload: {
|
|
|
|
issueView: "kanban",
|
|
|
|
},
|
|
|
|
});
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
dispatch({
|
|
|
|
type: "SET_GROUP_BY_PROPERTY",
|
|
|
|
payload: {
|
2023-03-15 06:14:44 +00:00
|
|
|
groupByProperty: "state",
|
2023-01-26 18:12:20 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!workspaceSlug || !projectId) return;
|
|
|
|
|
|
|
|
saveDataToServer(workspaceSlug as string, projectId as string, {
|
|
|
|
...state,
|
|
|
|
issueView: "kanban",
|
2023-03-15 06:14:44 +00:00
|
|
|
groupByProperty: "state",
|
2023-01-26 18:12:20 +00:00
|
|
|
});
|
|
|
|
}, [workspaceSlug, projectId, state]);
|
|
|
|
|
|
|
|
const setIssueViewToList = useCallback(() => {
|
|
|
|
dispatch({
|
|
|
|
type: "SET_ISSUE_VIEW",
|
|
|
|
payload: {
|
|
|
|
issueView: "list",
|
|
|
|
},
|
|
|
|
});
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
dispatch({
|
|
|
|
type: "SET_GROUP_BY_PROPERTY",
|
|
|
|
payload: {
|
|
|
|
groupByProperty: null,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!workspaceSlug || !projectId) return;
|
|
|
|
|
2023-03-15 06:14:44 +00:00
|
|
|
mutateMyViewProps((prevData) => {
|
|
|
|
if (!prevData) return prevData;
|
|
|
|
|
|
|
|
return {
|
|
|
|
...prevData,
|
|
|
|
view_props: {
|
|
|
|
...state,
|
|
|
|
issueView: "list",
|
|
|
|
groupByProperty: null,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}, false);
|
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
saveDataToServer(workspaceSlug as string, projectId as string, {
|
|
|
|
...state,
|
|
|
|
issueView: "list",
|
|
|
|
groupByProperty: null,
|
|
|
|
});
|
2023-03-15 06:14:44 +00:00
|
|
|
}, [workspaceSlug, projectId, state, mutateMyViewProps]);
|
2023-01-26 18:12:20 +00:00
|
|
|
|
|
|
|
const setGroupByProperty = useCallback(
|
2023-03-23 19:41:42 +00:00
|
|
|
(property: TIssueGroupByOptions) => {
|
2023-01-26 18:12:20 +00:00
|
|
|
dispatch({
|
|
|
|
type: "SET_GROUP_BY_PROPERTY",
|
|
|
|
payload: {
|
|
|
|
groupByProperty: property,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!workspaceSlug || !projectId) return;
|
2023-03-15 06:14:44 +00:00
|
|
|
|
|
|
|
mutateMyViewProps((prevData) => {
|
|
|
|
if (!prevData) return prevData;
|
|
|
|
|
|
|
|
return {
|
|
|
|
...prevData,
|
|
|
|
view_props: {
|
|
|
|
...state,
|
|
|
|
groupByProperty: property,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}, false);
|
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
saveDataToServer(workspaceSlug as string, projectId as string, {
|
|
|
|
...state,
|
|
|
|
groupByProperty: property,
|
|
|
|
});
|
|
|
|
},
|
2023-03-15 06:14:44 +00:00
|
|
|
[projectId, workspaceSlug, state, mutateMyViewProps]
|
2023-01-26 18:12:20 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
const setOrderBy = useCallback(
|
2023-03-15 06:14:44 +00:00
|
|
|
(property: "created_at" | "updated_at" | "priority" | "sort_order") => {
|
2023-01-26 18:12:20 +00:00
|
|
|
dispatch({
|
|
|
|
type: "SET_ORDER_BY_PROPERTY",
|
|
|
|
payload: {
|
|
|
|
orderBy: property,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!workspaceSlug || !projectId) return;
|
2023-03-15 06:14:44 +00:00
|
|
|
|
|
|
|
mutateMyViewProps((prevData) => {
|
|
|
|
if (!prevData) return prevData;
|
|
|
|
|
|
|
|
return {
|
|
|
|
...prevData,
|
|
|
|
view_props: {
|
|
|
|
...state,
|
|
|
|
orderBy: property,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}, false);
|
|
|
|
|
2023-02-23 12:20:47 +00:00
|
|
|
saveDataToServer(workspaceSlug as string, projectId as string, {
|
|
|
|
...state,
|
|
|
|
orderBy: property,
|
|
|
|
});
|
2023-01-26 18:12:20 +00:00
|
|
|
},
|
2023-03-15 06:14:44 +00:00
|
|
|
[projectId, workspaceSlug, state, mutateMyViewProps]
|
2023-01-26 18:12:20 +00:00
|
|
|
);
|
|
|
|
|
2023-03-22 20:43:52 +00:00
|
|
|
const setShowEmptyGroups = useCallback(
|
|
|
|
(property: boolean) => {
|
|
|
|
dispatch({
|
|
|
|
type: "SET_SHOW_EMPTY_STATES",
|
|
|
|
payload: {
|
|
|
|
showEmptyGroups: property,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!workspaceSlug || !projectId) return;
|
|
|
|
|
|
|
|
mutateMyViewProps((prevData) => {
|
|
|
|
if (!prevData) return prevData;
|
|
|
|
|
|
|
|
return {
|
|
|
|
...prevData,
|
|
|
|
view_props: {
|
|
|
|
...state,
|
|
|
|
showEmptyGroups: property,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}, false);
|
|
|
|
|
|
|
|
saveDataToServer(workspaceSlug as string, projectId as string, {
|
|
|
|
...state,
|
|
|
|
showEmptyGroups: property,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
[projectId, workspaceSlug, state, mutateMyViewProps]
|
|
|
|
);
|
|
|
|
|
2023-03-15 06:14:44 +00:00
|
|
|
const setFilters = useCallback(
|
2023-03-22 12:48:19 +00:00
|
|
|
(property: Partial<IIssueFilterOptions>, saveToServer = true) => {
|
2023-03-21 11:41:04 +00:00
|
|
|
Object.keys(property).forEach((key) => {
|
|
|
|
if (property[key as keyof typeof property]?.length === 0) {
|
|
|
|
property[key as keyof typeof property] = null;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
dispatch({
|
2023-03-15 06:14:44 +00:00
|
|
|
type: "SET_FILTERS",
|
2023-01-26 18:12:20 +00:00
|
|
|
payload: {
|
2023-03-15 06:14:44 +00:00
|
|
|
filters: {
|
|
|
|
...state.filters,
|
|
|
|
...property,
|
|
|
|
},
|
2023-01-26 18:12:20 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
if (!workspaceSlug || !projectId) return;
|
2023-03-15 06:14:44 +00:00
|
|
|
|
|
|
|
mutateMyViewProps((prevData) => {
|
|
|
|
if (!prevData) return prevData;
|
|
|
|
|
|
|
|
return {
|
|
|
|
...prevData,
|
|
|
|
view_props: {
|
|
|
|
...state,
|
|
|
|
filters: {
|
|
|
|
...state.filters,
|
|
|
|
...property,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}, false);
|
|
|
|
|
2023-03-16 08:37:19 +00:00
|
|
|
if (viewId) {
|
|
|
|
mutateViewDetails((prevData: any) => {
|
|
|
|
if (!prevData) return prevData;
|
|
|
|
return {
|
|
|
|
...prevData,
|
|
|
|
query_data: {
|
|
|
|
...state.filters,
|
|
|
|
...property,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}, false);
|
2023-03-22 12:48:19 +00:00
|
|
|
if (saveToServer)
|
|
|
|
sendFilterDataToServer(workspaceSlug as string, projectId as string, viewId as string, {
|
|
|
|
query_data: {
|
|
|
|
...state.filters,
|
|
|
|
...property,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
} else if (saveToServer)
|
2023-03-16 08:37:19 +00:00
|
|
|
saveDataToServer(workspaceSlug as string, projectId as string, {
|
|
|
|
...state,
|
|
|
|
filters: {
|
|
|
|
...state.filters,
|
|
|
|
...property,
|
|
|
|
},
|
|
|
|
});
|
2023-01-26 18:12:20 +00:00
|
|
|
},
|
2023-03-16 08:37:19 +00:00
|
|
|
[projectId, workspaceSlug, state, mutateMyViewProps, viewId, mutateViewDetails]
|
2023-01-26 18:12:20 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
const setNewDefaultView = useCallback(() => {
|
|
|
|
if (!workspaceSlug || !projectId) return;
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
setNewDefault(workspaceSlug as string, projectId as string, state).then(() => {
|
|
|
|
mutateMyViewProps();
|
|
|
|
});
|
|
|
|
}, [projectId, workspaceSlug, state, mutateMyViewProps]);
|
|
|
|
|
|
|
|
const resetToDefault = useCallback(() => {
|
|
|
|
dispatch({
|
|
|
|
type: "RESET_TO_DEFAULT",
|
|
|
|
payload: myViewProps?.default_props,
|
|
|
|
});
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
if (!workspaceSlug || !projectId) return;
|
2023-03-15 06:14:44 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
saveDataToServer(workspaceSlug as string, projectId as string, myViewProps?.default_props);
|
|
|
|
}, [projectId, workspaceSlug, myViewProps]);
|
|
|
|
|
2023-01-30 14:05:18 +00:00
|
|
|
useEffect(() => {
|
|
|
|
dispatch({
|
|
|
|
type: "REHYDRATE_THEME",
|
2023-03-16 08:37:19 +00:00
|
|
|
payload: {
|
|
|
|
...myViewProps?.view_props,
|
|
|
|
filters: {
|
|
|
|
...myViewProps?.view_props?.filters,
|
|
|
|
...viewDetails?.query_data,
|
|
|
|
} as any,
|
|
|
|
},
|
2023-01-30 14:05:18 +00:00
|
|
|
});
|
2023-03-16 08:37:19 +00:00
|
|
|
}, [myViewProps, viewDetails]);
|
2023-01-30 14:05:18 +00:00
|
|
|
|
2023-01-26 18:12:20 +00:00
|
|
|
return (
|
|
|
|
<issueViewContext.Provider
|
|
|
|
value={{
|
|
|
|
issueView: state.issueView,
|
|
|
|
groupByProperty: state.groupByProperty,
|
|
|
|
setGroupByProperty,
|
|
|
|
orderBy: state.orderBy,
|
2023-03-22 20:43:52 +00:00
|
|
|
showEmptyGroups: state.showEmptyGroups,
|
2023-01-26 18:12:20 +00:00
|
|
|
setOrderBy,
|
2023-03-22 20:43:52 +00:00
|
|
|
setShowEmptyGroups,
|
2023-03-15 06:14:44 +00:00
|
|
|
filters: state.filters,
|
|
|
|
setFilters,
|
2023-01-26 18:12:20 +00:00
|
|
|
resetFilterToDefault: resetToDefault,
|
|
|
|
setNewFilterDefaultView: setNewDefaultView,
|
|
|
|
setIssueViewToKanban,
|
|
|
|
setIssueViewToList,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<ToastAlert />
|
|
|
|
{children}
|
|
|
|
</issueViewContext.Provider>
|
|
|
|
);
|
|
|
|
};
|