Add possibility to define custom node-subtitle for nodes in

UI
This commit is contained in:
Jan Oberhauser
2019-07-12 14:14:36 +02:00
parent 1e0d2cbf1e
commit be9c5622ac
7 changed files with 28 additions and 22 deletions

View File

@@ -401,6 +401,7 @@ export interface INodeTypeDescription {
properties: INodeProperties[];
credentials?: INodeCredentialDescription[];
maxNodes?: number; // How many nodes of that type can be created in a workflow
subtitle?: string;
hooks?: {
[key: string]: INodeHookDescription[] | undefined;
activate?: INodeHookDescription[];

View File

@@ -370,7 +370,7 @@ export function getNodeWebhooks(workflow: Workflow, node: INode, additionalData:
const returnData: IWebhookData[] = [];
for (const webhookDescription of nodeType.description.webhooks) {
let nodeWebhookPath = workflow.getWebhookParameterValue(node, webhookDescription, 'path', 'GET');
let nodeWebhookPath = workflow.getSimpleParameterValue(node, webhookDescription['path'], 'GET');
if (nodeWebhookPath === undefined) {
// TODO: Use a proper logger
console.error(`No webhook path could be found for node "${node.name}" in workflow "${workflow.id}".`);
@@ -383,7 +383,7 @@ export function getNodeWebhooks(workflow: Workflow, node: INode, additionalData:
const path = getNodeWebhookPath(workflow.id, node, nodeWebhookPath);
const httpMethod = workflow.getWebhookParameterValue(node, webhookDescription, 'httpMethod', 'GET');
const httpMethod = workflow.getSimpleParameterValue(node, webhookDescription['httpMethod'], 'GET');
if (httpMethod === undefined) {
// TODO: Use a proper logger

View File

@@ -16,7 +16,6 @@ import {
ITaskDataConnections,
ITriggerResponse,
IWebhookData,
IWebhookDescription,
IWebhookResonseData,
WebhookSetupMethodNames,
WorkflowDataProxy,
@@ -648,18 +647,15 @@ export class Workflow {
/**
* Resolves parameter value of parameter in webhook description
* Resolves value of parameter. But does not work for workflow-data.
*
* @export
* @param {INode} node
* @param {IWebhookDescription} webhookDescription
* @param {string} parameterName
* @param {(string | undefined)} parameterValue
* @param {string} [defaultValue]
* @returns {(string | undefined)}
* @memberof Workflow
*/
getWebhookParameterValue(node: INode, webhookDescription: IWebhookDescription, parameterName: string, defaultValue?: string): string | undefined {
const parameterValue: string | undefined = webhookDescription[parameterName];
getSimpleParameterValue(node: INode, parameterValue: string | undefined, defaultValue?: string): string | undefined {
if (parameterValue === undefined) {
// Value is not set so return the default
return defaultValue;