chore: set order by to manual on gantt chart (#1886)

This commit is contained in:
Aaryan Khandelwal 2023-08-18 15:12:12 +05:30 committed by GitHub
parent b67e30fd9c
commit 6344f6f562
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -362,7 +362,13 @@ export const IssueViewContextProvider: React.FC<{ children: React.ReactNode }> =
}, },
}); });
if (property === "kanban") { const additionalProperties = {
groupByProperty: state.groupByProperty,
orderBy: state.orderBy,
};
if (property === "kanban" && state.groupByProperty === null) {
additionalProperties.groupByProperty = "state";
dispatch({ dispatch({
type: "SET_GROUP_BY_PROPERTY", type: "SET_GROUP_BY_PROPERTY",
payload: { payload: {
@ -371,6 +377,7 @@ export const IssueViewContextProvider: React.FC<{ children: React.ReactNode }> =
}); });
} }
if (property === "calendar") { if (property === "calendar") {
additionalProperties.groupByProperty = null;
dispatch({ dispatch({
type: "SET_GROUP_BY_PROPERTY", type: "SET_GROUP_BY_PROPERTY",
payload: { payload: {
@ -378,13 +385,22 @@ export const IssueViewContextProvider: React.FC<{ children: React.ReactNode }> =
}, },
}); });
} }
if (property === "gantt_chart") {
additionalProperties.orderBy = "sort_order";
dispatch({
type: "SET_ORDER_BY_PROPERTY",
payload: {
orderBy: "sort_order",
},
});
}
if (!workspaceSlug || !projectId) return; if (!workspaceSlug || !projectId) return;
saveDataToServer(workspaceSlug as string, projectId as string, { saveDataToServer(workspaceSlug as string, projectId as string, {
...state, ...state,
issueView: property, issueView: property,
groupByProperty: "state", ...additionalProperties,
}); });
}, },
[workspaceSlug, projectId, state] [workspaceSlug, projectId, state]