frontend-app-api: no longer error on invalid disabled inputs

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-11-04 23:02:34 +01:00
parent f7f13a902a
commit fa28d4e6df
3 changed files with 10 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/frontend-app-api': patch
---
No longer throw error on invalid input if the child is disabled.
@@ -167,7 +167,8 @@ describe('instantiateAppNodeTree', () => {
{
...makeSpec(simpleExtension),
id: 'child-node',
attachTo: { id: 'root-node', input: 'test' },
// Using an invalid input should not be an error when disabled
attachTo: { id: 'root-node', input: 'invalid' },
disabled: true,
},
]);
@@ -176,7 +176,9 @@ export function instantiateAppNodeTree(rootNode: AppNode): void {
}
return [{ id: child.spec.id, instance: childInstance }];
});
instantiatedAttachments.set(input, instantiatedChildren);
if (instantiatedChildren.length > 0) {
instantiatedAttachments.set(input, instantiatedChildren);
}
}
(node as Mutable<AppNode>).instance = createAppNodeInstance({