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;
};
mentionHighlights?: () => Promise<IMentionHighlight[]>;
mentionSuggestions?: () => Promise<IMentionSuggestion[]>;
}
export const useReadOnlyEditor = ({
@ -25,7 +24,6 @@ export const useReadOnlyEditor = ({
editorProps = {},
rerenderOnPropsChange,
mentionHighlights,
mentionSuggestions,
}: CustomReadOnlyEditorProps) => {
const editor = useCustomEditor(
{
@ -37,7 +35,6 @@ export const useReadOnlyEditor = ({
},
extensions: [
...CoreReadOnlyEditorExtensions({
mentionSuggestions: mentionSuggestions,
mentionHighlights: mentionHighlights,
}),
...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 { isValidHttpUrl } from "src/lib/utils";
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";
export const CoreReadOnlyEditorExtensions = (mentionConfig: {
mentionHighlights?: () => Promise<IMentionHighlight[]>;
mentionSuggestions?: () => Promise<IMentionSuggestion[]>;
}) => [
StarterKit.configure({
bulletList: {
@ -96,7 +95,6 @@ export const CoreReadOnlyEditorExtensions = (mentionConfig: {
TableCell,
TableRow,
Mentions({
mentionSuggestions: mentionConfig.mentionSuggestions,
mentionHighlights: mentionConfig.mentionHighlights,
readonly: true,
}),

View File

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

View File

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