From b649950d6234a23499aac6824cffe3f5e23c3fb8 Mon Sep 17 00:00:00 2001 From: "Kilu.He" <108015703+qinluhe@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:52:02 +0800 Subject: [PATCH] fix: table issues (#6072) --- .../appflowy_web_app/src/application/slate-yjs/utils/convert.ts | 2 ++ .../appflowy_web_app/src/components/as-template/AsTemplate.tsx | 2 +- .../components/as-template/related-template/TemplateItem.tsx | 2 +- .../src/components/database/components/board/card/Card.tsx | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/frontend/appflowy_web_app/src/application/slate-yjs/utils/convert.ts b/frontend/appflowy_web_app/src/application/slate-yjs/utils/convert.ts index 114b52d013..87215e2df3 100644 --- a/frontend/appflowy_web_app/src/application/slate-yjs/utils/convert.ts +++ b/frontend/appflowy_web_app/src/application/slate-yjs/utils/convert.ts @@ -42,6 +42,8 @@ export function yDataToSlateContent ({ if (slateNode.type === BlockType.TableBlock) { slateNode.children = sortTableCells(children as TableCellNode[]); + } else if (slateNode.type === BlockType.TableCell) { + slateNode.children = children.slice(0, 1); } else { slateNode.children = children; } diff --git a/frontend/appflowy_web_app/src/components/as-template/AsTemplate.tsx b/frontend/appflowy_web_app/src/components/as-template/AsTemplate.tsx index 3609f8b4b4..16106d24e2 100644 --- a/frontend/appflowy_web_app/src/components/as-template/AsTemplate.tsx +++ b/frontend/appflowy_web_app/src/components/as-template/AsTemplate.tsx @@ -67,7 +67,7 @@ function AsTemplate ({ onOk: () => { const url = import.meta.env.AF_BASE_URL?.includes('test') ? 'https://test.appflowy.io' : 'https://appflowy.io'; - window.open(`${url}/template-center/${selectedCategoryIds[0]}/${viewId}`, '_blank'); + window.open(`${url}/templates/${selectedCategoryIds[0]}/${viewId}`, '_blank'); }, }); handleBack(); diff --git a/frontend/appflowy_web_app/src/components/as-template/related-template/TemplateItem.tsx b/frontend/appflowy_web_app/src/components/as-template/related-template/TemplateItem.tsx index 7960ae8464..fb77e40c16 100644 --- a/frontend/appflowy_web_app/src/components/as-template/related-template/TemplateItem.tsx +++ b/frontend/appflowy_web_app/src/components/as-template/related-template/TemplateItem.tsx @@ -18,7 +18,7 @@ function TemplateItem ({ template, category }: { template: TemplateSummary; cate return ( <> {showFields.map((field, index) => { return ;