From 514da8396185d14b608efaeed64c20a494cbb517 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 28 Jan 2022 18:05:20 +0000 Subject: [PATCH 01/63] let inject optionally fire at start in only at time mode. --- .../@node-red/nodes/core/common/20-inject.html | 7 ------- 1 file changed, 7 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.html b/packages/node_modules/@node-red/nodes/core/common/20-inject.html index f233c62fd..6d338df00 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.html +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.html @@ -370,13 +370,6 @@ var id = $("#inject-time-type-select").val(); $(".inject-time-row").hide(); $("#inject-time-row-"+id).show(); - if ((id == "none") || (id == "interval") || (id == "interval-time")) { - $("#node-once").show(); - } - else { - $("#node-once").hide(); - $("#node-input-once").prop('checked', false); - } // Scroll down var scrollDiv = $("#dialog-form").parent(); From a508177e212d86183643349709e8d909da84d0f7 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 31 Jan 2022 20:35:42 +0000 Subject: [PATCH 02/63] Add copy-value button to entries in Node Props table of info sidebar --- .../editor-client/src/js/ui/tab-info.js | 7 +++++-- .../editor-client/src/js/ui/utils.js | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js index 017172a23..9236e55b2 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info.js @@ -163,6 +163,7 @@ RED.sidebar.info = (function() { }); return el; } + function refresh(node) { if (node === undefined) { refreshSelection(); @@ -271,7 +272,7 @@ RED.sidebar.info = (function() { objectType = "group"; } $(propRow.children()[0]).text(RED._("sidebar.info."+objectType)) - RED.utils.createObjectElement(node.id).appendTo(propRow.children()[1]); + RED.utils.createObjectElement(node.id,{sourceId: node.id}).appendTo(propRow.children()[1]); if (node.type === "tab" || node.type === "subflow") { // If nothing is selected, but we're on a flow or subflow tab. @@ -365,7 +366,7 @@ RED.sidebar.info = (function() { } } else { - RED.utils.createObjectElement(val).appendTo(propRow.children()[1]); + RED.utils.createObjectElement(val,{sourceId: node.id}).appendTo(propRow.children()[1]); } } } @@ -431,6 +432,7 @@ RED.sidebar.info = (function() { } + function setInfoText(infoText,target) { var info = addTargetToExternalLinks($('
'+infoText+'
')).appendTo(target); info.find(".red-ui-text-bidi-aware").contents().filter(function() { return this.nodeType === 3 && this.textContent.trim() !== "" }).wrap( "" ); @@ -447,6 +449,7 @@ RED.sidebar.info = (function() { $(this).toggleClass('expanded',!isExpanded); }) } + var tips = (function() { var enabled = true; var startDelay = 1000; diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js index 33f6c3ea1..183c807b8 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js @@ -365,7 +365,16 @@ RED.utils = (function() { } } - function buildMessageElement(obj,options) { + /** + * Create a DOM element representation of obj - as used by Debug sidebar etc + * + * @params obj - the data to display + * @params options - a bag of options + * + * - If you want the Copy Value button, then set `sourceId` + * - If you want the Copy Path button, also set `path` to the value to be copied + */ + function createObjectElement(obj,options) { options = options || {}; var key = options.key; var typeHint = options.typeHint; @@ -555,7 +564,7 @@ RED.utils = (function() { if (fullLength <= 10) { for (i=0;i