From 5e703f660108a042e9ccb674beda8a72f32503d7 Mon Sep 17 00:00:00 2001 From: Palanikannan1437 <73993394+Palanikannan1437@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:30:04 +0530 Subject: [PATCH] removed unused types --- packages/editor/core/src/hooks/use-read-only-editor.tsx | 3 --- packages/editor/core/src/ui/read-only/extensions.tsx | 4 +--- web/components/issues/description-input.tsx | 6 +++++- .../[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx | 3 +++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/editor/core/src/hooks/use-read-only-editor.tsx b/packages/editor/core/src/hooks/use-read-only-editor.tsx index 4a8894e8d..872bc4359 100644 --- a/packages/editor/core/src/hooks/use-read-only-editor.tsx +++ b/packages/editor/core/src/hooks/use-read-only-editor.tsx @@ -15,7 +15,6 @@ interface CustomReadOnlyEditorProps { description_html: string; }; mentionHighlights?: () => Promise; - mentionSuggestions?: () => Promise; } export const useReadOnlyEditor = ({ @@ -25,7 +24,6 @@ export const useReadOnlyEditor = ({ editorProps = {}, rerenderOnPropsChange, mentionHighlights, - mentionSuggestions, }: CustomReadOnlyEditorProps) => { const editor = useCustomEditor( { @@ -37,7 +35,6 @@ export const useReadOnlyEditor = ({ }, extensions: [ ...CoreReadOnlyEditorExtensions({ - mentionSuggestions: mentionSuggestions, mentionHighlights: mentionHighlights, }), ...extensions, diff --git a/packages/editor/core/src/ui/read-only/extensions.tsx b/packages/editor/core/src/ui/read-only/extensions.tsx index 76b61cfa8..93fa30a29 100644 --- a/packages/editor/core/src/ui/read-only/extensions.tsx +++ b/packages/editor/core/src/ui/read-only/extensions.tsx @@ -15,12 +15,11 @@ import { TableRow } from "src/ui/extensions/table/table-row/table-row"; import { ReadOnlyImageExtension } from "src/ui/extensions/image/read-only-image"; import { isValidHttpUrl } from "src/lib/utils"; import { Mentions } from "src/ui/mentions"; -import { IMentionHighlight, IMentionSuggestion } from "src/types/mention-suggestion"; +import { IMentionHighlight } from "src/types/mention-suggestion"; import { CustomLinkExtension } from "src/ui/extensions/custom-link"; export const CoreReadOnlyEditorExtensions = (mentionConfig: { mentionHighlights?: () => Promise; - mentionSuggestions?: () => Promise; }) => [ StarterKit.configure({ bulletList: { @@ -96,7 +95,6 @@ export const CoreReadOnlyEditorExtensions = (mentionConfig: { TableCell, TableRow, Mentions({ - mentionSuggestions: mentionConfig.mentionSuggestions, mentionHighlights: mentionConfig.mentionHighlights, readonly: true, }), diff --git a/web/components/issues/description-input.tsx b/web/components/issues/description-input.tsx index 79634fa84..22eaf64af 100644 --- a/web/components/issues/description-input.tsx +++ b/web/components/issues/description-input.tsx @@ -28,7 +28,11 @@ export const IssueDescriptionInput: FC = (props) => // states const [descriptionHTML, setDescriptionHTML] = useState(value); // store hooks - const { mentionHighlights, mentionSuggestions } = useMention(); + const { mentionHighlights, mentionSuggestions } = useMention({ + workspaceSlug: workspaceSlug as string, + projectId: projectId as string, + }); + const { getWorkspaceBySlug } = useWorkspace(); // hooks const debouncedValue = useDebounce(descriptionHTML, 1500); diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index 1140c5b46..efc9e617b 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -274,6 +274,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => { customClassName={"tracking-tight w-full px-0"} borderOnFocus={false} noBorder + mentionHighlights={mentionHighlights} documentDetails={{ title: pageTitle, created_by: created_by, @@ -314,6 +315,8 @@ const PageDetailsPage: NextPageWithLayout = observer(() => { value={pageDescription} setShouldShowAlert={setShowAlert} cancelUploadImage={fileService.cancelUpload} + mentionHighlights={mentionHighlights} + mentionSuggestions={mentionSuggestions} ref={editorRef} debouncedUpdatesEnabled={false} setIsSubmitting={setIsSubmitting}