removed unused types

This commit is contained in:
Palanikannan1437 2024-03-04 14:30:04 +05:30
parent 8bd7737d7b
commit 5e703f6601
4 changed files with 9 additions and 7 deletions

View File

@ -15,7 +15,6 @@ interface CustomReadOnlyEditorProps {
description_html: string; description_html: string;
}; };
mentionHighlights?: () => Promise<IMentionHighlight[]>; mentionHighlights?: () => Promise<IMentionHighlight[]>;
mentionSuggestions?: () => Promise<IMentionSuggestion[]>;
} }
export const useReadOnlyEditor = ({ export const useReadOnlyEditor = ({
@ -25,7 +24,6 @@ export const useReadOnlyEditor = ({
editorProps = {}, editorProps = {},
rerenderOnPropsChange, rerenderOnPropsChange,
mentionHighlights, mentionHighlights,
mentionSuggestions,
}: CustomReadOnlyEditorProps) => { }: CustomReadOnlyEditorProps) => {
const editor = useCustomEditor( const editor = useCustomEditor(
{ {
@ -37,7 +35,6 @@ export const useReadOnlyEditor = ({
}, },
extensions: [ extensions: [
...CoreReadOnlyEditorExtensions({ ...CoreReadOnlyEditorExtensions({
mentionSuggestions: mentionSuggestions,
mentionHighlights: mentionHighlights, mentionHighlights: mentionHighlights,
}), }),
...extensions, ...extensions,

View File

@ -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 { ReadOnlyImageExtension } from "src/ui/extensions/image/read-only-image";
import { isValidHttpUrl } from "src/lib/utils"; import { isValidHttpUrl } from "src/lib/utils";
import { Mentions } from "src/ui/mentions"; 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"; import { CustomLinkExtension } from "src/ui/extensions/custom-link";
export const CoreReadOnlyEditorExtensions = (mentionConfig: { export const CoreReadOnlyEditorExtensions = (mentionConfig: {
mentionHighlights?: () => Promise<IMentionHighlight[]>; mentionHighlights?: () => Promise<IMentionHighlight[]>;
mentionSuggestions?: () => Promise<IMentionSuggestion[]>;
}) => [ }) => [
StarterKit.configure({ StarterKit.configure({
bulletList: { bulletList: {
@ -96,7 +95,6 @@ export const CoreReadOnlyEditorExtensions = (mentionConfig: {
TableCell, TableCell,
TableRow, TableRow,
Mentions({ Mentions({
mentionSuggestions: mentionConfig.mentionSuggestions,
mentionHighlights: mentionConfig.mentionHighlights, mentionHighlights: mentionConfig.mentionHighlights,
readonly: true, readonly: true,
}), }),

View File

@ -28,7 +28,11 @@ export const IssueDescriptionInput: FC<IssueDescriptionInputProps> = (props) =>
// states // states
const [descriptionHTML, setDescriptionHTML] = useState(value); const [descriptionHTML, setDescriptionHTML] = useState(value);
// store hooks // store hooks
const { mentionHighlights, mentionSuggestions } = useMention(); const { mentionHighlights, mentionSuggestions } = useMention({
workspaceSlug: workspaceSlug as string,
projectId: projectId as string,
});
const { getWorkspaceBySlug } = useWorkspace(); const { getWorkspaceBySlug } = useWorkspace();
// hooks // hooks
const debouncedValue = useDebounce(descriptionHTML, 1500); const debouncedValue = useDebounce(descriptionHTML, 1500);

View File

@ -274,6 +274,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
customClassName={"tracking-tight w-full px-0"} customClassName={"tracking-tight w-full px-0"}
borderOnFocus={false} borderOnFocus={false}
noBorder noBorder
mentionHighlights={mentionHighlights}
documentDetails={{ documentDetails={{
title: pageTitle, title: pageTitle,
created_by: created_by, created_by: created_by,
@ -314,6 +315,8 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
value={pageDescription} value={pageDescription}
setShouldShowAlert={setShowAlert} setShouldShowAlert={setShowAlert}
cancelUploadImage={fileService.cancelUpload} cancelUploadImage={fileService.cancelUpload}
mentionHighlights={mentionHighlights}
mentionSuggestions={mentionSuggestions}
ref={editorRef} ref={editorRef}
debouncedUpdatesEnabled={false} debouncedUpdatesEnabled={false}
setIsSubmitting={setIsSubmitting} setIsSubmitting={setIsSubmitting}