From a56e7b17f15bc4ca36dd72f9d6423a6bb9ab1e70 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Wed, 6 Dec 2023 16:27:33 +0530 Subject: [PATCH] clean-up: removed labels in the filters and handled redirection issue from peek overview and ui changes (#3002) --- .../issues/board-views/kanban/block.tsx | 20 ++++++++---- .../issues/board-views/list/block.tsx | 20 ++++++++---- .../filters/applied-filters/filters-list.tsx | 4 +-- .../issues/filters/helpers/dropdown.tsx | 9 +----- space/components/issues/filters/root.tsx | 2 +- space/components/issues/filters/selection.tsx | 4 +-- space/components/issues/navbar/index.tsx | 4 ++- .../issues/peek-overview/layout.tsx | 31 ++++++++++++------- 8 files changed, 56 insertions(+), 38 deletions(-) diff --git a/space/components/issues/board-views/kanban/block.tsx b/space/components/issues/board-views/kanban/block.tsx index 34e4cb3f1..3623fb094 100644 --- a/space/components/issues/board-views/kanban/block.tsx +++ b/space/components/issues/board-views/kanban/block.tsx @@ -18,17 +18,25 @@ export const IssueKanBanBlock = observer(({ issue }: { issue: IIssue }) => { // router const router = useRouter(); - const { workspace_slug, project_slug, board } = router.query; + const { workspace_slug, project_slug, board, priorities, states, labels } = router.query as { + workspace_slug: string; + project_slug: string; + board: string; + priorities: string; + states: string; + labels: string; + }; const handleBlockClick = () => { issueDetailStore.setPeekId(issue.id); + const params: any = { board: board, peekId: issue.id }; + if (states && states.length > 0) params.states = states; + if (priorities && priorities.length > 0) params.priorities = priorities; + if (labels && labels.length > 0) params.labels = labels; router.push( { - pathname: `/${workspace_slug?.toString()}/${project_slug}`, - query: { - board: board?.toString(), - peekId: issue.id, - }, + pathname: `/${workspace_slug}/${project_slug}`, + query: { ...params }, }, undefined, { shallow: true } diff --git a/space/components/issues/board-views/list/block.tsx b/space/components/issues/board-views/list/block.tsx index 57011d033..45999fa96 100644 --- a/space/components/issues/board-views/list/block.tsx +++ b/space/components/issues/board-views/list/block.tsx @@ -19,17 +19,25 @@ export const IssueListBlock: FC<{ issue: IIssue }> = observer((props) => { const { project: projectStore, issueDetails: issueDetailStore }: RootStore = useMobxStore(); // router const router = useRouter(); - const { workspace_slug, project_slug, board } = router.query; + const { workspace_slug, project_slug, board, priorities, states, labels } = router.query as { + workspace_slug: string; + project_slug: string; + board: string; + priorities: string; + states: string; + labels: string; + }; const handleBlockClick = () => { issueDetailStore.setPeekId(issue.id); + const params: any = { board: board, peekId: issue.id }; + if (states && states.length > 0) params.states = states; + if (priorities && priorities.length > 0) params.priorities = priorities; + if (labels && labels.length > 0) params.labels = labels; router.push( { - pathname: `/${workspace_slug?.toString()}/${project_slug}`, - query: { - board: board?.toString(), - peekId: issue.id, - }, + pathname: `/${workspace_slug}/${project_slug}`, + query: { ...params }, }, undefined, { shallow: true } diff --git a/space/components/issues/filters/applied-filters/filters-list.tsx b/space/components/issues/filters/applied-filters/filters-list.tsx index 898898232..1a2e388d3 100644 --- a/space/components/issues/filters/applied-filters/filters-list.tsx +++ b/space/components/issues/filters/applied-filters/filters-list.tsx @@ -40,13 +40,13 @@ export const AppliedFiltersList: React.FC = (props) => { handleRemoveFilter("priority", val)} values={value} /> )} - {filterKey === "labels" && labels && ( + {/* {filterKey === "labels" && labels && ( handleRemoveFilter("labels", val)} labels={labels} values={value} /> - )} + )} */} {filterKey === "state" && states && ( = (props) => { return ( <> -