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

Flip logic for opt-in to projects

This commit is contained in:
Nick O'Leary 2018-01-22 23:14:38 +00:00
parent dfebc4b78d
commit cf40497e6e
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 10 additions and 6 deletions

View File

@ -145,6 +145,7 @@
"active-project": "Active project : __project__",
"no-active-project": "No active project : using default flows file",
"disabled": "Projects disabled : editorTheme.projects.enabled=false",
"disabledNoFlag": "Projects disabled : set editorTheme.projects.enabled=true to enable",
"git-not-found": "Projects disabled : git command not found",
"git-version-old": "Projects disabled : git __version__ too old"
}

View File

@ -55,9 +55,9 @@ var storageModuleInterface = {
return when.reject(e);
}
if (!!storageModule.projects) {
var projectsEnabled = true;
var projectsEnabled = false;
if (runtime.settings.hasOwnProperty("editorTheme") && runtime.settings.editorTheme.hasOwnProperty("projects")) {
projectsEnabled = runtime.settings.editorTheme.projects.enabled !== false;
projectsEnabled = runtime.settings.editorTheme.projects.enabled === true;
}
if (projectsEnabled) {
storageModuleInterface.projects = storageModule.projects;

View File

@ -31,7 +31,7 @@ var settings;
var runtime;
var log;
var projectsEnabled = true;
var projectsEnabled = false;
var projectLogMessages = [];
var projectsDir;
@ -43,12 +43,15 @@ function init(_settings, _runtime) {
log = runtime.log;
try {
if (settings.editorTheme.projects.enabled === false) {
if (settings.editorTheme.projects.enabled === true) {
projectLogMessages.push(log._("storage.localfilesystem.projects.disabled"))
projectsEnabled = true;
} else if (settings.editorTheme.projects.enabled === false) {
projectLogMessages.push(log._("storage.localfilesystem.projects.disabled"))
projectsEnabled = false;
}
} catch(err) {
projectsEnabled = true;
projectLogMessages.push(log._("storage.localfilesystem.projects.disabledNoFlag"))
projectsEnabled = false;
}
if (settings.flowFile) {