feat(storage): refresh operation schema from resource links
This commit is contained in:
parent
44a4ff09a9
commit
bbbae3632a
|
|
@ -1040,6 +1040,9 @@ export class GenericNodeComponent implements OnDestroy {
|
|||
}
|
||||
|
||||
private isStructuralField(path: string): boolean {
|
||||
// Storage operation settings are supplied by a dynamic schema. Their nested properties are not
|
||||
// present in the static root schema, but a SQL statement changes placeholder input ports.
|
||||
if (this.blockType === 'StorageOperation' && path.startsWith('settings.')) return true;
|
||||
return getSchemaPathUiMeta(this.blockSchema, path).structural;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -862,13 +862,17 @@ async function syncResourceLinkPresentation(
|
|||
candidate.target === target.id && candidate.targetInput === FLOW_RESOURCE_LINK_PORT_KEY);
|
||||
const source = activeLink ? editor.getNode(activeLink.source) as HFNode | undefined : undefined;
|
||||
const resourceId = typeof source?.data?.id === 'string' ? source.data.id : null;
|
||||
const resourceType = typeof source?.data?.typeName === 'string' ? source.data.typeName : null;
|
||||
const targetData = target.data as Record<string, any>;
|
||||
const configuration = targetData['specificConfiguration'] as Record<string, unknown> | undefined;
|
||||
if (configuration?.[reference.field] === resourceId) return;
|
||||
const resourceChanged = configuration?.[reference.field] !== resourceId;
|
||||
if (!resourceChanged && configuration?.['resourceType'] === resourceType) return;
|
||||
|
||||
targetData['specificConfiguration'] = {
|
||||
...(configuration ?? {}),
|
||||
[reference.field]: resourceId
|
||||
[reference.field]: resourceId,
|
||||
...(targetData['typeName'] === 'StorageOperation' ? { resourceType } : {}),
|
||||
...(resourceChanged && targetData['typeName'] === 'StorageOperation' ? { operationId: null, settings: {} } : {})
|
||||
};
|
||||
await area.update('node', target.id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue