refactor: parent inherited collection support enable child collection in add new action (#3398)
* refactor: parent inherited collectionsholud enable child collection in add new * fix: useisDetailBlock * fix: useIsDetailBlock * fix: useIsDetailBlock * fix: useIsDetailBlock
This commit is contained in:
parent
8217ebfb1b
commit
fe260d0371
@ -86,7 +86,8 @@ export const useFormBlockType = () => {
|
||||
|
||||
export const useIsDetailBlock = () => {
|
||||
const ctx = useFormBlockContext();
|
||||
return ctx.type !== 'create';
|
||||
const { fieldSchema } = useActionContext();
|
||||
return ctx.type !== 'create' && fieldSchema?.['x-acl-action'] !== 'create' && fieldSchema?.['x-action'] !== 'create';
|
||||
};
|
||||
|
||||
export const FormBlockProvider = (props) => {
|
||||
|
@ -23,6 +23,7 @@ import {
|
||||
SchemaSettingsModalItem,
|
||||
SchemaSettingsRemove,
|
||||
SchemaSettingsSwitchItem,
|
||||
SchemaSettingsEnableChildCollections,
|
||||
} from '../../../schema-settings/SchemaSettings';
|
||||
import { DefaultValueProvider } from '../../../schema-settings/hooks/useIsAllowToSetDefaultValue';
|
||||
import { useLinkageAction } from './hooks';
|
||||
@ -754,7 +755,7 @@ export const actionSettingsItems: SchemaSettingOptions['items'] = [
|
||||
},
|
||||
{
|
||||
name: 'enableChildCollections',
|
||||
Component: SchemaSettingsLinkageRules,
|
||||
Component: SchemaSettingsEnableChildCollections,
|
||||
useVisible() {
|
||||
const fieldSchema = useFieldSchema();
|
||||
const { name } = useCollection();
|
||||
|
Loading…
Reference in New Issue
Block a user