forked from github/plane
fix: pages 'I'm feeling lucky' not working (#1058)
This commit is contained in:
parent
06618006c2
commit
4ce5a450d9
@ -146,7 +146,7 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
|
|||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
mutate(PAGE_BLOCKS_LIST(pageId as string));
|
mutate(PAGE_BLOCKS_LIST(pageId as string));
|
||||||
editorRef.current?.setEditorValue(res.description);
|
editorRef.current?.setEditorValue(res.description_html);
|
||||||
if (data.issue && data.sync)
|
if (data.issue && data.sync)
|
||||||
issuesService
|
issuesService
|
||||||
.patchIssue(workspaceSlug as string, projectId as string, data.issue, {
|
.patchIssue(workspaceSlug as string, projectId as string, data.issue, {
|
||||||
@ -184,6 +184,7 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
|
|||||||
else {
|
else {
|
||||||
setValue("description", {});
|
setValue("description", {});
|
||||||
setValue("description_html", `${watch("description_html") ?? ""}<p>${res.response}</p>`);
|
setValue("description_html", `${watch("description_html") ?? ""}<p>${res.response}</p>`);
|
||||||
|
editorRef.current?.setEditorValue(watch("description_html") ?? "");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
@ -276,7 +277,10 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
|
|||||||
if (!data)
|
if (!data)
|
||||||
return (
|
return (
|
||||||
<WrappedRemirrorRichTextEditor
|
<WrappedRemirrorRichTextEditor
|
||||||
value={value}
|
value={{
|
||||||
|
type: "doc",
|
||||||
|
content: [{ type: "paragraph" }],
|
||||||
|
}}
|
||||||
onJSONChange={(jsonValue) => setValue("description", jsonValue)}
|
onJSONChange={(jsonValue) => setValue("description", jsonValue)}
|
||||||
onHTMLChange={(htmlValue) => setValue("description_html", htmlValue)}
|
onHTMLChange={(htmlValue) => setValue("description_html", htmlValue)}
|
||||||
placeholder="Write something..."
|
placeholder="Write something..."
|
||||||
@ -292,7 +296,7 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RemirrorRichTextEditor
|
<WrappedRemirrorRichTextEditor
|
||||||
value={
|
value={
|
||||||
value && value !== "" && Object.keys(value).length > 0
|
value && value !== "" && Object.keys(value).length > 0
|
||||||
? value
|
? value
|
||||||
@ -306,6 +310,7 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
|
|||||||
customClassName="text-sm"
|
customClassName="text-sm"
|
||||||
noBorder
|
noBorder
|
||||||
borderOnFocus={false}
|
borderOnFocus={false}
|
||||||
|
ref={editorRef}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
|
Loading…
Reference in New Issue
Block a user