From bbbae3632acd551b2158b2c3f8575c69d62f8e26 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Tue, 29 Sep 2026 21:08:42 +0200 Subject: [PATCH] feat(storage): refresh operation schema from resource links --- src/app/shared/nodes/generic-node/generic-node.ts | 3 +++ src/app/utilities/rete-editor.ts | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/app/shared/nodes/generic-node/generic-node.ts b/src/app/shared/nodes/generic-node/generic-node.ts index 3028877..13d0b7d 100644 --- a/src/app/shared/nodes/generic-node/generic-node.ts +++ b/src/app/shared/nodes/generic-node/generic-node.ts @@ -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; } diff --git a/src/app/utilities/rete-editor.ts b/src/app/utilities/rete-editor.ts index 250b962..e2dd2c8 100644 --- a/src/app/utilities/rete-editor.ts +++ b/src/app/utilities/rete-editor.ts @@ -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; const configuration = targetData['specificConfiguration'] as Record | 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); }