fix: linkage rule only support action with context record (#3355)

This commit is contained in:
katherinehhh 2024-01-10 17:00:44 +08:00 committed by GitHub
parent 7534e12029
commit 79735a372b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 4 deletions

View File

@ -84,8 +84,8 @@ export const useFormBlockType = () => {
};
export const useIsDetailBlock = () => {
const ctx = useActionContext();
return !(ctx?.fieldSchema?.['x-acl-action'] === 'create' || ctx?.fieldSchema?.['x-action'] === 'create');
const ctx = useFormBlockContext();
return ctx.type === 'update';
};
export const FormBlockProvider = (props) => {

View File

@ -663,7 +663,6 @@ export const actionSettingsItems: SchemaSettingOptions['items'] = [
name: 'linkageRules',
Component: SchemaSettingsLinkageRules,
useVisible() {
const fieldSchema = useFieldSchema();
const isAction = useLinkageAction();
const { linkageAction } = useSchemaToolbar();
return linkageAction || isAction;

View File

@ -3,7 +3,6 @@ import {
ActionDesigner,
useSchemaToolbar,
SchemaSettingsLinkageRules,
useLinkageAction,
useCollection,
} from '@nocobase/client';