diff --git a/lerna.json b/lerna.json index 2af4d2de84..e9ee616a66 100644 --- a/lerna.json +++ b/lerna.json @@ -2,9 +2,7 @@ "version": "1.6.0-alpha.22", "npmClient": "yarn", "useWorkspaces": true, - "npmClientArgs": [ - "--ignore-engines" - ], + "npmClientArgs": ["--ignore-engines"], "command": { "version": { "forcePublish": true, diff --git a/packages/core/client/src/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.tsx b/packages/core/client/src/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.tsx index b49b48a392..d5b5ae25d3 100644 --- a/packages/core/client/src/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.tsx +++ b/packages/core/client/src/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.tsx @@ -15,7 +15,7 @@ import { useTranslation } from 'react-i18next'; import { SchemaSettings } from '../../../../application/schema-settings/SchemaSettings'; import { useCollectionManager_deprecated, useSortFields } from '../../../../collection-manager'; import { useFieldComponentName } from '../../../../common/useFieldComponentName'; -import { useCollectionManager, useRerenderDataBlock } from '../../../../data-source'; +import { useCollectionManager, useRerenderDataBlock, useCollectionField } from '../../../../data-source'; import { FlagProvider } from '../../../../flag-provider/FlagProvider'; import { withDynamicSchemaProps } from '../../../../hoc/withDynamicSchemaProps'; import { @@ -76,8 +76,11 @@ export const allowSelectExistingRecord = { name: 'allowSelectExistingRecord', type: 'switch', useVisible() { + const fieldSchema = useFieldSchema(); + const { multiple } = fieldSchema['x-component-props']; const readPretty = useIsFieldReadPretty(); - return !readPretty; + const collectionField = useCollectionField(); + return !readPretty && multiple !== false && ['hasMany', 'belongsToMany'].includes(collectionField?.type); }, useComponentProps() { const { t } = useTranslation(); diff --git a/packages/core/client/src/schema-component/antd/association-field/Nester.tsx b/packages/core/client/src/schema-component/antd/association-field/Nester.tsx index 94447d6491..0b5f1a59e2 100644 --- a/packages/core/client/src/schema-component/antd/association-field/Nester.tsx +++ b/packages/core/client/src/schema-component/antd/association-field/Nester.tsx @@ -322,7 +322,7 @@ const ToManyNester = observer( } /> )} - {field.editable && allowSelectExistingRecord && currentMode === 'Nester' && ( + {field.editable && allowSelectExistingRecord && currentMode === 'Nester' && allowMultiple && (