1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

List welcome tours in help sidebar under node-red section

This commit is contained in:
Nick O'Leary 2022-06-28 11:54:51 +01:00
parent 42ecf54df6
commit a7e3548f22
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 20 additions and 22 deletions

View File

@ -685,7 +685,8 @@
"showHelp": "Show help", "showHelp": "Show help",
"showInOutline": "Show in outline", "showInOutline": "Show in outline",
"showTopics": "Show topics", "showTopics": "Show topics",
"noHelp": "No help topic selected" "noHelp": "No help topic selected",
"changeLog": "Change Log"
}, },
"config": { "config": {
"name": "Configuration nodes", "name": "Configuration nodes",
@ -1159,7 +1160,7 @@
"takeATour": "Take a tour", "takeATour": "Take a tour",
"start": "Start", "start": "Start",
"next": "Next", "next": "Next",
"tours": "Tours" "welcomeTours": "Welcome Tours"
}, },
"diagnostics": { "diagnostics": {
"title": "System Info" "title": "System Info"

View File

@ -20,10 +20,8 @@ RED.sidebar.help = (function() {
var helpSection; var helpSection;
var panels; var panels;
var panelRatio; var panelRatio;
var helpTopics = [];
var treeList; var treeList;
var tocPanel; var tocPanel;
var helpIndex = {};
function resizeStack() { function resizeStack() {
var h = $(content).parent().height() - toolbar.outerHeight(); var h = $(content).parent().height() - toolbar.outerHeight();
@ -192,7 +190,6 @@ RED.sidebar.help = (function() {
} }
function refreshHelpIndex() { function refreshHelpIndex() {
helpTopics = [];
var modules = RED.nodes.registry.getModuleList(); var modules = RED.nodes.registry.getModuleList();
var moduleNames = Object.keys(modules); var moduleNames = Object.keys(modules);
moduleNames.sort(); moduleNames.sort();
@ -204,23 +201,28 @@ RED.sidebar.help = (function() {
}; };
var tours = RED.tourGuide.list().map(function (item) { var tours = RED.tourGuide.list().map(function (item) {
return { return {
icon: "fa fa-repeat", icon: "fa fa-play-circle-o",
label: item.label, label: item.label,
tour: item.path, tour: item.path,
}; };
}); });
var helpData = [ var helpData = [
{
label: "Node-RED",
children: [
{ {
id: 'changelog', id: 'changelog',
label: "Node-RED v"+RED.settings.version, label: RED._("sidebar.help.changeLog"),
content: getChangelog content: getChangelog
}, },
nodeHelp,
{ {
id: "tours", label: RED._("tourGuide.welcomeTours"),
label: RED._("tourGuide.tours"),
children: tours children: tours
}
]
}, },
nodeHelp
]; ];
var subflows = RED.nodes.registry.getNodeTypes().filter(function(t) {return /subflow/.test(t)}); var subflows = RED.nodes.registry.getNodeTypes().filter(function(t) {return /subflow/.test(t)});
if (subflows.length > 0) { if (subflows.length > 0) {

View File

@ -437,7 +437,7 @@ RED.tourGuide = (function() {
return [ return [
{ {
id: "2_3", id: "2_3",
label: "3.0.0-beta.3 (latest)", label: "3.0.0-beta.3",
path: "./tours/welcome.js" path: "./tours/welcome.js"
}, },
{ {
@ -449,12 +449,7 @@ RED.tourGuide = (function() {
id: "2_1", id: "2_1",
label: "2.1.0", label: "2.1.0",
path: "./tours/2.1/welcome.js" path: "./tours/2.1/welcome.js"
}, }
{
id: "first_flow",
label: "First flow",
path: "./tours/first-flow.js"
},
]; ];
} }