From 12ad3892f87dec8811fcdc90429f7020f6948d17 Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Mon, 3 Apr 2023 15:07:39 +0530 Subject: [PATCH] fix: signin page type (#671) --- .../components/account/email-code-form.tsx | 2 +- .../core/board-view/single-issue.tsx | 27 +++++++++---------- .../app/components/views/single-view-item.tsx | 8 +++--- apps/app/constants/issue.ts | 7 ++--- apps/app/hooks/use-issues-view.tsx | 12 +++++++-- 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/apps/app/components/account/email-code-form.tsx b/apps/app/components/account/email-code-form.tsx index ad46b6758..9fad9c969 100644 --- a/apps/app/components/account/email-code-form.tsx +++ b/apps/app/components/account/email-code-form.tsx @@ -121,7 +121,7 @@ export const EmailCodeForm = ({ onSuccess }: any) => { ) || "Email ID is not valid", }} error={errors.email} - placeholder="Enter you email Id" + placeholder="Enter your Email ID" /> diff --git a/apps/app/components/core/board-view/single-issue.tsx b/apps/app/components/core/board-view/single-issue.tsx index d31481d6f..4f92e3040 100644 --- a/apps/app/components/core/board-view/single-issue.tsx +++ b/apps/app/components/core/board-view/single-issue.tsx @@ -110,8 +110,7 @@ export const SingleBoardIssue: React.FC = ({ handleIssuesMutation(formData, groupTitle ?? "", selectedGroup, index, prevData), false ); - - if (moduleId) + else if (moduleId) mutate< | { [key: string]: IIssue[]; @@ -123,18 +122,18 @@ export const SingleBoardIssue: React.FC = ({ handleIssuesMutation(formData, groupTitle ?? "", selectedGroup, index, prevData), false ); - - mutate< - | { - [key: string]: IIssue[]; - } - | IIssue[] - >( - PROJECT_ISSUES_LIST_WITH_PARAMS(projectId as string, params), - (prevData) => - handleIssuesMutation(formData, groupTitle ?? "", selectedGroup, index, prevData), - false - ); + else + mutate< + | { + [key: string]: IIssue[]; + } + | IIssue[] + >( + PROJECT_ISSUES_LIST_WITH_PARAMS(projectId as string, params), + (prevData) => + handleIssuesMutation(formData, groupTitle ?? "", selectedGroup, index, prevData), + false + ); issuesService .patchIssue(workspaceSlug as string, projectId as string, issue.id, formData) diff --git a/apps/app/components/views/single-view-item.tsx b/apps/app/components/views/single-view-item.tsx index 5b8bab19e..931435a79 100644 --- a/apps/app/components/views/single-view-item.tsx +++ b/apps/app/components/views/single-view-item.tsx @@ -81,8 +81,8 @@ export const SingleViewItem: React.FC = ({ view, setSelectedView }) => { }; return ( - <> - + +
@@ -137,7 +137,7 @@ export const SingleViewItem: React.FC = ({ view, setSelectedView }) => { )}
- - +
+ ); }; diff --git a/apps/app/constants/issue.ts b/apps/app/constants/issue.ts index 83541541c..a9a39620a 100644 --- a/apps/app/constants/issue.ts +++ b/apps/app/constants/issue.ts @@ -80,11 +80,8 @@ export const handleIssuesMutation: THandleIssuesMutation = ( let newGroup: IIssue[] = []; - if (selectedGroupBy === "priority") { - newGroup = prevData[formData.priority ?? ""] ?? []; - } else if (selectedGroupBy === "state") { - newGroup = prevData[formData.state ?? ""] ?? []; - } + if (selectedGroupBy === "priority") newGroup = prevData[formData.priority ?? ""] ?? []; + else if (selectedGroupBy === "state") newGroup = prevData[formData.state ?? ""] ?? []; const updatedIssue = { ...oldGroup[issueIndex], diff --git a/apps/app/hooks/use-issues-view.tsx b/apps/app/hooks/use-issues-view.tsx index 377f078e1..6020c4b86 100644 --- a/apps/app/hooks/use-issues-view.tsx +++ b/apps/app/hooks/use-issues-view.tsx @@ -108,7 +108,7 @@ const useIssuesView = () => { const statesList = getStatesList(states ?? {}); const stateIds = statesList.map((state) => state.id); - const emptyStatesObject: { [key: string]: [] } = {}; + const emptyStatesObject: { [key: string]: [] } = useMemo(() => ({}), []); for (let i = 0; i < stateIds.length; i++) { emptyStatesObject[stateIds[i]] = []; } @@ -125,7 +125,15 @@ const useIssuesView = () => { return issuesToGroup ? Object.assign(emptyStatesObject, issuesToGroup) : undefined; return issuesToGroup; - }, [projectIssues, cycleIssues, moduleIssues, groupByProperty, cycleId, moduleId]); + }, [ + projectIssues, + cycleIssues, + moduleIssues, + groupByProperty, + cycleId, + moduleId, + emptyStatesObject, + ]); const isEmpty = Object.values(groupedByIssues ?? {}).every((group) => group.length === 0) ||