Allow Node-RED section of help sidebar to be hidden

Fixes #5578
pull/5581/head
Nick O'Leary 2026-03-23 14:04:56 +00:00
parent 2aa1887af6
commit 4cc390ea36
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 20 additions and 9 deletions

View File

@ -192,6 +192,10 @@ async function loadThemePlugin () {
themeSettings.menu = Object.assign({}, themeSettings.menu, themePlugin.menu);
}
if (themePlugin.help) {
themeSettings.help = themePlugin.help;
}
if (Array.isArray(themePlugin.palette?.theme)) {
themeSettings.palette = themeSettings.palette || {};
themeSettings.palette.theme = themePlugin.palette.theme;
@ -389,6 +393,10 @@ module.exports = {
themeSettings.tours = theme.tours;
}
if (theme.hasOwnProperty("help")) {
themeSettings.tours = theme.help;
}
return themeApp;
},
context: async function() {

View File

@ -199,24 +199,25 @@ RED.sidebar.help = (function() {
}
function refreshHelpIndex() {
var modules = RED.nodes.registry.getModuleList();
var moduleNames = Object.keys(modules);
const modules = RED.nodes.registry.getModuleList();
const moduleNames = Object.keys(modules);
moduleNames.sort();
var nodeHelp = {
const nodeHelp = {
label: RED._("sidebar.help.nodeHelp"),
children: [],
expanded: true
};
var tours = RED.tourGuide.list().map(function (item) {
const tours = RED.tourGuide.list().map(function (item) {
return {
icon: "fa fa-play-circle-o",
label: item.label,
tour: item.path,
};
});
var helpData = [
{
const helpData = []
if (RED.settings.theme("help.node-red") !== false) {
helpData.push({
label: "Node-RED",
children: [
{
@ -230,9 +231,11 @@ RED.sidebar.help = (function() {
}
]
},
nodeHelp
];
})
}
helpData.push(nodeHelp)
var subflows = RED.nodes.registry.getNodeTypes().filter(function(t) {return /subflow/.test(t)});
if (subflows.length > 0) {
nodeHelp.children.push({