mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
✨ Add possibility to define custom node-subtitle for nodes in
UI
This commit is contained in:
@@ -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[];
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user