From adb71419d46d13ea695916a459ec37d47762d15f Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Tue, 5 Nov 2024 16:12:42 +0530 Subject: [PATCH 1/2] chore: code refactor --- web/ce/components/de-dupe/de-dupe-button.tsx | 15 ++++++++++++++ web/ce/components/de-dupe/index.ts | 1 + .../inbox/modals/create-modal/create-root.tsx | 20 +++++++------------ .../components/issues/issue-modal/form.tsx | 20 +++++++------------ 4 files changed, 30 insertions(+), 26 deletions(-) create mode 100644 web/ce/components/de-dupe/de-dupe-button.tsx diff --git a/web/ce/components/de-dupe/de-dupe-button.tsx b/web/ce/components/de-dupe/de-dupe-button.tsx new file mode 100644 index 00000000000..eaa4e3b7c8f --- /dev/null +++ b/web/ce/components/de-dupe/de-dupe-button.tsx @@ -0,0 +1,15 @@ +"use client"; +import React, { FC } from "react"; +// local components + +type TDeDupeButtonRoot = { + workspaceSlug: string; + isDuplicateModalOpen: boolean; + handleOnClick: () => void; + label: string; +}; + +export const DeDupeButtonRoot: FC = (props) => { + const { workspaceSlug, isDuplicateModalOpen, label, handleOnClick } = props; + return <>; +}; diff --git a/web/ce/components/de-dupe/index.ts b/web/ce/components/de-dupe/index.ts index 83622b978c0..91856db18ed 100644 --- a/web/ce/components/de-dupe/index.ts +++ b/web/ce/components/de-dupe/index.ts @@ -1,3 +1,4 @@ +export * from "./de-dupe-button"; export * from "./duplicate-modal"; export * from "./duplicate-popover"; export * from "./issue-block"; diff --git a/web/core/components/inbox/modals/create-modal/create-root.tsx b/web/core/components/inbox/modals/create-modal/create-root.tsx index 4a318d1b2a6..edd17060cd8 100644 --- a/web/core/components/inbox/modals/create-modal/create-root.tsx +++ b/web/core/components/inbox/modals/create-modal/create-root.tsx @@ -22,7 +22,7 @@ import { useAppRouter } from "@/hooks/use-app-router"; import useKeypress from "@/hooks/use-keypress"; import { usePlatformOS } from "@/hooks/use-platform-os"; // services -import { DeDupeIssueButtonLabel, DuplicateModalRoot } from "@/plane-web/components/de-dupe"; +import { DeDupeButtonRoot, DuplicateModalRoot } from "@/plane-web/components/de-dupe"; import { useDebouncedDuplicateIssues } from "@/plane-web/hooks/use-debounced-duplicate-issues"; import { FileService } from "@/services/file.service"; @@ -210,18 +210,12 @@ export const InboxIssueCreateRoot: FC = observer((props)

Create intake issue

{duplicateIssues?.length > 0 && ( - + 1 ? "s" : ""} found!`} + handleOnClick={() => handleDuplicateIssueModal(!isDuplicateModalOpen)} + /> )}
diff --git a/web/core/components/issues/issue-modal/form.tsx b/web/core/components/issues/issue-modal/form.tsx index f9dd9d06dd3..b99b5174951 100644 --- a/web/core/components/issues/issue-modal/form.tsx +++ b/web/core/components/issues/issue-modal/form.tsx @@ -31,7 +31,7 @@ import { useIssueDetail, useProject, useProjectState, useWorkspaceDraftIssues } import { usePlatformOS } from "@/hooks/use-platform-os"; import { useProjectIssueProperties } from "@/hooks/use-project-issue-properties"; // plane web components -import { DeDupeIssueButtonLabel, DuplicateModalRoot } from "@/plane-web/components/de-dupe"; +import { DeDupeButtonRoot, DuplicateModalRoot } from "@/plane-web/components/de-dupe"; import { IssueAdditionalProperties, IssueTypeSelect } from "@/plane-web/components/issues/issue-modal"; import { useDebouncedDuplicateIssues } from "@/plane-web/hooks/use-debounced-duplicate-issues"; @@ -350,18 +350,12 @@ export const IssueFormRoot: FC = observer((props) => { )}
{duplicateIssues.length > 0 && ( - + 1 ? "s" : ""} found!`} + handleOnClick={() => handleDuplicateIssueModal(!isDuplicateModalOpen)} + /> )} {watch("parent_id") && selectedParentIssue && ( From 5ad504275796766885f0aa9401b98f192499a642 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia Date: Tue, 5 Nov 2024 16:28:22 +0530 Subject: [PATCH 2/2] chore: code refactor --- web/ee/components/de-dupe/index.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 web/ee/components/de-dupe/index.ts diff --git a/web/ee/components/de-dupe/index.ts b/web/ee/components/de-dupe/index.ts new file mode 100644 index 00000000000..1c66dae21d2 --- /dev/null +++ b/web/ee/components/de-dupe/index.ts @@ -0,0 +1 @@ +export * from "ce/components/de-dupe";