fix: bulkEditFormItemSettings collection undefined (#3616)
This commit is contained in:
parent
977128276a
commit
d708c93b22
@ -4,12 +4,11 @@ import { useField, useFieldSchema } from '@formily/react';
|
|||||||
import {
|
import {
|
||||||
SchemaSettings,
|
SchemaSettings,
|
||||||
useApp,
|
useApp,
|
||||||
useCollection,
|
|
||||||
useCollectionManager_deprecated,
|
useCollectionManager_deprecated,
|
||||||
|
useCollection_deprecated,
|
||||||
useDesignable,
|
useDesignable,
|
||||||
useFieldComponentName,
|
useFieldComponentName,
|
||||||
useFormBlockContext,
|
useFormBlockContext,
|
||||||
useIsAssociationField,
|
|
||||||
useIsFormReadPretty,
|
useIsFormReadPretty,
|
||||||
useValidateSchema,
|
useValidateSchema,
|
||||||
} from '@nocobase/client';
|
} from '@nocobase/client';
|
||||||
@ -40,9 +39,8 @@ export const bulkEditFormItemSettings = new SchemaSettings({
|
|||||||
const field = useField<Field>();
|
const field = useField<Field>();
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
const { getCollectionJoinField } = useCollectionManager_deprecated();
|
const { getCollectionJoinField } = useCollectionManager_deprecated();
|
||||||
const { getField } = useCollection();
|
const { dataSource } = useCollection_deprecated();
|
||||||
const collectionField =
|
const collectionField = getCollectionJoinField(fieldSchema['x-collection-field'], dataSource);
|
||||||
getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: t('Edit field title'),
|
title: t('Edit field title'),
|
||||||
@ -192,9 +190,8 @@ export const bulkEditFormItemSettings = new SchemaSettings({
|
|||||||
const { dn, refresh } = useDesignable();
|
const { dn, refresh } = useDesignable();
|
||||||
const validateSchema = useValidateSchema();
|
const validateSchema = useValidateSchema();
|
||||||
const { getCollectionJoinField } = useCollectionManager_deprecated();
|
const { getCollectionJoinField } = useCollectionManager_deprecated();
|
||||||
const { getField } = useCollection();
|
const { dataSource } = useCollection_deprecated();
|
||||||
const collectionField =
|
const collectionField = getCollectionJoinField(fieldSchema['x-collection-field'], dataSource);
|
||||||
getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: t('Set validation rules'),
|
title: t('Set validation rules'),
|
||||||
|
Loading…
Reference in New Issue
Block a user