forked from github/plane
removed remirror instances and cleaned up code
This commit is contained in:
parent
579051db31
commit
96ef0a1e4f
@ -16,8 +16,6 @@ import { Icon } from "components/ui";
|
|||||||
import { renderShortDateWithYearFormat, timeAgo } from "helpers/date-time.helper";
|
import { renderShortDateWithYearFormat, timeAgo } from "helpers/date-time.helper";
|
||||||
import { addSpaceIfCamelCase } from "helpers/string.helper";
|
import { addSpaceIfCamelCase } from "helpers/string.helper";
|
||||||
import Tiptap from "components/tiptap";
|
import Tiptap from "components/tiptap";
|
||||||
// types
|
|
||||||
// import RemirrorRichTextEditor from "components/rich-text-editor";
|
|
||||||
|
|
||||||
const activityDetails: {
|
const activityDetails: {
|
||||||
[key: string]: {
|
[key: string]: {
|
||||||
@ -262,17 +260,6 @@ export const Feeds: React.FC<any> = ({ activities }) => {
|
|||||||
noBorder
|
noBorder
|
||||||
customClassName="text-xs border border-custom-border-200 bg-custom-background-100"
|
customClassName="text-xs border border-custom-border-200 bg-custom-background-100"
|
||||||
/>
|
/>
|
||||||
{/**/}
|
|
||||||
{/* <RemirrorRichTextEditor */}
|
|
||||||
{/* value={ */}
|
|
||||||
{/* activity.new_value && activity.new_value !== "" */}
|
|
||||||
{/* ? activity.new_value */}
|
|
||||||
{/* : activity.old_value */}
|
|
||||||
{/* } */}
|
|
||||||
{/* editable={false} */}
|
|
||||||
{/* noBorder */}
|
|
||||||
{/* customClassName="text-xs border border-custom-border-200 bg-custom-background-100" */}
|
|
||||||
{/* /> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React, { useEffect, useState, forwardRef, useRef } from "react";
|
import React, { useEffect, useState, forwardRef, useRef } from "react";
|
||||||
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import dynamic from "next/dynamic";
|
|
||||||
|
|
||||||
// react-hook-form
|
// react-hook-form
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
@ -33,18 +32,6 @@ type FormData = {
|
|||||||
task: string;
|
task: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
// const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), {
|
|
||||||
// ssr: false,
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// import { IRemirrorRichTextEditor } from "components/rich-text-editor";
|
|
||||||
//
|
|
||||||
// const WrappedRemirrorRichTextEditor = forwardRef<IRemirrorRichTextEditor, IRemirrorRichTextEditor>(
|
|
||||||
// (props, ref) => <RemirrorRichTextEditor {...props} forwardedRef={ref} />
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor";
|
|
||||||
|
|
||||||
const TiptapEditor = React.forwardRef<
|
const TiptapEditor = React.forwardRef<
|
||||||
ITiptapRichTextEditor,
|
ITiptapRichTextEditor,
|
||||||
ITiptapRichTextEditor
|
ITiptapRichTextEditor
|
||||||
@ -52,7 +39,6 @@ const TiptapEditor = React.forwardRef<
|
|||||||
|
|
||||||
TiptapEditor.displayName = "TiptapEditor";
|
TiptapEditor.displayName = "TiptapEditor";
|
||||||
|
|
||||||
|
|
||||||
export const GptAssistantModal: React.FC<Props> = ({
|
export const GptAssistantModal: React.FC<Props> = ({
|
||||||
isOpen,
|
isOpen,
|
||||||
handleClose,
|
handleClose,
|
||||||
@ -169,14 +155,6 @@ export const GptAssistantModal: React.FC<Props> = ({
|
|||||||
editable={false}
|
editable={false}
|
||||||
ref={editorRef}
|
ref={editorRef}
|
||||||
/>
|
/>
|
||||||
{/* <WrappedRemirrorRichTextEditor */}
|
|
||||||
{/* value={htmlContent ?? <p>{content}</p>} */}
|
|
||||||
{/* customClassName="-m-3" */}
|
|
||||||
{/* noBorder */}
|
|
||||||
{/* borderOnFocus={false} */}
|
|
||||||
{/* editable={false} */}
|
|
||||||
{/* ref={editorRef} */}
|
|
||||||
{/* /> */}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{response !== "" && (
|
{response !== "" && (
|
||||||
@ -189,14 +167,6 @@ export const GptAssistantModal: React.FC<Props> = ({
|
|||||||
borderOnFocus={false}
|
borderOnFocus={false}
|
||||||
editable={false}
|
editable={false}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* <RemirrorRichTextEditor */}
|
|
||||||
{/* value={`<p>${response}</p>`} */}
|
|
||||||
{/* customClassName="-mx-3 -my-3" */}
|
|
||||||
{/* noBorder */}
|
|
||||||
{/* borderOnFocus={false} */}
|
|
||||||
{/* editable={false} */}
|
|
||||||
{/* /> */}
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{invalidResponse && (
|
{invalidResponse && (
|
||||||
|
@ -18,23 +18,6 @@ import type { ICurrentUserResponse, IIssueComment } from "types";
|
|||||||
import { PROJECT_ISSUES_ACTIVITY } from "constants/fetch-keys";
|
import { PROJECT_ISSUES_ACTIVITY } from "constants/fetch-keys";
|
||||||
import Tiptap, { ITiptapRichTextEditor } from "components/tiptap";
|
import Tiptap, { ITiptapRichTextEditor } from "components/tiptap";
|
||||||
|
|
||||||
// const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), {
|
|
||||||
// ssr: false,
|
|
||||||
// loading: () => (
|
|
||||||
// <Loader className="mb-5">
|
|
||||||
// <Loader.Item height="12rem" width="100%" />
|
|
||||||
// </Loader>
|
|
||||||
// ),
|
|
||||||
// });
|
|
||||||
// import { IRemirrorRichTextEditor } from "components/rich-text-editor";
|
|
||||||
//
|
|
||||||
// const WrappedRemirrorRichTextEditor = React.forwardRef<
|
|
||||||
// IRemirrorRichTextEditor,
|
|
||||||
// IRemirrorRichTextEditor
|
|
||||||
// >((props, ref) => <RemirrorRichTextEditor {...props} forwardedRef={ref} />);
|
|
||||||
//
|
|
||||||
// WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor";
|
|
||||||
|
|
||||||
const TiptapEditor = React.forwardRef<
|
const TiptapEditor = React.forwardRef<
|
||||||
ITiptapRichTextEditor,
|
ITiptapRichTextEditor,
|
||||||
ITiptapRichTextEditor
|
ITiptapRichTextEditor
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
|
|
||||||
import dynamic from "next/dynamic";
|
|
||||||
|
|
||||||
// react-hook-form
|
// react-hook-form
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
// icons
|
// icons
|
||||||
@ -17,17 +15,6 @@ import { timeAgo } from "helpers/date-time.helper";
|
|||||||
import type { IIssueComment } from "types";
|
import type { IIssueComment } from "types";
|
||||||
import Tiptap, { ITiptapRichTextEditor } from "components/tiptap";
|
import Tiptap, { ITiptapRichTextEditor } from "components/tiptap";
|
||||||
|
|
||||||
// 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) => <RemirrorRichTextEditor {...props} forwardedRef={ref} />);
|
|
||||||
//
|
|
||||||
// WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor";
|
|
||||||
|
|
||||||
const TiptapEditor = React.forwardRef<
|
const TiptapEditor = React.forwardRef<
|
||||||
ITiptapRichTextEditor,
|
ITiptapRichTextEditor,
|
||||||
ITiptapRichTextEditor
|
ITiptapRichTextEditor
|
||||||
@ -115,15 +102,6 @@ export const CommentCard: React.FC<Props> = ({ comment, onSubmit, handleCommentD
|
|||||||
className={`flex-col gap-2 ${isEditing ? "flex" : "hidden"}`}
|
className={`flex-col gap-2 ${isEditing ? "flex" : "hidden"}`}
|
||||||
onSubmit={handleSubmit(onEnter)}
|
onSubmit={handleSubmit(onEnter)}
|
||||||
>
|
>
|
||||||
{/* <WrappedRemirrorRichTextEditor */}
|
|
||||||
{/* value={comment.comment_html} */}
|
|
||||||
{/* onBlur={(jsonValue, htmlValue) => { */}
|
|
||||||
{/* setValue("comment_json", jsonValue); */}
|
|
||||||
{/* setValue("comment_html", htmlValue); */}
|
|
||||||
{/* }} */}
|
|
||||||
{/* placeholder="Enter Your comment..." */}
|
|
||||||
{/* ref={editorRef} */}
|
|
||||||
{/* /> */}
|
|
||||||
<TiptapEditor
|
<TiptapEditor
|
||||||
ref={editorRef}
|
ref={editorRef}
|
||||||
value={watch("comment_html")}
|
value={watch("comment_html")}
|
||||||
@ -158,13 +136,6 @@ export const CommentCard: React.FC<Props> = ({ comment, onSubmit, handleCommentD
|
|||||||
editable={false}
|
editable={false}
|
||||||
customClassName="text-xs border border-custom-border-200 bg-custom-background-100"
|
customClassName="text-xs border border-custom-border-200 bg-custom-background-100"
|
||||||
/>
|
/>
|
||||||
{/* <WrappedRemirrorRichTextEditor */}
|
|
||||||
{/* value={comment.comment_html} */}
|
|
||||||
{/* editable={false} */}
|
|
||||||
{/* noBorder */}
|
|
||||||
{/* customClassName="text-xs border border-custom-border-200 bg-custom-background-100" */}
|
|
||||||
{/* ref={showEditorRef} */}
|
|
||||||
{/* /> */}
|
|
||||||
<CommentReaction projectId={comment.project} commentId={comment.id} />
|
<CommentReaction projectId={comment.project} commentId={comment.id} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import React, { FC, useState, useEffect, useRef } from "react";
|
import React, { FC, useState, useEffect, useRef } from "react";
|
||||||
|
|
||||||
import dynamic from "next/dynamic";
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
|
|
||||||
// react-hook-form
|
// react-hook-form
|
||||||
@ -36,25 +35,8 @@ import {
|
|||||||
import { SparklesIcon, XMarkIcon } from "@heroicons/react/24/outline";
|
import { SparklesIcon, XMarkIcon } from "@heroicons/react/24/outline";
|
||||||
// types
|
// types
|
||||||
import type { ICurrentUserResponse, IIssue, ISearchIssueResponse } from "types";
|
import type { ICurrentUserResponse, IIssue, ISearchIssueResponse } from "types";
|
||||||
import Tiptap from "components/tiptap";
|
|
||||||
// rich-text-editor
|
// rich-text-editor
|
||||||
// const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), {
|
import Tiptap from "components/tiptap";
|
||||||
// ssr: false,
|
|
||||||
// loading: () => (
|
|
||||||
// <Loader className="mt-4">
|
|
||||||
// <Loader.Item height="12rem" width="100%" />
|
|
||||||
// </Loader>
|
|
||||||
// ),
|
|
||||||
// });
|
|
||||||
|
|
||||||
// import { IRemirrorRichTextEditor } from "components/rich-text-editor";
|
|
||||||
|
|
||||||
// const WrappedRemirrorRichTextEditor = React.forwardRef<
|
|
||||||
// IRemirrorRichTextEditor,
|
|
||||||
// IRemirrorRichTextEditor
|
|
||||||
// >((props, ref) => <RemirrorRichTextEditor {...props} forwardedRef={ref} />);
|
|
||||||
//
|
|
||||||
// WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor";
|
|
||||||
|
|
||||||
const defaultValues: Partial<IIssue> = {
|
const defaultValues: Partial<IIssue> = {
|
||||||
project: "",
|
project: "",
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import React, { useCallback, useEffect, useState } from "react";
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
|
|
||||||
import { useRouter } from "next/router";
|
import { useRouter } from "next/router";
|
||||||
import dynamic from "next/dynamic";
|
|
||||||
|
|
||||||
import { mutate } from "swr";
|
import { mutate } from "swr";
|
||||||
|
|
||||||
@ -18,7 +17,7 @@ import useToast from "hooks/use-toast";
|
|||||||
// components
|
// components
|
||||||
import { GptAssistantModal } from "components/core";
|
import { GptAssistantModal } from "components/core";
|
||||||
// ui
|
// ui
|
||||||
import { Loader, PrimaryButton, SecondaryButton, TextArea } from "components/ui";
|
import { PrimaryButton, SecondaryButton, TextArea } from "components/ui";
|
||||||
// types
|
// types
|
||||||
import { ICurrentUserResponse, IPageBlock } from "types";
|
import { ICurrentUserResponse, IPageBlock } from "types";
|
||||||
// fetch-keys
|
// fetch-keys
|
||||||
@ -40,23 +39,6 @@ const defaultValues = {
|
|||||||
description_html: null,
|
description_html: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
// const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), {
|
|
||||||
// ssr: false,
|
|
||||||
// loading: () => (
|
|
||||||
// <Loader className="mx-4 mt-6">
|
|
||||||
// <Loader.Item height="100px" width="100%" />
|
|
||||||
// </Loader>
|
|
||||||
// ),
|
|
||||||
// });
|
|
||||||
// import { IRemirrorRichTextEditor } from "components/rich-text-editor";
|
|
||||||
//
|
|
||||||
// const WrappedRemirrorRichTextEditor = React.forwardRef<
|
|
||||||
// IRemirrorRichTextEditor,
|
|
||||||
// IRemirrorRichTextEditor
|
|
||||||
// >((props, ref) => <RemirrorRichTextEditor {...props} forwardedRef={ref} />);
|
|
||||||
//
|
|
||||||
// WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor";
|
|
||||||
|
|
||||||
const TiptapEditor = React.forwardRef<
|
const TiptapEditor = React.forwardRef<
|
||||||
ITiptapRichTextEditor,
|
ITiptapRichTextEditor,
|
||||||
ITiptapRichTextEditor
|
ITiptapRichTextEditor
|
||||||
@ -322,19 +304,6 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
|
|||||||
setValue("description", description);
|
setValue("description", description);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
// <WrappedRemirrorRichTextEditor
|
|
||||||
// value={{
|
|
||||||
// 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}
|
|
||||||
// />
|
|
||||||
);
|
);
|
||||||
else if (!value || !watch("description_html"))
|
else if (!value || !watch("description_html"))
|
||||||
return (
|
return (
|
||||||
@ -360,22 +329,6 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
|
|||||||
setValue("description", description);
|
setValue("description", description);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
// <WrappedRemirrorRichTextEditor
|
|
||||||
// value={
|
|
||||||
// value && value !== "" && Object.keys(value).length > 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}
|
|
||||||
// />
|
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
|
|
||||||
import dynamic from "next/dynamic";
|
|
||||||
|
|
||||||
// react-hook-form
|
// react-hook-form
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
// ui
|
// ui
|
||||||
@ -16,16 +14,6 @@ type Props = {
|
|||||||
data?: IPage | null;
|
data?: IPage | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
// rich-text-editor
|
|
||||||
// const RemirrorRichTextEditor = dynamic(() => import("components/rich-text-editor"), {
|
|
||||||
// ssr: false,
|
|
||||||
// loading: () => (
|
|
||||||
// <Loader>
|
|
||||||
// <Loader.Item height="12rem" width="100%" />
|
|
||||||
// </Loader>
|
|
||||||
// ),
|
|
||||||
// });
|
|
||||||
|
|
||||||
const defaultValues = {
|
const defaultValues = {
|
||||||
name: "",
|
name: "",
|
||||||
description: "",
|
description: "",
|
||||||
|
@ -19,7 +19,6 @@ import useOutsideClickDetector from "hooks/use-outside-click-detector";
|
|||||||
// components
|
// components
|
||||||
import { GptAssistantModal } from "components/core";
|
import { GptAssistantModal } from "components/core";
|
||||||
import { CreateUpdateBlockInline } from "components/pages";
|
import { CreateUpdateBlockInline } from "components/pages";
|
||||||
// import RemirrorRichTextEditor, { IRemirrorRichTextEditor } from "components/rich-text-editor";
|
|
||||||
// ui
|
// ui
|
||||||
import { CustomMenu, TextArea } from "components/ui";
|
import { CustomMenu, TextArea } from "components/ui";
|
||||||
// icons
|
// icons
|
||||||
@ -49,12 +48,6 @@ type Props = {
|
|||||||
user: ICurrentUserResponse | undefined;
|
user: ICurrentUserResponse | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
// const WrappedRemirrorRichTextEditor = React.forwardRef<
|
|
||||||
// IRemirrorRichTextEditor,
|
|
||||||
// IRemirrorRichTextEditor
|
|
||||||
// >((props, ref) => <RemirrorRichTextEditor {...props} forwardedRef={ref} />);
|
|
||||||
|
|
||||||
// WrappedRemirrorRichTextEditor.displayName = "WrappedRemirrorRichTextEditor";
|
|
||||||
const TiptapEditor = React.forwardRef<
|
const TiptapEditor = React.forwardRef<
|
||||||
ITiptapRichTextEditor,
|
ITiptapRichTextEditor,
|
||||||
ITiptapRichTextEditor
|
ITiptapRichTextEditor
|
||||||
|
Loading…
Reference in New Issue
Block a user