कारतोफ्फेलस्क्रिप्ट™
2023-02-08 18:57:43 +01:00
committed by GitHub
parent 1f924e3c3d
commit f23fb92696
6 changed files with 125 additions and 132 deletions

View File

@@ -230,31 +230,29 @@ export const cronNodeOptions: INodePropertyCollection[] = [
},
];
/**
* Gets special parameters which should be added to nodeTypes depending
* on their type or configuration
*
*/
export function getSpecialNodeParameters(nodeType: INodeType): INodeProperties[] {
if (nodeType.description.polling === true) {
return [
{
displayName: 'Poll Times',
name: 'pollTimes',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
multipleValueButtonText: 'Add Poll Time',
},
default: { item: [{ mode: 'everyMinute' }] },
description: 'Time at which polling should occur',
placeholder: 'Add Poll Time',
options: cronNodeOptions,
},
];
}
const specialNodeParameters: INodeProperties[] = [
{
displayName: 'Poll Times',
name: 'pollTimes',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
multipleValueButtonText: 'Add Poll Time',
},
default: { item: [{ mode: 'everyMinute' }] },
description: 'Time at which polling should occur',
placeholder: 'Add Poll Time',
options: cronNodeOptions,
},
];
return [];
/**
* Apply special parameters which should be added to nodeTypes depending on their type or configuration
*/
export function applySpecialNodeParameters(nodeType: INodeType): void {
if (nodeType.description.polling === true) {
nodeType.description.properties.unshift(...specialNodeParameters);
}
}
/**