From dd5ff737d110c35270c38d6d80b315bd92340342 Mon Sep 17 00:00:00 2001 From: Palanikannan1437 <73993394+Palanikannan1437@users.noreply.github.com> Date: Wed, 2 Aug 2023 23:00:47 +0530 Subject: [PATCH] remirror instances commented out to avoid prosemirror conflicts --- .../command-palette/command-pallette.tsx | 5 +- apps/app/components/core/feeds.tsx | 26 ++-- .../core/modals/gpt-assistant-modal.tsx | 48 +++---- .../components/issues/comment/add-comment.tsx | 60 ++++----- .../issues/comment/comment-card.tsx | 36 +++--- apps/app/components/issues/main-content.tsx | 63 +++++---- .../pages/create-update-block-inline.tsx | 122 +++++++++--------- apps/app/components/pages/page-form.tsx | 16 +-- .../components/pages/single-page-block.tsx | 40 +++--- apps/app/package.json | 11 +- 10 files changed, 214 insertions(+), 213 deletions(-) diff --git a/apps/app/components/command-palette/command-pallette.tsx b/apps/app/components/command-palette/command-pallette.tsx index 0b4c9577b..2a8a4aa4d 100644 --- a/apps/app/components/command-palette/command-pallette.tsx +++ b/apps/app/components/command-palette/command-pallette.tsx @@ -49,7 +49,7 @@ export const CommandPalette: React.FC = () => { workspaceSlug && projectId && issueId ? ISSUE_DETAILS(issueId as string) : null, workspaceSlug && projectId && issueId ? () => - issuesService.retrieve(workspaceSlug as string, projectId as string, issueId as string) + issuesService.retrieve(workspaceSlug as string, projectId as string, issueId as string) : null ); @@ -81,7 +81,8 @@ export const CommandPalette: React.FC = () => { if ( !(e.target instanceof HTMLTextAreaElement) && !(e.target instanceof HTMLInputElement) && - !(e.target as Element).classList?.contains("remirror-editor") + // !(e.target as Element).classList?.contains("remirror-editor") && + !(e.target as Element).closest(".tiptap-editor-container") ) { if ((ctrlKey || metaKey) && keyPressed === "k") { e.preventDefault(); diff --git a/apps/app/components/core/feeds.tsx b/apps/app/components/core/feeds.tsx index 2924ec456..8144bfc97 100644 --- a/apps/app/components/core/feeds.tsx +++ b/apps/app/components/core/feeds.tsx @@ -16,7 +16,7 @@ import { Icon } from "components/ui"; import { renderShortDateWithYearFormat, timeAgo } from "helpers/date-time.helper"; import { addSpaceIfCamelCase } from "helpers/string.helper"; // types -import RemirrorRichTextEditor from "components/rich-text-editor"; +// import RemirrorRichTextEditor from "components/rich-text-editor"; const activityDetails: { [key: string]: { @@ -250,18 +250,18 @@ export const Feeds: React.FC = ({ activities }) => { Commented {timeAgo(activity.created_at)}

-
- -
+ {/*
*/} + {/* */} + {/*
*/} diff --git a/apps/app/components/core/modals/gpt-assistant-modal.tsx b/apps/app/components/core/modals/gpt-assistant-modal.tsx index 7c05e036a..1d3af7a51 100644 --- a/apps/app/components/core/modals/gpt-assistant-modal.tsx +++ b/apps/app/components/core/modals/gpt-assistant-modal.tsx @@ -32,17 +32,17 @@ type FormData = { task: string; }; -const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), { - ssr: false, -}); - -import { IRemirrorRichTextEditor } from "components/rich-text-editor"; - -const WrappedRemirrorRichTextEditor = forwardRef( - (props, ref) => -); - -WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor"; +// const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), { +// ssr: false, +// }); +// +// import { IRemirrorRichTextEditor } from "components/rich-text-editor"; +// +// const WrappedRemirrorRichTextEditor = forwardRef( +// (props, ref) => +// ); +// +// WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor"; export const GptAssistantModal: React.FC = ({ isOpen, @@ -150,19 +150,19 @@ export const GptAssistantModal: React.FC = ({ isOpen ? "block" : "hidden" }`} > - {((content && content !== "") || (htmlContent && htmlContent !== "

")) && ( -
- Content: - {content}

} - customClassName="-m-3" - noBorder - borderOnFocus={false} - editable={false} - ref={editorRef} - /> -
- )} + {/* {((content && content !== "") || (htmlContent && htmlContent !== "

")) && ( */} + {/*
*/} + {/* Content: */} + {/* {content}

} */} + {/* customClassName="-m-3" */} + {/* noBorder */} + {/* borderOnFocus={false} */} + {/* editable={false} */} + {/* ref={editorRef} */} + {/* /> */} + {/*
*/} + {/* )} */} {response !== "" && (
Response: diff --git a/apps/app/components/issues/comment/add-comment.tsx b/apps/app/components/issues/comment/add-comment.tsx index b7504d932..3b3cd21b0 100644 --- a/apps/app/components/issues/comment/add-comment.tsx +++ b/apps/app/components/issues/comment/add-comment.tsx @@ -18,23 +18,23 @@ import type { ICurrentUserResponse, IIssueComment } from "types"; // fetch-keys import { PROJECT_ISSUES_ACTIVITY } from "constants/fetch-keys"; -const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), { - ssr: false, - loading: () => ( - - - - ), -}); -import { IRemirrorRichTextEditor } from "components/rich-text-editor"; - -const WrappedRemirrorRichTextEditor = React.forwardRef< - IRemirrorRichTextEditor, - IRemirrorRichTextEditor ->((props, ref) => ); - -WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor"; - +// const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), { +// ssr: false, +// loading: () => ( +// +// +// +// ), +// }); +// import { IRemirrorRichTextEditor } from "components/rich-text-editor"; +// +// const WrappedRemirrorRichTextEditor = React.forwardRef< +// IRemirrorRichTextEditor, +// IRemirrorRichTextEditor +// >((props, ref) => ); +// +// WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor"; +// const defaultValues: Partial = { comment_json: "", comment_html: "", @@ -98,19 +98,19 @@ export const AddComment: React.FC = ({ issueId, user, disabled = false })
- ( - setValue("comment_json", jsonValue)} - onHTMLChange={(htmlValue) => setValue("comment_html", htmlValue)} - placeholder="Enter your comment..." - ref={editorRef} - /> - )} - /> + {/* ( */} + {/* setValue("comment_json", jsonValue)} */} + {/* onHTMLChange={(htmlValue) => setValue("comment_html", htmlValue)} */} + {/* placeholder="Enter your comment..." */} + {/* ref={editorRef} */} + {/* /> */} + {/* )} */} + {/* /> */} {isSubmitting ? "Adding..." : "Comment"} diff --git a/apps/app/components/issues/comment/comment-card.tsx b/apps/app/components/issues/comment/comment-card.tsx index 987254f3b..008290f43 100644 --- a/apps/app/components/issues/comment/comment-card.tsx +++ b/apps/app/components/issues/comment/comment-card.tsx @@ -16,17 +16,17 @@ import { timeAgo } from "helpers/date-time.helper"; // types import type { IIssueComment } from "types"; -const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), { ssr: false }); - -import { IRemirrorRichTextEditor } from "components/rich-text-editor"; - -const WrappedRemirrorRichTextEditor = React.forwardRef< - IRemirrorRichTextEditor, - IRemirrorRichTextEditor ->((props, ref) => ); - -WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor"; - +// const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), { ssr: false }); +// +// import { IRemirrorRichTextEditor } from "components/rich-text-editor"; +// +// const WrappedRemirrorRichTextEditor = React.forwardRef< +// IRemirrorRichTextEditor, +// IRemirrorRichTextEditor +// >((props, ref) => ); +// +// WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor"; +// type Props = { comment: IIssueComment; onSubmit: (comment: IIssueComment) => void; @@ -132,13 +132,13 @@ export const CommentCard: React.FC = ({ comment, onSubmit, handleCommentD
- + {/* */}
diff --git a/apps/app/components/issues/main-content.tsx b/apps/app/components/issues/main-content.tsx index 316d39e8a..7c29f0810 100644 --- a/apps/app/components/issues/main-content.tsx +++ b/apps/app/components/issues/main-content.tsx @@ -50,11 +50,11 @@ export const IssueMainContent: React.FC = ({ workspaceSlug && projectId && issueDetails?.parent ? SUB_ISSUES(issueDetails.parent) : null, workspaceSlug && projectId && issueDetails?.parent ? () => - issuesService.subIssues( - workspaceSlug as string, - projectId as string, - issueDetails.parent ?? "" - ) + issuesService.subIssues( + workspaceSlug as string, + projectId as string, + issueDetails.parent ?? "" + ) : null ); const siblingIssuesList = siblingIssues?.sub_issues.filter((i) => i.id !== issueDetails.id); @@ -97,9 +97,8 @@ export const IssueMainContent: React.FC = ({ @@ -130,30 +129,30 @@ export const IssueMainContent: React.FC = ({ isAllowed={memberRole.isMember || memberRole.isOwner || !uneditable} /> - - -
- -
-
-
-

Attachments

-
- - -
-
-
-

Comments/Activity

- - + {/* */} + {/**/} + {/*
*/} + {/* */} + {/*
*/} + {/*
*/} + {/*
*/} + {/*

Attachments

*/} + {/*
*/} + {/* */} + {/* */} + {/*
*/} + {/*
*/} + {/*
*/} + {/*

Comments/Activity

*/} + {/* */} + {/* */}
); diff --git a/apps/app/components/pages/create-update-block-inline.tsx b/apps/app/components/pages/create-update-block-inline.tsx index 5e2dcb43c..3b73e041b 100644 --- a/apps/app/components/pages/create-update-block-inline.tsx +++ b/apps/app/components/pages/create-update-block-inline.tsx @@ -39,22 +39,22 @@ const defaultValues = { description_html: null, }; -const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), { - ssr: false, - loading: () => ( - - - - ), -}); -import { IRemirrorRichTextEditor } from "components/rich-text-editor"; - -const WrappedRemirrorRichTextEditor = React.forwardRef< - IRemirrorRichTextEditor, - IRemirrorRichTextEditor ->((props, ref) => ); - -WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor"; +// const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), { +// ssr: false, +// loading: () => ( +// +// +// +// ), +// }); +// import { IRemirrorRichTextEditor } from "components/rich-text-editor"; +// +// const WrappedRemirrorRichTextEditor = React.forwardRef< +// IRemirrorRichTextEditor, +// IRemirrorRichTextEditor +// >((props, ref) => ); +// +// WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor"; export const CreateUpdateBlockInline: React.FC = ({ handleClose, @@ -296,51 +296,51 @@ export const CreateUpdateBlockInline: React.FC = ({ />
- { - if (!data) - return ( - setValue("description", jsonValue)} - onHTMLChange={(htmlValue) => setValue("description_html", htmlValue)} - placeholder="Write something..." - customClassName="text-sm" - noBorder - borderOnFocus={false} - ref={editorRef} - /> - ); - else if (!value || !watch("description_html")) - return ( -
- ); - - return ( - 0 - ? value - : watch("description_html") && watch("description_html") !== "" - ? watch("description_html") - : { type: "doc", content: [{ type: "paragraph" }] } - } - onJSONChange={(jsonValue) => setValue("description", jsonValue)} - onHTMLChange={(htmlValue) => setValue("description_html", htmlValue)} - placeholder="Write something..." - customClassName="text-sm" - noBorder - borderOnFocus={false} - ref={editorRef} - /> - ); - }} - /> + {/* { */} + {/* if (!data) */} + {/* return ( */} + {/* setValue("description", jsonValue)} */} + {/* onHTMLChange={(htmlValue) => setValue("description_html", htmlValue)} */} + {/* placeholder="Write something..." */} + {/* customClassName="text-sm" */} + {/* noBorder */} + {/* borderOnFocus={false} */} + {/* ref={editorRef} */} + {/* /> */} + {/* ); */} + {/* else if (!value || !watch("description_html")) */} + {/* return ( */} + {/*
*/} + {/* ); */} + {/**/} + {/* return ( */} + {/* 0 */} + {/* ? value */} + {/* : watch("description_html") && watch("description_html") !== "" */} + {/* ? watch("description_html") */} + {/* : { type: "doc", content: [{ type: "paragraph" }] } */} + {/* } */} + {/* onJSONChange={(jsonValue) => setValue("description", jsonValue)} */} + {/* onHTMLChange={(htmlValue) => setValue("description_html", htmlValue)} */} + {/* placeholder="Write something..." */} + {/* customClassName="text-sm" */} + {/* noBorder */} + {/* borderOnFocus={false} */} + {/* ref={editorRef} */} + {/* /> */} + {/* ); */} + {/* }} */} + {/* /> */}
- {showBlockDetails - ? block.description_html.length > 7 && ( - - ) - : block.description_stripped.length > 0 && ( -

- {block.description_stripped} -

- )} + {/* {showBlockDetails */} + {/* ? block.description_html.length > 7 && ( */} + {/* */} + {/* ) */} + {/* : block.description_stripped.length > 0 && ( */} + {/*

*/} + {/* {block.description_stripped} */} + {/*

*/} + {/* )} */}