From 042aa62fc2ddae2b9d39f4a92068c10bfe5bec14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 3 Apr 2024 17:41:15 +0200 Subject: [PATCH] fix(editor): Make Webhook node pinnable (#9047) --- cypress/e2e/13-pinning.cy.ts | 10 ++++++++++ packages/editor-ui/src/composables/useNodeType.ts | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cypress/e2e/13-pinning.cy.ts b/cypress/e2e/13-pinning.cy.ts index e0b3ef3f23..709000b5e6 100644 --- a/cypress/e2e/13-pinning.cy.ts +++ b/cypress/e2e/13-pinning.cy.ts @@ -69,6 +69,16 @@ describe('Data pinning', () => { ndv.getters.outputTbodyCell(1, 0).should('include.text', 1); }); + it('should display pin data edit button for Webhook node', () => { + workflowPage.actions.addInitialNodeToCanvas('Webhook', { keepNdvOpen: true }); + + ndv.getters + .runDataPaneHeader() + .find('button') + .filter(':visible') + .should('have.attr', 'title', 'Edit Output'); + }); + it('Should be duplicating pin data when duplicating node', () => { workflowPage.actions.addInitialNodeToCanvas('Schedule Trigger'); workflowPage.actions.addNodeToCanvas(EDIT_FIELDS_SET_NODE_NAME, true, true); diff --git a/packages/editor-ui/src/composables/useNodeType.ts b/packages/editor-ui/src/composables/useNodeType.ts index 5fa67e2c35..d41c22c001 100644 --- a/packages/editor-ui/src/composables/useNodeType.ts +++ b/packages/editor-ui/src/composables/useNodeType.ts @@ -36,7 +36,13 @@ export function useNodeType( : false; }); - const isMultipleOutputsNodeType = computed(() => (nodeType.value?.outputs ?? []).length > 1); + const isMultipleOutputsNodeType = computed(() => { + const outputs = nodeType.value?.outputs; + + if (typeof outputs === 'string') return false; // e.g. Webhook node + + return (outputs ?? []).length > 1; + }); return { nodeType,