mirror of
https://github.com/nocobase/nocobase.git
synced 2026-08-28 17:43:07 +08:00
fix(plugin-flow-engine): resolve tree targets
This commit is contained in:
+14
@@ -333,6 +333,14 @@ describe('flowSurfaces field binding registry', () => {
|
||||
template: 'tree',
|
||||
},
|
||||
};
|
||||
const runtimeTreeToOneField = {
|
||||
interface: 'm2o',
|
||||
targetCollection: () => ({
|
||||
options: {
|
||||
template: 'tree',
|
||||
},
|
||||
}),
|
||||
};
|
||||
const generalToOneField = {
|
||||
interface: 'm2o',
|
||||
targetCollection: {
|
||||
@@ -369,6 +377,12 @@ describe('flowSurfaces field binding registry', () => {
|
||||
field: treeToOneField,
|
||||
})?.has('CascadeSelectFieldModel'),
|
||||
).toBe(true);
|
||||
expect(
|
||||
resolveSupportedFieldCapability({
|
||||
containerUse: 'FilterFormBlockModel',
|
||||
field: runtimeTreeToOneField,
|
||||
}).fieldUse,
|
||||
).toBe('CascadeSelectFieldModel');
|
||||
|
||||
expect(
|
||||
resolveSupportedFieldCapability({
|
||||
|
||||
+1
-7
@@ -70,13 +70,7 @@ function isNumericFormulaDataType(dataType: any) {
|
||||
}
|
||||
|
||||
function resolveTargetCollection(input: FlowSurfaceResolvedFieldBindingInput) {
|
||||
if (input.field?.targetCollection) {
|
||||
return input.field.targetCollection;
|
||||
}
|
||||
if (!input.getCollection || !input.dataSourceKey) {
|
||||
return null;
|
||||
}
|
||||
return resolveFieldTargetCollection(input.field, input.dataSourceKey, input.getCollection);
|
||||
return resolveFieldTargetCollection(input.field, input.dataSourceKey || 'main', input.getCollection || (() => null));
|
||||
}
|
||||
|
||||
function normalizeBindingContainerUse(containerUse?: string) {
|
||||
|
||||
Reference in New Issue
Block a user