From d708c93b22e8b2758b19a787bf67d275f70cdcf6 Mon Sep 17 00:00:00 2001 From: katherinehhh Date: Tue, 5 Mar 2024 17:39:43 +0800 Subject: [PATCH] fix: bulkEditFormItemSettings collection undefined (#3616) --- .../src/client/bulkEditFormItemSettings.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/plugins/@nocobase/plugin-action-bulk-edit/src/client/bulkEditFormItemSettings.ts b/packages/plugins/@nocobase/plugin-action-bulk-edit/src/client/bulkEditFormItemSettings.ts index c59cc7e8f..40b974f03 100644 --- a/packages/plugins/@nocobase/plugin-action-bulk-edit/src/client/bulkEditFormItemSettings.ts +++ b/packages/plugins/@nocobase/plugin-action-bulk-edit/src/client/bulkEditFormItemSettings.ts @@ -4,12 +4,11 @@ import { useField, useFieldSchema } from '@formily/react'; import { SchemaSettings, useApp, - useCollection, useCollectionManager_deprecated, + useCollection_deprecated, useDesignable, useFieldComponentName, useFormBlockContext, - useIsAssociationField, useIsFormReadPretty, useValidateSchema, } from '@nocobase/client'; @@ -40,9 +39,8 @@ export const bulkEditFormItemSettings = new SchemaSettings({ const field = useField(); const fieldSchema = useFieldSchema(); const { getCollectionJoinField } = useCollectionManager_deprecated(); - const { getField } = useCollection(); - const collectionField = - getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']); + const { dataSource } = useCollection_deprecated(); + const collectionField = getCollectionJoinField(fieldSchema['x-collection-field'], dataSource); return { title: t('Edit field title'), @@ -192,9 +190,8 @@ export const bulkEditFormItemSettings = new SchemaSettings({ const { dn, refresh } = useDesignable(); const validateSchema = useValidateSchema(); const { getCollectionJoinField } = useCollectionManager_deprecated(); - const { getField } = useCollection(); - const collectionField = - getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']); + const { dataSource } = useCollection_deprecated(); + const collectionField = getCollectionJoinField(fieldSchema['x-collection-field'], dataSource); return { title: t('Set validation rules'),