Skip to content

Commit

Permalink
chore: set order by to manual on gantt chart (#1886)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaryan610 committed Aug 18, 2023
1 parent b67e30f commit 6344f6f
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions apps/app/contexts/issue-view.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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({
type: "SET_GROUP_BY_PROPERTY",
payload: {
Expand All @@ -371,20 +377,30 @@ export const IssueViewContextProvider: React.FC<{ children: React.ReactNode }> =
});
}
if (property === "calendar") {
additionalProperties.groupByProperty = null;
dispatch({
type: "SET_GROUP_BY_PROPERTY",
payload: {
groupByProperty: null,
},
});
}
if (property === "gantt_chart") {
additionalProperties.orderBy = "sort_order";
dispatch({
type: "SET_ORDER_BY_PROPERTY",
payload: {
orderBy: "sort_order",
},
});
}

if (!workspaceSlug || !projectId) return;

saveDataToServer(workspaceSlug as string, projectId as string, {
...state,
issueView: property,
groupByProperty: "state",
...additionalProperties,
});
},
[workspaceSlug, projectId, state]
Expand Down

0 comments on commit 6344f6f

Please sign in to comment.