From a41937a5aa1bea52a9d51bcf0f7bb90fb62f639c Mon Sep 17 00:00:00 2001 From: Michael Kret Date: Tue, 29 Oct 2024 13:32:21 +0200 Subject: [PATCH] removed default form complition screen --- packages/cli/src/webhooks/waiting-webhooks.ts | 113 +++++++++--------- packages/nodes-base/nodes/Wait/Wait.node.ts | 2 +- 2 files changed, 58 insertions(+), 57 deletions(-) diff --git a/packages/cli/src/webhooks/waiting-webhooks.ts b/packages/cli/src/webhooks/waiting-webhooks.ts index 545e9e6b03..5f0265b58a 100644 --- a/packages/cli/src/webhooks/waiting-webhooks.ts +++ b/packages/cli/src/webhooks/waiting-webhooks.ts @@ -1,6 +1,6 @@ import axios from 'axios'; import type express from 'express'; -import { FORM_NODE_TYPE, NodeHelpers, sleep, Workflow } from 'n8n-workflow'; +import { NodeHelpers, sleep, Workflow } from 'n8n-workflow'; import { Service } from 'typedi'; import { ExecutionRepository } from '@/databases/repositories/execution.repository'; @@ -94,69 +94,70 @@ export class WaitingWebhooks implements IWebhookManager { const lastNodeExecuted = execution.data.resultData.lastNodeExecuted as string; if (execution.finished) { - if (this.includeForms && req.method === 'GET') { - const executionWorkflowData = execution.workflowData; + // if (this.includeForms && req.method === 'GET') { + // const executionWorkflowData = execution.workflowData; - const hasCompletionPage = executionWorkflowData.nodes.some((node) => { - return ( - !node.disabled && - node.type === FORM_NODE_TYPE && - node.parameters.operation === 'completion' - ); - }); + // const hasCompletionPage = executionWorkflowData.nodes.some((node) => { + // return ( + // !node.disabled && + // node.type === FORM_NODE_TYPE && + // node.parameters.operation === 'completion' + // ); + // }); - if (!hasCompletionPage) { - res.render('form-trigger-completion', { - title: 'Form Submitted', - message: 'Your response has been recorded', - formTitle: 'Form Submitted', - }); - return { - noWebhookResponse: true, - }; - } + // if (!hasCompletionPage) { + // res.render('form-trigger-completion', { + // title: 'Form Submitted', + // message: 'Your response has been recorded', + // formTitle: 'Form Submitted', + // }); + // return { + // noWebhookResponse: true, + // }; + // } - // const workflow = this.getWorkflow(execution); + // const workflow = this.getWorkflow(execution); - // const parentNodes = workflow.getParentNodes( - // execution.data.resultData.lastNodeExecuted as string, - // ); + // const parentNodes = workflow.getParentNodes( + // execution.data.resultData.lastNodeExecuted as string, + // ); - // const lastNodeExecuted = execution.data.resultData.lastNodeExecuted as string; - // const lastNode = workflow.nodes[lastNodeExecuted]; + // const lastNodeExecuted = execution.data.resultData.lastNodeExecuted as string; + // const lastNode = workflow.nodes[lastNodeExecuted]; - // if ( - // !lastNode.disabled && - // lastNode.type === FORM_NODE_TYPE && - // lastNode.parameters.operation === 'completion' - // ) { - // completionPage = lastNodeExecuted; - // } else { - // completionPage = Object.keys(workflow.nodes).find((nodeName) => { - // const node = workflow.nodes[nodeName]; - // return ( - // parentNodes.includes(nodeName) && - // !node.disabled && - // node.type === FORM_NODE_TYPE && - // node.parameters.operation === 'completion' - // ); - // }); - // } + // if ( + // !lastNode.disabled && + // lastNode.type === FORM_NODE_TYPE && + // lastNode.parameters.operation === 'completion' + // ) { + // completionPage = lastNodeExecuted; + // } else { + // completionPage = Object.keys(workflow.nodes).find((nodeName) => { + // const node = workflow.nodes[nodeName]; + // return ( + // parentNodes.includes(nodeName) && + // !node.disabled && + // node.type === FORM_NODE_TYPE && + // node.parameters.operation === 'completion' + // ); + // }); + // } - // if (!completionPage) { - // res.render('form-trigger-completion', { - // title: 'Form Submitted', - // message: 'Your response has been recorded', - // formTitle: 'Form Submitted', - // }); + // if (!completionPage) { + // res.render('form-trigger-completion', { + // title: 'Form Submitted', + // message: 'Your response has been recorded', + // formTitle: 'Form Submitted', + // }); - // return { - // noWebhookResponse: true, - // }; - // } - } else { - throw new ConflictError(`The execution "${executionId} has finished already.`); - } + // return { + // noWebhookResponse: true, + // }; + // } + // } else { + // throw new ConflictError(`The execution "${executionId} has finished already.`); + // } + throw new ConflictError(`The execution "${executionId} has finished already.`); } if (execution.data.resultData.error) { diff --git a/packages/nodes-base/nodes/Wait/Wait.node.ts b/packages/nodes-base/nodes/Wait/Wait.node.ts index 43c092beed..90a81ba7d0 100644 --- a/packages/nodes-base/nodes/Wait/Wait.node.ts +++ b/packages/nodes-base/nodes/Wait/Wait.node.ts @@ -267,7 +267,7 @@ export class Wait extends Webhook { ], properties: [ { - displayName: 'Resume', + displayName: 'Resume On', name: 'resume', type: 'options', options: [