From e81cfcbe98f2f205a488ef96fab786ae46e114ed Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Sun, 7 Apr 2024 13:55:21 +0800 Subject: [PATCH] refactor: nanoid &uuid autoFill (#3955) --- .../src/collection-manager/interfaces/properties/index.ts | 1 + .../client/component/CollectionsManager/EditFieldAction.tsx | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/client/src/collection-manager/interfaces/properties/index.ts b/packages/core/client/src/collection-manager/interfaces/properties/index.ts index c448927894..d3b529ce94 100644 --- a/packages/core/client/src/collection-manager/interfaces/properties/index.ts +++ b/packages/core/client/src/collection-manager/interfaces/properties/index.ts @@ -85,6 +85,7 @@ export const autoFill = { 'x-content': '{{t("Automatically generate default values")}}', 'x-decorator': 'FormItem', 'x-component': 'Checkbox', + default: true, }; export const relationshipType: ISchema = { diff --git a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/EditFieldAction.tsx b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/EditFieldAction.tsx index 4a7647740a..443cccf4ac 100644 --- a/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/EditFieldAction.tsx +++ b/packages/plugins/@nocobase/plugin-data-source-manager/src/client/component/CollectionsManager/EditFieldAction.tsx @@ -87,7 +87,10 @@ const getSchema = ({ return useRequest( () => Promise.resolve({ - data: cloneDeep(omit(schema.default, ['uiSchema.rawTitle'])), + data: { + ...cloneDeep(omit(schema.default, ['uiSchema.rawTitle'])), + autoFill: schema.default?.autoFill !== false, + }, }), options, );