feat(n8n Form Trigger Node): New node (#7130)

Github issue / Community forum post (link here to close automatically):

based on https://github.com/joffcom/n8n-nodes-form-trigger

---------

Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
This commit is contained in:
Michael Kret
2023-10-17 07:09:30 +03:00
committed by GitHub
parent 869b8f14ca
commit 3ddc176dfa
26 changed files with 1328 additions and 32 deletions

View File

@@ -12,6 +12,7 @@
:label="buttonLabel"
:type="type"
:size="size"
:icon="isFormTriggerNode && 'flask'"
:transparentBackground="transparent"
@click="onClick"
/>
@@ -23,7 +24,12 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { mapStores } from 'pinia';
import { WEBHOOK_NODE_TYPE, MANUAL_TRIGGER_NODE_TYPE, MODAL_CONFIRM } from '@/constants';
import {
WEBHOOK_NODE_TYPE,
MANUAL_TRIGGER_NODE_TYPE,
MODAL_CONFIRM,
FORM_TRIGGER_NODE_TYPE,
} from '@/constants';
import type { INodeUi } from '@/Interface';
import type { INodeTypeDescription } from 'n8n-workflow';
import { workflowRun } from '@/mixins/workflowRun';
@@ -97,6 +103,9 @@ export default defineComponent({
isManualTriggerNode(): boolean {
return Boolean(this.nodeType && this.nodeType.name === MANUAL_TRIGGER_NODE_TYPE);
},
isFormTriggerNode(): boolean {
return Boolean(this.nodeType && this.nodeType.name === FORM_TRIGGER_NODE_TYPE);
},
isPollingTypeNode(): boolean {
return !!this.nodeType?.polling;
},
@@ -168,11 +177,20 @@ export default defineComponent({
return this.$locale.baseText('ndv.execute.listenForTestEvent');
}
if (this.isFormTriggerNode) {
return this.$locale.baseText('ndv.execute.testStep');
}
if (this.isPollingTypeNode || this.nodeType?.mockManualExecution) {
return this.$locale.baseText('ndv.execute.fetchEvent');
}
if (this.isTriggerNode && !this.isScheduleTrigger && !this.isManualTriggerNode) {
if (
this.isTriggerNode &&
!this.isScheduleTrigger &&
!this.isManualTriggerNode &&
!this.isFormTriggerNode
) {
return this.$locale.baseText('ndv.execute.listenForEvent');
}