From aed2b8e46db45ae897f65cfa6c6b0702b558f224 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 11 Jul 2022 20:19:48 +0100 Subject: [PATCH 1/2] Fix storing subflow credential type when input has multiple types Fixes #3749 --- .../@node-red/editor-client/src/js/ui/subflow.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js b/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js index 58fca2cb4..467c8dafb 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js @@ -923,6 +923,7 @@ RED.subflow = (function() { function buildEnvUIRow(row, tenv, ui, node) { + console.log(tenv, ui) ui.label = ui.label||{}; if ((tenv.type === "cred" || (tenv.parent && tenv.parent.type === "cred")) && !ui.type) { ui.type = "cred"; @@ -983,6 +984,17 @@ RED.subflow = (function() { default: inputType }) input.typedInput('value',val.value) + if (inputType === 'cred') { + if (node.credentials) { + if (node.credentials[tenv.name]) { + input.typedInput('value', node.credentials[tenv.name]); + } else if (node.credentials['has_'+tenv.name]) { + input.typedInput('value', "__PWRD__") + } else { + input.typedInput('value', ""); + } + } + } } else { input.val(val.value) } From 455f2dc800cee57041e4f64b288f7c609e398a44 Mon Sep 17 00:00:00 2001 From: Stephen McLaughlin <44235289+Steve-Mcl@users.noreply.github.com> Date: Thu, 4 Aug 2022 12:35:34 +0100 Subject: [PATCH 2/2] delete console.log artefact --- .../node_modules/@node-red/editor-client/src/js/ui/subflow.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js b/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js index 467c8dafb..552464a47 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/subflow.js @@ -923,7 +923,6 @@ RED.subflow = (function() { function buildEnvUIRow(row, tenv, ui, node) { - console.log(tenv, ui) ui.label = ui.label||{}; if ((tenv.type === "cred" || (tenv.parent && tenv.parent.type === "cred")) && !ui.type) { ui.type = "cred";