Skip to content

Commit

Permalink
fix(editor): Make Webhook node pinnable (#9047)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov authored and despairblue committed Apr 4, 2024
1 parent dbf96fc commit 8cbe2bf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 10 additions & 0 deletions cypress/e2e/13-pinning.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion packages/editor-ui/src/composables/useNodeType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8cbe2bf

Please sign in to comment.