fix: linkage rule only support action with context record (#3355)
This commit is contained in:
parent
7534e12029
commit
79735a372b
@ -84,8 +84,8 @@ export const useFormBlockType = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const useIsDetailBlock = () => {
|
export const useIsDetailBlock = () => {
|
||||||
const ctx = useActionContext();
|
const ctx = useFormBlockContext();
|
||||||
return !(ctx?.fieldSchema?.['x-acl-action'] === 'create' || ctx?.fieldSchema?.['x-action'] === 'create');
|
return ctx.type === 'update';
|
||||||
};
|
};
|
||||||
|
|
||||||
export const FormBlockProvider = (props) => {
|
export const FormBlockProvider = (props) => {
|
||||||
|
@ -663,7 +663,6 @@ export const actionSettingsItems: SchemaSettingOptions['items'] = [
|
|||||||
name: 'linkageRules',
|
name: 'linkageRules',
|
||||||
Component: SchemaSettingsLinkageRules,
|
Component: SchemaSettingsLinkageRules,
|
||||||
useVisible() {
|
useVisible() {
|
||||||
const fieldSchema = useFieldSchema();
|
|
||||||
const isAction = useLinkageAction();
|
const isAction = useLinkageAction();
|
||||||
const { linkageAction } = useSchemaToolbar();
|
const { linkageAction } = useSchemaToolbar();
|
||||||
return linkageAction || isAction;
|
return linkageAction || isAction;
|
||||||
|
@ -3,7 +3,6 @@ import {
|
|||||||
ActionDesigner,
|
ActionDesigner,
|
||||||
useSchemaToolbar,
|
useSchemaToolbar,
|
||||||
SchemaSettingsLinkageRules,
|
SchemaSettingsLinkageRules,
|
||||||
useLinkageAction,
|
|
||||||
useCollection,
|
useCollection,
|
||||||
} from '@nocobase/client';
|
} from '@nocobase/client';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user