Merge branch 'next' into develop

This commit is contained in:
nocobase[bot] 2025-04-28 14:34:03 +00:00
commit b09464234d
3 changed files with 6 additions and 4 deletions

View File

@ -29,6 +29,7 @@ import { useIsAssociationField } from '../../../../schema-component/antd/form-it
import { FormLinkageRules } from '../../../../schema-settings/LinkageRules'; import { FormLinkageRules } from '../../../../schema-settings/LinkageRules';
import { SchemaSettingsLinkageRules } from '../../../../schema-settings/SchemaSettings'; import { SchemaSettingsLinkageRules } from '../../../../schema-settings/SchemaSettings';
import { SchemaSettingsItemType } from '../../../../application'; import { SchemaSettingsItemType } from '../../../../application';
import { useColumnSchema } from '../../../../schema-component';
const enabledIndexColumn: SchemaSettingsItemType = { const enabledIndexColumn: SchemaSettingsItemType = {
name: 'enableIndexColumn', name: 'enableIndexColumn',
@ -338,11 +339,12 @@ export const linkageRules = {
Component: SchemaSettingsLinkageRules, Component: SchemaSettingsLinkageRules,
useComponentProps() { useComponentProps() {
const field = useField(); const field = useField();
const fieldSchema = useFieldSchema(); const schema = useFieldSchema();
const { fieldSchema: columnSchema } = useColumnSchema();
const fieldSchema = columnSchema || schema;
const cm = useCollectionManager(); const cm = useCollectionManager();
const collectionField = cm.getCollectionField(fieldSchema['x-collection-field']); const collectionField = cm.getCollectionField(fieldSchema['x-collection-field']);
const { rerenderDataBlock } = useRerenderDataBlock(); const { rerenderDataBlock } = useRerenderDataBlock();
return { return {
collectionName: collectionField?.target, collectionName: collectionField?.target,
Component: LinkageRulesComponent, Component: LinkageRulesComponent,

View File

@ -218,7 +218,6 @@ export const SubTable: any = observer(
}, },
}; };
}; };
console.log(props);
return ( return (
<div className={subTableContainer}> <div className={subTableContainer}>
<FlagProvider isInSubTable> <FlagProvider isInSubTable>

View File

@ -104,6 +104,7 @@ function getLinkageRules(fieldSchema) {
if (!fieldSchema) { if (!fieldSchema) {
return; return;
} }
const result = fieldSchema['x-linkage-rules'] || fieldSchema?.parent?.['x-linkage-rules'] || [];
return fieldSchema['x-linkage-rules']?.filter((k) => !k.disabled); return result?.filter((k) => !k.disabled);
} }