fix: Fix template credential setup for nodes that dont have credentials (#8208)

Fix template credential setup for templates whose workflow includes
nodes that require credentials but the workflow definition does not have
them defined. Like for example
https://n8n.io/workflows/1344-save-email-attachments-to-nextcloud/
This commit is contained in:
Tomi Turtiainen
2024-01-04 10:21:36 +02:00
committed by GitHub
parent 4186884740
commit cd3f5b5b1f
15 changed files with 5596 additions and 348 deletions

View File

@@ -293,7 +293,7 @@ export function applySpecialNodeParameters(nodeType: INodeType): void {
export function displayParameter(
nodeValues: INodeParameters,
parameter: INodeProperties | INodeCredentialDescription,
node: INode | null, // Allow null as it does also get used by credentials and they do not have versioning yet
node: Pick<INode, 'typeVersion'> | null, // Allow null as it does also get used by credentials and they do not have versioning yet
nodeValuesRoot?: INodeParameters,
) {
if (!parameter.displayOptions) {
@@ -391,7 +391,7 @@ export function displayParameterPath(
nodeValues: INodeParameters,
parameter: INodeProperties | INodeCredentialDescription,
path: string,
node: INode | null,
node: Pick<INode, 'typeVersion'> | null,
) {
let resolvedNodeValues = nodeValues;
if (path !== '') {
@@ -567,7 +567,7 @@ export function getNodeParameters(
nodeValues: INodeParameters | null,
returnDefaults: boolean,
returnNoneDisplayed: boolean,
node: INode | null,
node: Pick<INode, 'typeVersion'> | null,
onlySimpleTypes = false,
dataIsResolved = false,
nodeValuesRoot?: INodeParameters,