feat(m2m-array): supports using "Table selected records" variable in m2m array fields (#5974)

This commit is contained in:
YANG QIA 2024-12-31 10:40:01 +08:00 committed by GitHub
parent e47f0ff342
commit f229f9f0f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -85,6 +85,7 @@ export const SchemaSettingsDefaultValue = function DefaultValueConfigure(props:
const tableCtx = useTableBlockContext(); const tableCtx = useTableBlockContext();
const isAllowContextVariable = const isAllowContextVariable =
collectionField?.interface === 'm2m' || collectionField?.interface === 'm2m' ||
collectionField?.interface === 'mbm' ||
(parentCollectionField?.type === 'hasMany' && collectionField?.interface === 'm2o'); (parentCollectionField?.type === 'hasMany' && collectionField?.interface === 'm2o');
const returnScope = useCallback( const returnScope = useCallback(

View File

@ -101,7 +101,9 @@ export const useContextAssociationFields = ({
const children = const children =
getChildren( getChildren(
getFilterOptions(collectionName).filter((v) => { getFilterOptions(collectionName).filter((v) => {
const isAssociationField = ['hasOne', 'hasMany', 'belongsTo', 'belongsToMany'].includes(v.type); const isAssociationField = ['hasOne', 'hasMany', 'belongsTo', 'belongsToMany', 'belongsToArray'].includes(
v.type,
);
return isAssociationField; return isAssociationField;
}), }),
{ {