From 2a5ff3397fc3b97e322f5ac000aba693fd225b38 Mon Sep 17 00:00:00 2001 From: "M. Palanikannan" <73993394+Palanikannan1437@users.noreply.github.com> Date: Thu, 7 Dec 2023 18:51:17 +0530 Subject: [PATCH] [REGRESSION]: Inbox issue editor initialization (#3025) * fixed core editor package build error * reverting back changes such that editor doesn't rerender randomly in inbox issues --- packages/editor/core/src/ui/index.tsx | 105 --------------------- web/components/issues/description-form.tsx | 2 +- 2 files changed, 1 insertion(+), 106 deletions(-) delete mode 100644 packages/editor/core/src/ui/index.tsx diff --git a/packages/editor/core/src/ui/index.tsx b/packages/editor/core/src/ui/index.tsx deleted file mode 100644 index 6b0a22555..000000000 --- a/packages/editor/core/src/ui/index.tsx +++ /dev/null @@ -1,105 +0,0 @@ -"use client"; -import * as React from "react"; -import { Extension } from "@tiptap/react"; -import { getEditorClassNames } from "../lib/utils"; -import { EditorProps } from "@tiptap/pm/view"; -import { useEditor } from "./hooks/use-editor"; -import { EditorContainer } from "../ui/components/editor-container"; -import { EditorContentWrapper } from "../ui/components/editor-content"; -import { - UploadImage, - DeleteImage, - IMentionSuggestion, -} from "@plane/editor-types"; - -interface ICoreEditor { - value: string; - uploadFile: UploadImage; - deleteFile: DeleteImage; - noBorder?: boolean; - borderOnFocus?: boolean; - customClassName?: string; - editorContentCustomClassNames?: string; - onChange?: (json: any, html: string) => void; - setIsSubmitting?: ( - isSubmitting: "submitting" | "submitted" | "saved", - ) => void; - setShouldShowAlert?: (showAlert: boolean) => void; - editable?: boolean; - forwardedRef?: any; - debouncedUpdatesEnabled?: boolean; - accessValue: string; - onAccessChange: (accessKey: string) => void; - commentAccess: { - icon: string; - key: string; - label: "Private" | "Public"; - }[]; - mentionHighlights?: string[]; - mentionSuggestions?: IMentionSuggestion[]; - extensions?: Extension[]; - editorProps?: EditorProps; -} - -interface EditorCoreProps extends ICoreEditor { - forwardedRef?: React.Ref; -} - -interface EditorHandle { - clearEditor: () => void; - setEditorValue: (content: string) => void; -} - -const CoreEditor = ({ - onChange, - debouncedUpdatesEnabled, - editable, - setIsSubmitting, - setShouldShowAlert, - editorContentCustomClassNames, - value, - uploadFile, - deleteFile, - noBorder, - borderOnFocus, - customClassName, - forwardedRef, -}: EditorCoreProps) => { - const editor = useEditor({ - onChange, - debouncedUpdatesEnabled, - setIsSubmitting, - setShouldShowAlert, - value, - uploadFile, - deleteFile, - forwardedRef, - }); - - const editorClassNames = getEditorClassNames({ - noBorder, - borderOnFocus, - customClassName, - }); - - if (!editor) return null; - - return ( - -
- -
-
- ); -}; - -const CoreEditorWithRef = React.forwardRef( - (props, ref) => , -); - -CoreEditorWithRef.displayName = "CoreEditorWithRef"; - -export { CoreEditor, CoreEditorWithRef }; diff --git a/web/components/issues/description-form.tsx b/web/components/issues/description-form.tsx index 663a58d79..94c82c934 100644 --- a/web/components/issues/description-form.tsx +++ b/web/components/issues/description-form.tsx @@ -66,7 +66,7 @@ export const IssueDescriptionForm: FC = (props) => { setLocalIssueDescription({ id: issue.id, description_html: issue.description_html }); setLocalTitleValue(issue.name); } - }, [issue.id, issue.name, issue.description_html]); + }, [issue.id]); const handleDescriptionFormSubmit = useCallback( async (formData: Partial) => {