From 5b8bd6e19c946e2f5eccb216df773dce7691cac7 Mon Sep 17 00:00:00 2001 From: sealday Date: Tue, 23 Apr 2024 17:54:31 +0800 Subject: [PATCH] fix: setting block cant search items (#814) Reviewed-on: https://git.daoyoucloud.com/daoyoucloud/tachybase/pulls/814 --- .changeset/lucky-humans-tap.md | 5 ++ .../blocks/SettingBlockInitializer.tsx | 50 ++++++++++--------- 2 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 .changeset/lucky-humans-tap.md diff --git a/.changeset/lucky-humans-tap.md b/.changeset/lucky-humans-tap.md new file mode 100644 index 000000000..3eabcb2a2 --- /dev/null +++ b/.changeset/lucky-humans-tap.md @@ -0,0 +1,5 @@ +--- +"@hera/plugin-core": patch +--- + +fix setting blocks diff --git a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/SettingBlockInitializer.tsx b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/SettingBlockInitializer.tsx index 1f3ef08f7..467e3de87 100644 --- a/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/SettingBlockInitializer.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/schema-initializer/blocks/SettingBlockInitializer.tsx @@ -1,7 +1,7 @@ import { FormOutlined } from '@ant-design/icons'; import { FormLayout } from '@formily/antd-v5'; import { SchemaOptionsContext } from '@nocobase/schema'; -import { createFormBlockSchema, useAPIClient, useCollectionManager } from '@nocobase/client'; +import { APIClientProvider, createFormBlockSchema, useAPIClient, useCollectionManager } from '@nocobase/client'; import { DataBlockInitializer, FormDialog, @@ -30,33 +30,37 @@ export const SettingBlockInitializer = () => { onCreateBlockSchema={async ({ item }) => { const collection = cm.getCollection(item.name); const titleField = collection.titleField; - const result = await api.resource(collection.name).list(); const values = await FormDialog( t('Pick a data entry for viewing and editing'), () => { return ( - - - { - return { - label: item[titleField].toString(), - value: item.id, - }; - }), - required: true, - 'x-component': 'Select', - 'x-decorator': 'FormItem', + + + + - - + }} + /> + + + ); }, theme,