From ee2b151b7a0712cc8b551f39c2c160d806f5de25 Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Thu, 23 Jun 2022 16:52:43 +0900 Subject: [PATCH 1/3] fix credential type input item of subflow template --- .../@node-red/editor-client/src/js/ui/editors/envVarList.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js index c1e1a0217..41a528e21 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js @@ -94,6 +94,11 @@ RED.editor.envVarList = (function() { } opt.ui.label = opt.ui.label || {}; opt.ui.type = opt.ui.type || "input"; + if ((opt.ui.type === "cred") && + opt.ui.opts && + opt.ui.opts.types) { + opt.ui.type = "input"; + } var uiRow = $('
').appendTo(container).hide(); // save current info for reverting on cancel From 18c0ec990a6f01679c92d8ace532b31fb8a913cd Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Tue, 28 Jun 2022 09:16:30 +0900 Subject: [PATCH 2/3] fix type selector of subflow environment variable --- .../editor-client/src/js/ui/editors/envVarList.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js index 41a528e21..1094cc464 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js @@ -41,8 +41,14 @@ RED.editor.envVarList = (function() { style: "width:100%", class: "node-input-env-value", type: "text", - }).attr("autocomplete","disable").appendTo(envRow) - valueField.typedInput({default:'str',types:isTemplateNode?DEFAULT_ENV_TYPE_LIST:DEFAULT_ENV_TYPE_LIST_INC_CRED}); + }).attr("autocomplete","disable").appendTo(envRow); + var types = (opt.ui && opt.ui.opts && opt.ui.opts.types); + if (!types) { + types = isTemplateNode + ? DEFAULT_ENV_TYPE_LIST + : DEFAULT_ENV_TYPE_LIST_INC_CRED; + } + valueField.typedInput({default:'str',types:types}); valueField.typedInput('type', opt.type); if (opt.type === "cred") { if (opt.value) { From 29287149b464bf34f601d77434e19552ab0dbd31 Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Tue, 28 Jun 2022 20:35:39 +0900 Subject: [PATCH 3/3] remove line break to prevent jshint error --- .../@node-red/editor-client/src/js/ui/editors/envVarList.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js index 1094cc464..209e953e0 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editors/envVarList.js @@ -44,9 +44,7 @@ RED.editor.envVarList = (function() { }).attr("autocomplete","disable").appendTo(envRow); var types = (opt.ui && opt.ui.opts && opt.ui.opts.types); if (!types) { - types = isTemplateNode - ? DEFAULT_ENV_TYPE_LIST - : DEFAULT_ENV_TYPE_LIST_INC_CRED; + types = isTemplateNode ? DEFAULT_ENV_TYPE_LIST : DEFAULT_ENV_TYPE_LIST_INC_CRED; } valueField.typedInput({default:'str',types:types}); valueField.typedInput('type', opt.type);