Rename paletteEditorEnabled to installerEnabled

This commit is contained in:
Nick O'Leary 2020-12-02 13:14:39 +00:00
parent 6fb96fa3c1
commit fca21ac126
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
5 changed files with 17 additions and 17 deletions

View File

@ -271,7 +271,7 @@ module.exports = {
* @function
* @memberof @node-red/registry
*/
paletteEditorEnabled: installer.paletteEditorEnabled,
installerEnabled: installer.installerEnabled,
/**
* Get a list of all example flows provided by nodes in the registry.

View File

@ -25,7 +25,7 @@ var library = require("./library");
const {exec,log,events} = require("@node-red/util");
var child_process = require('child_process');
var npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
var paletteEditorEnabled = false;
var installerEnabled = false;
var settings;
const moduleRe = /^(@[^/@]+?[/])?[^/@]+?$/;
@ -342,20 +342,20 @@ function checkPrereq() {
settings.editorTheme.palette.editable === false
) {
log.info(log._("server.palette-editor.disabled"));
paletteEditorEnabled = false;
installerEnabled = false;
return Promise.resolve();
} else {
return new Promise(resolve => {
child_process.execFile(npmCommand,['-v'],function(err,stdout) {
if (err) {
log.info(log._("server.palette-editor.npm-not-found"));
paletteEditorEnabled = false;
installerEnabled = false;
} else {
if (parseInt(stdout.split(".")[0]) < 3) {
log.info(log._("server.palette-editor.npm-too-old"));
paletteEditorEnabled = false;
installerEnabled = false;
} else {
paletteEditorEnabled = true;
installerEnabled = true;
}
}
resolve();
@ -369,7 +369,7 @@ module.exports = {
checkPrereq: checkPrereq,
installModule: installModule,
uninstallModule: uninstallModule,
paletteEditorEnabled: function() {
return paletteEditorEnabled
installerEnabled: function() {
return installerEnabled
}
}

View File

@ -90,7 +90,7 @@ var api = module.exports = {
safeSettings.flowFilePretty = runtime.settings.flowFilePretty;
}
if (!runtime.nodes.paletteEditorEnabled()) {
if (!runtime.nodes.installerEnabled()) {
safeSettings.editorTheme = safeSettings.editorTheme || {};
safeSettings.editorTheme.palette = safeSettings.editorTheme.palette || {};
safeSettings.editorTheme.palette.editable = false;

View File

@ -187,7 +187,7 @@ module.exports = {
getContext: context.get,
paletteEditorEnabled: registry.paletteEditorEnabled,
installerEnabled: registry.installerEnabled,
installModule: installModule,
uninstallModule: uninstallModule,

View File

@ -48,7 +48,7 @@ describe("runtime-api/settings", function() {
},
nodes: {
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
paletteEditorEnabled: () => false,
installerEnabled: () => false,
getCredentialKeyType: () => "test-key-type"
},
storage: {}
@ -79,7 +79,7 @@ describe("runtime-api/settings", function() {
},
nodes: {
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
paletteEditorEnabled: () => false,
installerEnabled: () => false,
getCredentialKeyType: () => "test-key-type"
},
storage: {}
@ -115,7 +115,7 @@ describe("runtime-api/settings", function() {
},
nodes: {
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
paletteEditorEnabled: () => false,
installerEnabled: () => false,
getCredentialKeyType: () => "test-key-type"
},
storage: {
@ -166,7 +166,7 @@ describe("runtime-api/settings", function() {
},
nodes: {
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
paletteEditorEnabled: () => false,
installerEnabled: () => false,
getCredentialKeyType: () => "test-key-type"
},
storage: {
@ -207,7 +207,7 @@ describe("runtime-api/settings", function() {
},
nodes: {
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
paletteEditorEnabled: () => false,
installerEnabled: () => false,
getCredentialKeyType: () => "test-key-type"
},
storage: {
@ -252,7 +252,7 @@ describe("runtime-api/settings", function() {
},
nodes: {
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
paletteEditorEnabled: () => false,
installerEnabled: () => false,
getCredentialKeyType: () => "test-key-type"
},
storage: {
@ -632,7 +632,7 @@ describe("api/editor/sshkeys", function() {
},
events:{on:function(){},removeListener:function(){}},
isStarted: function() { return isStarted; },
nodes: {paletteEditorEnabled: function() { return false }}
nodes: {installerEnabled: function() { return false }}
};
before(function() {