mirror of
https://github.com/makeplane/plane.git
synced 2026-02-09 23:59:27 -06:00
fix: issue embed option in slash command (#4938)
This commit is contained in:
committed by
GitHub
parent
aa6ad4d712
commit
dbd7756163
@@ -1,11 +1,8 @@
|
||||
import { LayersIcon } from "lucide-react";
|
||||
import { SlashCommand } from "@/extensions";
|
||||
// hooks
|
||||
import { TFileHandler } from "@/hooks/use-editor";
|
||||
// plane editor types
|
||||
import { TIssueEmbedConfig } from "@/plane-editor/types";
|
||||
// types
|
||||
import { ISlashCommandItem } from "@/types";
|
||||
|
||||
type Props = {
|
||||
fileHandler: TFileHandler;
|
||||
@@ -15,27 +12,7 @@ type Props = {
|
||||
export const DocumentEditorAdditionalExtensions = (props: Props) => {
|
||||
const { fileHandler } = props;
|
||||
|
||||
const slashCommandAdditionalOptions: ISlashCommandItem[] = [
|
||||
{
|
||||
key: "issue_embed",
|
||||
title: "Issue embed",
|
||||
description: "Embed an issue from the project.",
|
||||
searchTerms: ["issue", "link", "embed"],
|
||||
icon: <LayersIcon className="h-3.5 w-3.5" />,
|
||||
command: ({ editor, range }) => {
|
||||
editor
|
||||
.chain()
|
||||
.focus()
|
||||
.insertContentAt(
|
||||
range,
|
||||
"<p class='text-sm bg-gray-300 w-fit pl-3 pr-3 pt-1 pb-1 rounded shadow-sm'>#issue_</p>"
|
||||
)
|
||||
.run();
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const extensions = [SlashCommand(fileHandler.upload, slashCommandAdditionalOptions)];
|
||||
const extensions = [SlashCommand(fileHandler.upload)];
|
||||
|
||||
return extensions;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user