From ff1be5c61181ca3c2167a0f1043595a7a85a1d33 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Wed, 22 Jan 2025 13:11:25 +0530 Subject: [PATCH] fix the richTextEditor output in case on no data save --- .../Modals/ModalWithMarkdownEditor/ModalWithMarkdownEditor.tsx | 3 +-- .../common/RichTextEditor/RichTextEditor.interface.ts | 2 +- .../ui/src/components/common/RichTextEditor/RichTextEditor.tsx | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Modals/ModalWithMarkdownEditor/ModalWithMarkdownEditor.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Modals/ModalWithMarkdownEditor/ModalWithMarkdownEditor.tsx index d9638f795d1b..29fd67ac48ce 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Modals/ModalWithMarkdownEditor/ModalWithMarkdownEditor.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Modals/ModalWithMarkdownEditor/ModalWithMarkdownEditor.tsx @@ -41,8 +41,7 @@ export const ModalWithMarkdownEditor: FunctionComponent { } export interface EditorContentRef { - getEditorContent: () => string; + getEditorContent: () => string | undefined; } diff --git a/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditor.tsx b/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditor.tsx index 495c8f35c7f8..1c9e9221df9f 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditor.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/common/RichTextEditor/RichTextEditor.tsx @@ -47,7 +47,7 @@ const RichTextEditor = forwardRef( const htmlContent = editorRef.current?.editor?.getHTML() ?? ''; const backendFormat = formatContent(htmlContent, 'server'); - return backendFormat; + return backendFormat === '

' ? undefined : backendFormat; }, }));