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 = () => {
|
export const useIsDetailBlock = () => {
|
||||||
const ctx = useFormBlockContext();
|
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) => {
|
export const FormBlockProvider = (props) => {
|
||||||
|
@ -23,6 +23,7 @@ import {
|
|||||||
SchemaSettingsModalItem,
|
SchemaSettingsModalItem,
|
||||||
SchemaSettingsRemove,
|
SchemaSettingsRemove,
|
||||||
SchemaSettingsSwitchItem,
|
SchemaSettingsSwitchItem,
|
||||||
|
SchemaSettingsEnableChildCollections,
|
||||||
} from '../../../schema-settings/SchemaSettings';
|
} from '../../../schema-settings/SchemaSettings';
|
||||||
import { DefaultValueProvider } from '../../../schema-settings/hooks/useIsAllowToSetDefaultValue';
|
import { DefaultValueProvider } from '../../../schema-settings/hooks/useIsAllowToSetDefaultValue';
|
||||||
import { useLinkageAction } from './hooks';
|
import { useLinkageAction } from './hooks';
|
||||||
@ -754,7 +755,7 @@ export const actionSettingsItems: SchemaSettingOptions['items'] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'enableChildCollections',
|
name: 'enableChildCollections',
|
||||||
Component: SchemaSettingsLinkageRules,
|
Component: SchemaSettingsEnableChildCollections,
|
||||||
useVisible() {
|
useVisible() {
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
const { name } = useCollection();
|
const { name } = useCollection();
|
||||||
|
Loading…
Reference in New Issue
Block a user