From 32ae82bb31d5712f710d3e322edc4461afa5753d Mon Sep 17 00:00:00 2001 From: Junyi Date: Fri, 11 Apr 2025 08:45:48 +0800 Subject: [PATCH 1/2] refactor(client): add default type fallback api for (#6644) --- .../core/client/src/schema-component/antd/variable/Input.tsx | 3 ++- .../plugin-workflow-delay/src/client/DelayInstruction.tsx | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/client/src/schema-component/antd/variable/Input.tsx b/packages/core/client/src/schema-component/antd/variable/Input.tsx index 75d83ec2aa..459538584a 100644 --- a/packages/core/client/src/schema-component/antd/variable/Input.tsx +++ b/packages/core/client/src/schema-component/antd/variable/Input.tsx @@ -26,12 +26,13 @@ import { Json } from '../input'; const JT_VALUE_RE = /^\s*{{\s*([^{}]+)\s*}}\s*$/; type ParseOptions = { + defaultTypeOnNull?: string; stringToDate?: boolean; }; function parseValue(value: any, options: ParseOptions = {}): string | string[] { if (value == null) { - return 'null'; + return options.defaultTypeOnNull ?? 'null'; } const type = typeof value; if (type === 'string') { diff --git a/packages/plugins/@nocobase/plugin-workflow-delay/src/client/DelayInstruction.tsx b/packages/plugins/@nocobase/plugin-workflow-delay/src/client/DelayInstruction.tsx index 0f66b56457..245f1d6270 100644 --- a/packages/plugins/@nocobase/plugin-workflow-delay/src/client/DelayInstruction.tsx +++ b/packages/plugins/@nocobase/plugin-workflow-delay/src/client/DelayInstruction.tsx @@ -57,6 +57,9 @@ export default class extends Instruction { placeholder: `{{t("Duration", { ns: "${NAMESPACE}" })}}`, useTypedConstant: [['number', { min: 1 }]], nullable: false, + parseOptions: { + defaultTypeOnNull: 'number', + }, }, default: 1, required: true, From c509e5f9e278980a5c421482da0d034cc6444845 Mon Sep 17 00:00:00 2001 From: Katherine Date: Fri, 11 Apr 2025 14:26:12 +0800 Subject: [PATCH 2/2] fix: subtable description overlapping with add new button (#6646) --- .../src/schema-component/antd/association-field/SubTable.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/association-field/SubTable.tsx b/packages/core/client/src/schema-component/antd/association-field/SubTable.tsx index 38209fca61..53225b028c 100644 --- a/packages/core/client/src/schema-component/antd/association-field/SubTable.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/SubTable.tsx @@ -256,8 +256,7 @@ export const SubTable: any = observer( {field.editable && (