From 83bf28bb83d3d4a4e90eac66da1d729dcb94a8ad Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Wed, 14 Feb 2024 12:40:03 +0530 Subject: [PATCH 1/2] chore: loading state improvement (#3657) --- .../issue-layouts/roots/cycle-layout-root.tsx | 14 +------------- .../roots/draft-issue-layout-root.tsx | 13 +------------ .../issue-layouts/roots/module-layout-root.tsx | 14 +------------- .../roots/project-view-layout-root.tsx | 13 +------------ 4 files changed, 4 insertions(+), 50 deletions(-) diff --git a/web/components/issues/issue-layouts/roots/cycle-layout-root.tsx b/web/components/issues/issue-layouts/roots/cycle-layout-root.tsx index 95204b5e5..402103072 100644 --- a/web/components/issues/issue-layouts/roots/cycle-layout-root.tsx +++ b/web/components/issues/issue-layouts/roots/cycle-layout-root.tsx @@ -17,8 +17,6 @@ import { } from "components/issues"; import { TransferIssues, TransferIssuesModal } from "components/cycles"; import { ActiveLoader } from "components/ui"; -// ui -import { Spinner } from "@plane/ui"; // constants import { EIssuesStoreType } from "constants/issue"; @@ -56,17 +54,7 @@ export const CycleLayoutRoot: React.FC = observer(() => { if (!workspaceSlug || !projectId || !cycleId) return <>; if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) { - return ( - <> - {activeLayout ? ( - - ) : ( -
- -
- )} - - ); + return <>{activeLayout && }; } return ( diff --git a/web/components/issues/issue-layouts/roots/draft-issue-layout-root.tsx b/web/components/issues/issue-layouts/roots/draft-issue-layout-root.tsx index 2528baf69..ede0dde30 100644 --- a/web/components/issues/issue-layouts/roots/draft-issue-layout-root.tsx +++ b/web/components/issues/issue-layouts/roots/draft-issue-layout-root.tsx @@ -11,7 +11,6 @@ import { ProjectDraftEmptyState } from "../empty-states"; import { IssuePeekOverview } from "components/issues/peek-overview"; import { ActiveLoader } from "components/ui"; // ui -import { Spinner } from "@plane/ui"; import { DraftKanBanLayout } from "../kanban/roots/draft-issue-root"; // constants import { EIssuesStoreType } from "constants/issue"; @@ -42,17 +41,7 @@ export const DraftIssueLayoutRoot: React.FC = observer(() => { if (!workspaceSlug || !projectId) return <>; if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) { - return ( - <> - {activeLayout ? ( - - ) : ( -
- -
- )} - - ); + return <>{activeLayout && }; } return ( diff --git a/web/components/issues/issue-layouts/roots/module-layout-root.tsx b/web/components/issues/issue-layouts/roots/module-layout-root.tsx index 5adc33d78..dfce3022f 100644 --- a/web/components/issues/issue-layouts/roots/module-layout-root.tsx +++ b/web/components/issues/issue-layouts/roots/module-layout-root.tsx @@ -16,8 +16,6 @@ import { ModuleSpreadsheetLayout, } from "components/issues"; import { ActiveLoader } from "components/ui"; -// ui -import { Spinner } from "@plane/ui"; // constants import { EIssuesStoreType } from "constants/issue"; @@ -50,17 +48,7 @@ export const ModuleLayoutRoot: React.FC = observer(() => { const activeLayout = issuesFilter?.issueFilters?.displayFilters?.layout || undefined; if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) { - return ( - <> - {activeLayout ? ( - - ) : ( -
- -
- )} - - ); + return <>{activeLayout && }; } return ( diff --git a/web/components/issues/issue-layouts/roots/project-view-layout-root.tsx b/web/components/issues/issue-layouts/roots/project-view-layout-root.tsx index 2e55a499d..2329e52df 100644 --- a/web/components/issues/issue-layouts/roots/project-view-layout-root.tsx +++ b/web/components/issues/issue-layouts/roots/project-view-layout-root.tsx @@ -15,7 +15,6 @@ import { ProjectViewListLayout, ProjectViewSpreadsheetLayout, } from "components/issues"; -import { Spinner } from "@plane/ui"; import { ActiveLoader } from "components/ui"; // constants import { EIssuesStoreType } from "constants/issue"; @@ -66,17 +65,7 @@ export const ProjectViewLayoutRoot: React.FC = observer(() => { if (!workspaceSlug || !projectId || !viewId) return <>; if (issues?.loader === "init-loader" || !issues?.groupedIssueIds) { - return ( - <> - {activeLayout ? ( - - ) : ( -
- -
- )} - - ); + return <>{activeLayout && }; } return ( From fb4cffdd1c1b3c9c7df96462d35727116452b5f4 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Wed, 14 Feb 2024 12:46:52 +0530 Subject: [PATCH 2/2] fix: infinity loader in the issue description in issue peek overview and issue detail page (#3656) --- web/components/issues/description-form.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/web/components/issues/description-form.tsx b/web/components/issues/description-form.tsx index b7601ef52..452e37e75 100644 --- a/web/components/issues/description-form.tsx +++ b/web/components/issues/description-form.tsx @@ -13,7 +13,6 @@ import { TIssueOperations } from "./issue-detail"; import { FileService } from "services/file.service"; import { useMention, useWorkspace } from "hooks/store"; import { observer } from "mobx-react"; -import { isNil } from "lodash"; export interface IssueDescriptionFormValues { name: string; @@ -79,13 +78,13 @@ export const IssueDescriptionForm: FC = observer((props) => { }, [issue.id]); // TODO: verify the exhaustive-deps warning useEffect(() => { - if (issue.description_html) { + if (["", undefined, null].includes(localIssueDescription.description_html)) { setLocalIssueDescription((state) => { - if (!isNil(state.description_html)) return state; - return { id: issue.id, description_html: issue.description_html }; + if (!["", undefined, null].includes(state.description_html)) return state; + return { id: issue.id, description_html: issue.description_html || "

" }; }); } - }, [issue.description_html]); + }, [issue.description_html, localIssueDescription.description_html, issue.id]); const handleDescriptionFormSubmit = useCallback( async (formData: Partial) => { @@ -177,7 +176,7 @@ export const IssueDescriptionForm: FC = observer((props) => { {errors.name ? errors.name.message : null}
- {issue.description_html ? ( + {localIssueDescription.description_html ? (