From 8e9a4dca7862c450e3b5b3c6aa5fcc26b2d36435 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Tue, 12 Sep 2023 22:27:15 +0530 Subject: [PATCH 1/2] refactor: view props structure (#2159) * chore: update view_props types * refactor: view props structure --- .../core/filters/issues-view-filter.tsx | 149 +++---- .../core/modals/bulk-delete-issues-modal.tsx | 6 +- web/components/core/views/all-views.tsx | 18 +- .../core/views/board-view/all-boards.tsx | 17 +- .../core/views/board-view/board-header.tsx | 24 +- .../core/views/board-view/single-board.tsx | 16 +- .../core/views/board-view/single-issue.tsx | 20 +- .../core/views/calendar-view/calendar.tsx | 20 +- web/components/core/views/issues-view.tsx | 69 ++-- .../core/views/list-view/all-lists.tsx | 9 +- .../core/views/list-view/single-issue.tsx | 9 +- .../core/views/list-view/single-list.tsx | 12 +- .../spreadsheet-view/spreadsheet-columns.tsx | 6 +- .../gantt-chart/cycle-issues-layout.tsx | 4 +- web/components/issues/delete-issue-modal.tsx | 6 +- web/components/issues/gantt-chart/layout.tsx | 4 +- web/components/issues/modal.tsx | 12 +- .../my-issues/my-issues-view-options.tsx | 192 ++++----- .../issues/my-issues/my-issues-view.tsx | 43 +- .../issues/view-select/due-date.tsx | 6 +- .../issues/view-select/start-date.tsx | 6 +- .../gantt-chart/module-issues-layout.tsx | 4 +- .../profile/profile-issues-view-options.tsx | 193 ++++----- .../profile/profile-issues-view.tsx | 52 ++- web/contexts/issue-view.context.tsx | 375 ++++-------------- web/contexts/profile-issues-context.tsx | 199 +++------- web/hooks/gantt-chart/cycle-issues-view.tsx | 8 +- web/hooks/gantt-chart/issue-view.tsx | 8 +- web/hooks/gantt-chart/module-issues-view.tsx | 8 +- web/hooks/my-issues/use-my-issues-filter.tsx | 127 +++--- web/hooks/my-issues/use-my-issues.tsx | 12 +- web/hooks/use-calendar-issues-view.tsx | 16 +- web/hooks/use-issues-view.tsx | 47 +-- web/hooks/use-profile-issues.tsx | 38 +- web/hooks/use-spreadsheet-issues-view.tsx | 16 +- web/pages/[workspaceSlug]/me/my-issues.tsx | 1 - .../[projectId]/archived-issues/index.tsx | 4 - web/services/issues.service.ts | 1 - web/services/modules.service.ts | 2 +- web/services/project.service.ts | 6 +- web/types/index.d.ts | 1 + web/types/issues.d.ts | 59 +-- web/types/projects.d.ts | 13 +- web/types/view-props.d.ts | 63 +++ web/types/workspace.d.ts | 10 +- 45 files changed, 765 insertions(+), 1146 deletions(-) create mode 100644 web/types/view-props.d.ts diff --git a/web/components/core/filters/issues-view-filter.tsx b/web/components/core/filters/issues-view-filter.tsx index 1266bd5a3..6354625dc 100644 --- a/web/components/core/filters/issues-view-filter.tsx +++ b/web/components/core/filters/issues-view-filter.tsx @@ -58,16 +58,8 @@ export const IssuesFilterView: React.FC = () => { const isArchivedIssues = router.pathname.includes("archived-issues"); const { - issueView, - setIssueView, - groupByProperty, - setGroupByProperty, - orderBy, - setOrderBy, - showEmptyGroups, - showSubIssues, - setShowSubIssues, - setShowEmptyGroups, + displayFilters, + setDisplayFilters, filters, setFilters, resetFilterToDefault, @@ -96,11 +88,11 @@ export const IssuesFilterView: React.FC = () => { - {!disableAddIssue && !disableUserActions && selectedGroup !== "created_by" && ( + {!disableAddIssue && !disableUserActions && displayFilters?.group_by !== "created_by" && (