fix: fix custom request linkage rules problem (#4913)

This commit is contained in:
Sheldon Guo 2024-07-21 10:23:04 +08:00 committed by GitHub
parent 2e356b7e8d
commit adb72738f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -987,7 +987,9 @@ export const SchemaSettingsLinkageRules = function LinkageRules(props) {
const record = useRecord();
const { type: formBlockType } = useFormBlockType();
const category = props?.category ?? LinkageRuleCategory.default;
const elementType = ['Action', 'Action.Link'].includes(fieldSchema['x-component']) ? 'button' : 'field';
const elementType =
props?.type ||
(fieldSchema?.['x-action'] || ['Action', 'Action.Link'].includes(fieldSchema['x-component']) ? 'button' : 'field');
const gridSchema = findGridSchema(fieldSchema) || fieldSchema;
const options = useLinkageCollectionFilterOptions(collectionName);