diff --git a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
index e525c2c8e..cac66dd7a 100755
--- a/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
+++ b/packages/node_modules/@node-red/editor-client/locales/en-US/editor.json
@@ -59,6 +59,8 @@
"hideOtherFlows": "Hide other flows",
"showAllFlows": "Show all flows",
"hideAllFlows": "Hide all flows",
+ "hiddenFlows": "List __count__ hidden flow",
+ "hiddenFlows_plural": "List __count__ hidden flows",
"showLastHiddenFlow": "Show last hidden flow",
"listFlows": "List flows",
"listSubflows": "List subflows",
@@ -669,7 +671,8 @@
"unusedConfigNodes": "Unused configuration nodes",
"invalidNodes": "Invalid nodes",
"uknownNodes": "Unknown nodes",
- "unusedSubflows": "Unused subflows"
+ "unusedSubflows": "Unused subflows",
+ "hiddenFlows": "Hidden flows"
}
},
"help": {
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js
index f3327c2e6..d1e6a39d2 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/tabs.js
@@ -117,6 +117,8 @@ RED.tabs = (function() {
menuOptions = options.menu()
} else if (Array.isArray(options.menu)) {
menuOptions = options.menu;
+ } else if (typeof options.menu === 'function') {
+ menuOptions = options.menu();
}
menu = RED.menu.init({options: menuOptions});
menu.attr("id",options.id+"-menu");
@@ -809,15 +811,18 @@ RED.tabs = (function() {
event.preventDefault();
removeTab(tab.id);
});
+ RED.popover.tooltip(closeLink,RED._("workspace.hideFlow"));
}
if (tab.hideable) {
li.addClass("red-ui-tabs-closeable")
- var closeLink = $("",{href:"#",class:"red-ui-tab-close"}).appendTo(li);
- closeLink.append('');
+ var closeLink = $("",{href:"#",class:"red-ui-tab-close red-ui-tab-hide"}).appendTo(li);
+ closeLink.append('');
+ closeLink.append('');
closeLink.on("click",function(event) {
event.preventDefault();
hideTab(tab.id);
});
+ RED.popover.tooltip(closeLink,RED._("workspace.hideFlow"));
}
var badges = $('').appendTo(li);
@@ -826,7 +831,8 @@ RED.tabs = (function() {
$('').appendTo(badges);
}
- link.attr("title",tab.label);
+ // link.attr("title",tab.label);
+ RED.popover.tooltip(link,function() { return tab.label})
if (options.onadd) {
options.onadd(tab);
@@ -945,7 +951,6 @@ RED.tabs = (function() {
renameTab: function(id,label) {
tabs[id].label = label;
var tab = ul.find("a[href='#"+id+"']");
- tab.attr("title",label);
tab.find("span.red-ui-text-bidi-aware").text(label).attr('dir', RED.text.bidi.resolveBaseTextDir(label));
updateTabWidths();
},
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/search.js b/packages/node_modules/@node-red/editor-client/src/js/ui/search.js
index 02c7735a7..045588310 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/ui/search.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/ui/search.js
@@ -105,6 +105,7 @@ RED.search = (function() {
val = extractFlag(val,"unused",flags);
val = extractFlag(val,"config",flags);
val = extractFlag(val,"subflow",flags);
+ val = extractFlag(val,"hidden",flags);
// uses:
val = extractValue(val,"uses",flags);
@@ -150,7 +151,15 @@ RED.search = (function() {
continue;
}
}
-
+ if (flags.hasOwnProperty("hidden")) {
+ // Only tabs can be hidden
+ if (node.node.type !== 'tab') {
+ continue
+ }
+ if (!RED.workspaces.isHidden(node.node.id)) {
+ continue
+ }
+ }
if (flags.hasOwnProperty("unused")) {
var isUnused = (node.node.type === 'subflow' && node.node.instances.length === 0) ||
(isConfigNode && node.node.users.length === 0)
diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js
index 35267331c..fb393156e 100644
--- a/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js
+++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tab-info-outliner.js
@@ -274,6 +274,7 @@ RED.sidebar.info.outliner = (function() {
{label:RED._("sidebar.info.search.invalidNodes"), value: "is:invalid"},
{label:RED._("sidebar.info.search.uknownNodes"), value: "type:unknown"},
{label:RED._("sidebar.info.search.unusedSubflows"), value:"is:subflow is:unused"},
+ {label:RED._("sidebar.info.search.hiddenFlows"), value:"is:hidden"},
]
});
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 e76b60004..0082b7aed 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
@@ -218,55 +218,64 @@ RED.workspaces = (function() {
scrollable: true,
addButton: "core:add-flow",
addButtonCaption: RED._("workspace.addFlow"),
- menu: [
- {
- id:"red-ui-tabs-menu-option-search-flows",
- label: RED._("workspace.listFlows"),
- onselect: "core:list-flows"
- },
- {
- id:"red-ui-tabs-menu-option-search-subflows",
- label: RED._("workspace.listSubflows"),
- onselect: "core:list-subflows"
- },
- null,
- {
- id:"red-ui-tabs-menu-option-add-flow",
- label: RED._("workspace.addFlow"),
- onselect: "core:add-flow"
- },
- {
- id:"red-ui-tabs-menu-option-add-flow-right",
- label: RED._("workspace.addFlowToRight"),
- onselect: "core:add-flow-to-right"
- },
- null,
- {
- id:"red-ui-tabs-menu-option-add-hide-flows",
- label: RED._("workspace.hideFlow"),
- onselect: "core:hide-flow"
- },
- {
- id:"red-ui-tabs-menu-option-add-hide-other-flows",
- label: RED._("workspace.hideOtherFlows"),
- onselect: "core:hide-other-flows"
- },
- {
- id:"red-ui-tabs-menu-option-add-show-all-flows",
- label: RED._("workspace.showAllFlows"),
- onselect: "core:show-all-flows"
- },
- {
- id:"red-ui-tabs-menu-option-add-hide-all-flows",
- label: RED._("workspace.hideAllFlows"),
- onselect: "core:hide-all-flows"
- },
- {
- id:"red-ui-tabs-menu-option-add-show-last-flow",
- label: RED._("workspace.showLastHiddenFlow"),
- onselect: "core:show-last-hidden-flow"
+ menu: function() {
+ var menuItems = [
+ {
+ id:"red-ui-tabs-menu-option-search-flows",
+ label: RED._("workspace.listFlows"),
+ onselect: "core:list-flows"
+ },
+ {
+ id:"red-ui-tabs-menu-option-search-subflows",
+ label: RED._("workspace.listSubflows"),
+ onselect: "core:list-subflows"
+ },
+ null,
+ {
+ id:"red-ui-tabs-menu-option-add-flow",
+ label: RED._("workspace.addFlow"),
+ onselect: "core:add-flow"
+ },
+ {
+ id:"red-ui-tabs-menu-option-add-flow-right",
+ label: RED._("workspace.addFlowToRight"),
+ onselect: "core:add-flow-to-right"
+ },
+ null,
+ {
+ id:"red-ui-tabs-menu-option-add-hide-flows",
+ label: RED._("workspace.hideFlow"),
+ onselect: "core:hide-flow"
+ },
+ {
+ id:"red-ui-tabs-menu-option-add-hide-other-flows",
+ label: RED._("workspace.hideOtherFlows"),
+ onselect: "core:hide-other-flows"
+ },
+ {
+ id:"red-ui-tabs-menu-option-add-show-all-flows",
+ label: RED._("workspace.showAllFlows"),
+ onselect: "core:show-all-flows"
+ },
+ {
+ id:"red-ui-tabs-menu-option-add-hide-all-flows",
+ label: RED._("workspace.hideAllFlows"),
+ onselect: "core:hide-all-flows"
+ },
+ {
+ id:"red-ui-tabs-menu-option-add-show-last-flow",
+ label: RED._("workspace.showLastHiddenFlow"),
+ onselect: "core:show-last-hidden-flow"
+ }
+ ]
+ if (hideStack.length > 0) {
+ menuItems.unshift({
+ label: RED._("workspace.hiddenFlows",{count: hideStack.length}),
+ onselect: "core:list-hidden-flows"
+ })
}
- ]
+ return menuItems;
+ }
});
workspaceTabCount = 0;
}
@@ -406,7 +415,9 @@ RED.workspaces = (function() {
}
}
})
-
+ RED.actions.add("core:list-hidden-flows",function() {
+ RED.actions.invoke("core:search","is:hidden ");
+ })
RED.actions.add("core:list-flows",function() {
RED.actions.invoke("core:search","type:tab ");
})
@@ -536,6 +547,9 @@ RED.workspaces = (function() {
RED.settings.setLocal("hiddenTabs",JSON.stringify(hiddenTabs));
}
},
+ isHidden: function(id) {
+ return hideStack.includes(id)
+ },
show: function(id,skipStack,unhideOnly) {
if (!workspace_tabs.contains(id)) {
var sf = RED.nodes.subflow(id);
diff --git a/packages/node_modules/@node-red/editor-client/src/sass/tabs.scss b/packages/node_modules/@node-red/editor-client/src/sass/tabs.scss
index e83996a5e..b05a3575f 100644
--- a/packages/node_modules/@node-red/editor-client/src/sass/tabs.scss
+++ b/packages/node_modules/@node-red/editor-client/src/sass/tabs.scss
@@ -389,7 +389,19 @@ i.red-ui-tab-icon {
vertical-align: top;
}
-
+.red-ui-tab-hide {
+ .fa-eye-slash {
+ display: none;
+ }
+ &:hover {
+ .fa-eye-slash {
+ display: inline
+ }
+ .fa-eye {
+ display: none
+ }
+ }
+}
.red-ui-tab-close {
display: none;
background: $tab-background-inactive;