From 47e5892c61e41344ebcd73ca0cc2537940f65680 Mon Sep 17 00:00:00 2001 From: sealday Date: Sat, 30 Mar 2024 02:46:48 +0800 Subject: [PATCH] fix: group block error --- .../schema-components/blocks/GroupBlock.tsx | 4 +++ .../@hera/plugin-core/src/locale/en-US.json | 35 ++++++++++--------- .../@hera/plugin-core/src/locale/zh-CN.json | 35 ++++++++++--------- 3 files changed, 40 insertions(+), 34 deletions(-) diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-components/blocks/GroupBlock.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-components/blocks/GroupBlock.tsx index d8b485011..e2f5681db 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-components/blocks/GroupBlock.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-components/blocks/GroupBlock.tsx @@ -38,6 +38,10 @@ export const GroupBlock = (props) => { if (service.loading && !field.loaded) { return ; } + // 兼容旧版区块防止报错导致无法配置 + if (!params?.config || !('map' in params.config)) { + return; + } return ( <>

汇总:

diff --git a/packages/plugins/@hera/plugin-core/src/locale/en-US.json b/packages/plugins/@hera/plugin-core/src/locale/en-US.json index 0d741f266..2ffb5897f 100644 --- a/packages/plugins/@hera/plugin-core/src/locale/en-US.json +++ b/packages/plugins/@hera/plugin-core/src/locale/en-US.json @@ -1,23 +1,24 @@ { + "Add custom component": "Add custom component", + "Association field": "Association field", + "Configure": "Configure", + "Custom filter": "Custom filter", + "Custom option label": "Custom option label", + "Group block": "Group block", + "HomePage Config": "HomePage Config", "Mobile UI": "Mobile UI", + "Navigate to new page": "Navigate to new page", + "Page style": "Page Style", + "Pagination": "Pagination", + "Pick a data entry for viewing and editing": "Pick a data entry for viewing and editing", + "Please select": "Please select", + "Signature input": "Signature input", + "Something went wrong. Please contact the developer to resolve the issue.": "Something went wrong. Please contact the developer to resolve the issue.", + "System setting": "System setting", + "classical": "classical", + "component": "component", "error": "error", "loading...": "loading...", "preview block": "preview block", - "Page style": "Page Style", - "tabs": "tabs", - "Pagination": "Pagination", - "component": "component", - "Navigate to new page": "Navigate to new page", - "Custom option label": "Custom option label", - "Custom filter": "Custom filter", - "Add custom component": "Add custom component", - "Group block": "Group block", - "System setting": "System setting", - "classical": "classical", - "Signature input": "Signature input", - "Pick a data entry for viewing and editing": "Pick a data entry for viewing and editing", - "Please select": "Please select", - "Association field": "Association field", - "HomePage Config": "HomePage Config", - "Something went wrong. Please contact the developer to resolve the issue.": "Something went wrong. Please contact the developer to resolve the issue." + "tabs": "tabs" } diff --git a/packages/plugins/@hera/plugin-core/src/locale/zh-CN.json b/packages/plugins/@hera/plugin-core/src/locale/zh-CN.json index 6a550ec41..a4474030d 100644 --- a/packages/plugins/@hera/plugin-core/src/locale/zh-CN.json +++ b/packages/plugins/@hera/plugin-core/src/locale/zh-CN.json @@ -1,23 +1,24 @@ { + "Add custom component": "添加自定义组件", + "Association field": "关联字段", + "Configure": "配置", + "Custom filter": "自定义筛选", + "Custom option label": "自定义选项标签", + "Group block": "汇总区块", + "HomePage Config": "主页配置", "Mobile UI": "移动端页面", + "Navigate to new page": "导航到新页面", + "Page style": "页面版本", + "Pagination": "分页", + "Pick a data entry for viewing and editing": "选择一条数据用于查看与编辑", + "Please select": "请选择", + "Signature input": "手写签名", + "Something went wrong. Please contact the developer to resolve the issue.": "系统内部错误,请联系开发者解决", + "System setting": "系统设置", + "classical": "经典版", + "component": "组件", "error": "出错了", "loading...": "加载中...", "preview block": "预览区块", - "Page style": "页面版本", - "tabs": "多标签", - "Pagination": "分页", - "Custom option label": "自定义选项标签", - "Custom filter": "自定义筛选", - "Navigate to new page": "导航到新页面", - "component": "组件", - "Add custom component": "添加自定义组件", - "Group block": "汇总区块", - "System setting": "系统设置", - "classical": "经典版", - "Signature input": "手写签名", - "Pick a data entry for viewing and editing": "选择一条数据用于查看与编辑", - "Please select": "请选择", - "Association field": "关联字段", - "HomePage Config": "主页配置", - "Something went wrong. Please contact the developer to resolve the issue.": "系统内部错误,请联系开发者解决" + "tabs": "多标签" }