removed default form complition screen

This commit is contained in:
Michael Kret 2024-10-29 13:32:21 +02:00
parent 13c047126b
commit a41937a5aa
2 changed files with 58 additions and 57 deletions

View file

@ -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,27 +94,27 @@ 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);
@ -154,10 +154,11 @@ export class WaitingWebhooks implements IWebhookManager {
// noWebhookResponse: true,
// };
// }
} else {
// } else {
// throw new ConflictError(`The execution "${executionId} has finished already.`);
// }
throw new ConflictError(`The execution "${executionId} has finished already.`);
}
}
if (execution.data.resultData.error) {
throw new ConflictError(`The execution "${executionId} has finished already.`);

View file

@ -267,7 +267,7 @@ export class Wait extends Webhook {
],
properties: [
{
displayName: 'Resume',
displayName: 'Resume On',
name: 'resume',
type: 'options',
options: [