From 1b2812591938d1c2f5c273ec7e55c3066127a87c Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:29:50 +0530 Subject: [PATCH] chore: workspace view order by removed (#2303) --- .../spreadsheet-view/spreadsheet-view.tsx | 385 +++++++++--------- 1 file changed, 194 insertions(+), 191 deletions(-) diff --git a/web/components/core/views/spreadsheet-view/spreadsheet-view.tsx b/web/components/core/views/spreadsheet-view/spreadsheet-view.tsx index 538ad5743..7852a5a9d 100644 --- a/web/components/core/views/spreadsheet-view/spreadsheet-view.tsx +++ b/web/components/core/views/spreadsheet-view/spreadsheet-view.tsx @@ -234,8 +234,7 @@ export const SpreadsheetView: React.FC = ({ const isNotAllowed = userAuth.isGuest || userAuth.isViewer; const handleOrderBy = (order: TIssueOrderByOptions, itemKey: string) => { - if (!globalViewId || !currentWorkspaceIssuePath) - handleFilters("display_filters", { order_by: order }); + if (globalViewId) handleFilters("display_filters", { order_by: order }); else setDisplayFilters({ order_by: order }); setSelectedMenuItem(`${order}_${itemKey}`); setActiveSortingProperty(order === "-created_at" ? "" : itemKey); @@ -250,199 +249,203 @@ export const SpreadsheetView: React.FC = ({ ) => (
- - {activeSortingProperty === propertyName && ( -
- -
- )} - - {header} -
- } - width="xl" - > - { - handleOrderBy(ascendingOrder, propertyName); - }} - > -
-
- {propertyName === "assignee" || propertyName === "labels" ? ( - <> - - - - - A - - Z - - ) : propertyName === "due_date" || - propertyName === "created_on" || - propertyName === "updated_on" ? ( - <> - - - - - New - - Old - - ) : ( - <> - - - - - First - - Last - - )} -
- - {header} + ) : ( + -
-
- { - handleOrderBy(descendingOrder, propertyName); - }} - > -
-
- {propertyName === "assignee" || propertyName === "labels" ? ( - <> - - - - - Z - - A - - ) : propertyName === "due_date" ? ( - <> - - - - - Old - - New - - ) : ( - <> - - - - - Last - - First - - )} -
- - -
-
- {selectedMenuItem && - selectedMenuItem !== "" && - displayFilters?.order_by !== "-created_at" && - selectedMenuItem.includes(propertyName) && ( - { - handleOrderBy("-created_at", propertyName); - }} > -
-
- - - - - Clear sorting + {activeSortingProperty === propertyName && ( +
+
+ )} + + {header} +
+ } + width="xl" + > + { + handleOrderBy(ascendingOrder, propertyName); + }} + > +
+
+ {propertyName === "assignee" || propertyName === "labels" ? ( + <> + + + + + A + + Z + + ) : propertyName === "due_date" || + propertyName === "created_on" || + propertyName === "updated_on" ? ( + <> + + + + + New + + Old + + ) : ( + <> + + + + + First + + Last + + )}
- - )} - + + +
+
+ { + handleOrderBy(descendingOrder, propertyName); + }} + > +
+
+ {propertyName === "assignee" || propertyName === "labels" ? ( + <> + + + + + Z + + A + + ) : propertyName === "due_date" ? ( + <> + + + + + Old + + New + + ) : ( + <> + + + + + Last + + First + + )} +
+ + +
+
+ {selectedMenuItem && + selectedMenuItem !== "" && + displayFilters?.order_by !== "-created_at" && + selectedMenuItem.includes(propertyName) && ( + { + handleOrderBy("-created_at", propertyName); + }} + > +
+
+ + + + + Clear sorting +
+
+
+ )} + + )}
{spreadsheetIssues.map((issue: IIssue, index) => (