Implement dropdown

This commit is contained in:
Charlie Kolb 2024-11-26 15:59:48 +01:00
parent 7012d9bb9c
commit 90fa0b45ec
No known key found for this signature in database
2 changed files with 24 additions and 4 deletions

View file

@ -22,10 +22,9 @@ export class ExecuteWorkflowTrigger implements INodeType {
eventTriggerDescription: '',
maxNodes: 1,
defaults: {
name: 'Execute Workflow Trigger',
name: 'Workflow Input Trigger',
color: '#ff6d5a',
},
inputs: [],
outputs: [NodeConnectionType.Main],
properties: [
@ -51,6 +50,26 @@ export class ExecuteWorkflowTrigger implements INodeType {
],
default: 'worklfow_call',
},
{
displayName: 'Input Source',
name: 'inputSource',
type: 'options',
options: [
{
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
name: 'Using fields below',
value: 'fields',
description: 'Provide via UI',
},
{
// eslint-disable-next-line n8n-nodes-base/node-param-display-name-miscased
name: 'Using JSON',
value: 'json',
description: 'Provide via JSON schema',
},
],
default: 'fields',
},
{
displayName: 'Workflow Inputs',
name: WORKFLOW_INPUTS,
@ -63,7 +82,7 @@ export class ExecuteWorkflowTrigger implements INodeType {
sortable: true,
},
displayOptions: {
show: { '@version': [{ _cnd: { gte: 1.1 } }] },
show: { '@version': [{ _cnd: { gte: 1.1 } }], inputSource: ['fields'] },
},
default: {},
options: [
@ -78,6 +97,7 @@ export class ExecuteWorkflowTrigger implements INodeType {
default: '',
placeholder: 'e.g. fieldName',
description: 'Name of the field',
noDataExpression: true,
},
// {
// displayName: 'Type',

View file

@ -4,7 +4,7 @@ import type { IExecuteFunctions, INode, INodeExecutionData } from 'n8n-workflow'
import { ExecuteWorkflowTrigger } from '../ExecuteWorkflowTrigger.node';
describe('ExecuteWorkflowTrigger', () => {
it('should return its input data', async () => {
it('should return its input data on V1', async () => {
const mockInputData: INodeExecutionData[] = [
{ json: { item: 0, foo: 'bar' } },
{ json: { item: 1, foo: 'quz' } },