From ffc9236728f07919176ee3c42476f6ebf081bb50 Mon Sep 17 00:00:00 2001 From: wjh Date: Wed, 8 May 2024 17:50:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E5=8C=BA=E5=9D=97=E5=85=BC=E5=AE=B9=E8=A7=86=E5=9B=BE=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=AD=97=E6=AE=B5=E7=9A=84=E6=83=85=E5=86=B5=20(#923)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/923 Co-authored-by: wjh Co-committed-by: wjh --- .../blocks/GroupBlockInitializer.tsx | 7 +++++++ .../src/client/schema-settings/GroupBlockConfigure.tsx | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/GroupBlockInitializer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/GroupBlockInitializer.tsx index 7a2b2c156..e19103718 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/GroupBlockInitializer.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/GroupBlockInitializer.tsx @@ -126,6 +126,13 @@ const createGroupBlockSchema = (options) => { }, }, }; + if (!sumItem.length) { + delete schema['x-decorator-props']['resource_deprecated']; + } + if (collection.template === 'view' && !sumItem.length) { + delete schema['x-decorator-props']['action']; + delete schema['x-decorator-props']['groupField']; + } return schema; }; diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-settings/GroupBlockConfigure.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-settings/GroupBlockConfigure.tsx index 46a9b2c93..a2dd83bb7 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-settings/GroupBlockConfigure.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-settings/GroupBlockConfigure.tsx @@ -104,7 +104,7 @@ const modalSchema = (t, params, valueOption, decimal) => { placeholder: '{{t("type")}}', }, enum: fieldType, - require: true, + required: true, }, field: { type: 'string', @@ -114,11 +114,13 @@ const modalSchema = (t, params, valueOption, decimal) => { placeholder: '{{t("field")}}', }, 'x-visbile': false, + required: false, enum: valueOption, 'x-reactions': { dependencies: ['.type'], fulfill: { schema: { + required: "{{$deps[0]==='field'}}", 'x-visible': "{{$deps[0]==='field'}}", }, }, @@ -132,11 +134,13 @@ const modalSchema = (t, params, valueOption, decimal) => { placeholder: '{{t("reqUrl")}}', addonBefore: , }, + required: false, 'x-visible': false, 'x-reactions': { dependencies: ['.type'], fulfill: { schema: { + required: "{{$deps[0]==='custom'}}", 'x-visible': "{{$deps[0]==='custom'}}", }, }, @@ -150,7 +154,7 @@ const modalSchema = (t, params, valueOption, decimal) => { placeholder: '{{t("format")}}', }, enum: transformers.option, - require: true, + required: true, }, digits: { type: 'string', @@ -178,7 +182,7 @@ const modalSchema = (t, params, valueOption, decimal) => { placeholder: '{{t("style")}}', }, enum: styleOption, - require: true, + required: true, }, remove: { type: 'void',