mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
fix: "Select from existing data" still showing when disable “Allow mu… (#6167)
* fix: "Select from existing data" still showing when disable “Allow multiple ” in to-many subform * fix: bug
This commit is contained in:
parent
cd50adcf5e
commit
435dc80a78
@ -2,9 +2,7 @@
|
||||
"version": "1.6.0-alpha.22",
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"npmClientArgs": [
|
||||
"--ignore-engines"
|
||||
],
|
||||
"npmClientArgs": ["--ignore-engines"],
|
||||
"command": {
|
||||
"version": {
|
||||
"forcePublish": true,
|
||||
|
@ -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();
|
||||
|
@ -322,7 +322,7 @@ const ToManyNester = observer(
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{field.editable && allowSelectExistingRecord && currentMode === 'Nester' && (
|
||||
{field.editable && allowSelectExistingRecord && currentMode === 'Nester' && allowMultiple && (
|
||||
<Action.Link
|
||||
useAction={useNesterSelectProps}
|
||||
title={
|
||||
|
Loading…
x
Reference in New Issue
Block a user