diff --git a/packages/node_modules/@node-red/editor-client/src/js/nodes.js b/packages/node_modules/@node-red/editor-client/src/js/nodes.js
index b67ae87f7..657dee511 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/nodes.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/nodes.js
@@ -509,6 +509,12 @@ RED.nodes = (function() {
node.icon = n.icon;
}
}
+ if ((!n._def.defaults || !n._def.defaults.hasOwnProperty("l")) && n.hasOwnProperty('l')) {
+ var isLink = /^link (in|out)$/.test(node.type);
+ if (isLink == n.l) {
+ node.l = n.l;
+ }
+ }
}
if (n.info) {
node.info = n.info;
@@ -961,6 +967,9 @@ RED.nodes = (function() {
changed:false,
_config:{}
};
+ if (n.hasOwnProperty('l')) {
+ node.l = n.l;
+ }
if (createNewIds) {
if (subflow_blacklist[n.z]) {
continue;
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js
index 3fc0bfedf..6497a2de5 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/ui/editor.js
@@ -775,41 +775,21 @@ RED.editor = (function() {
function buildAppearanceForm(container,node) {
var dialogForm = $('
').appendTo(container);
- var inputCount = node.inputs || node._def.inputs || 0;
- var outputCount = node.outputs || node._def.outputs || 0;
- if (node.type === 'subflow') {
- inputCount = node.in.length;
- outputCount = node.out.length;
- }
-
- var inputLabels = node.inputLabels || [];
- var outputLabels = node.outputLabels || [];
-
- var inputPlaceholder = node._def.inputLabels?RED._("editor.defaultLabel"):RED._("editor.noDefaultLabel");
- var outputPlaceholder = node._def.outputLabels?RED._("editor.defaultLabel"):RED._("editor.noDefaultLabel");
-
var i,row;
- $('').appendTo(dialogForm);
- var inputsDiv = $("#node-label-form-inputs");
- if (inputCount > 0) {
- for (i=0;i
').appendTo(dialogForm);
- var outputsDiv = $("#node-label-form-outputs");
- if (outputCount > 0) {
- for (i=0;i'+
+ 'Show node label '+
+ ' '+
+ '').appendTo(dialogForm);
+
+ if (!node.hasOwnProperty("l")) {
+ // Show label if type not link
+ node.l = !/^link (in|out)$/.test(node._def.type);
}
+ $("#node-input-show-label").prop("checked",node.l);
+
if ((!node._def.defaults || !node._def.defaults.hasOwnProperty("icon"))) {
- $(' ').appendTo(dialogForm);
var iconRow = $('
').appendTo(dialogForm);
$('').appendTo(iconRow);
@@ -839,6 +819,41 @@ RED.editor = (function() {
})
$('').appendTo(dialogForm);
+ var outputsDiv = $("#node-label-form-outputs");
+ if (outputCount > 0) {
+ for (i=0;i0?7:0))/20)) );
+ if (isLink) {
+ d.w = node_height;
+ } else {
+ d.w = Math.max(node_width,20*(Math.ceil((calculateTextWidth(l, "node_label", 50)+(d._def.inputs>0?7:0))/20)) );
+ }
+ // d.w = Math.max(node_width,20*(Math.ceil((calculateTextWidth(l, "node_label", 50)+(d._def.inputs>0?7:0))/20)) );
d.h = Math.max(node_height,(d.outputs||0) * 15);
d.x += (d.w-ow)/2;
d.resize = false;
@@ -2287,7 +2295,6 @@ RED.view = (function() {
var thisNode = d3.select(this);
//thisNode.selectAll(".centerDot").attr({"cx":function(d) { return d.w/2;},"cy":function(d){return d.h/2}});
thisNode.attr("transform", function(d) { return "translate(" + (d.x-d.w/2) + "," + (d.y-d.h/2) + ")"; });
-
if (mouse_mode != RED.state.MOVING_ACTIVE) {
thisNode.selectAll(".node")
.attr("width",function(d){return d.w})
@@ -2373,8 +2380,7 @@ RED.view = (function() {
}
return "node_label"+
(d._def.align?" node_label_"+d._def.align:"")+s;
- });
-
+ }).classed("hidden",isLink);
if (d._def.icon) {
var icon = thisNode.select(".node_icon");
var faIcon = thisNode.select(".fa-lg");
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js
index 284bd6243..4c5b6c2cb 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js
@@ -56,7 +56,7 @@ RED.workspaces = (function() {
RED.sidebar.config.refresh();
}
- function showRenameWorkspaceDialog(id) {
+ function showEditWorkspaceDialog(id) {
var workspace = RED.nodes.workspace(id);
RED.view.state(RED.state.EDITING);
var tabflowEditor;
@@ -235,7 +235,7 @@ RED.workspaces = (function() {
},
ondblclick: function(tab) {
if (tab.type != "subflow") {
- showRenameWorkspaceDialog(tab.id);
+ showEditWorkspaceDialog(tab.id);
} else {
RED.editor.editSubflow(RED.nodes.subflow(tab.id));
}
@@ -309,7 +309,7 @@ RED.workspaces = (function() {
}
function editWorkspace(id) {
- showRenameWorkspaceDialog(id||activeWorkspace);
+ showEditWorkspaceDialog(id||activeWorkspace);
}
function removeWorkspace(ws) {