mirror of
https://github.com/node-red/node-red
synced 2024-11-22 16:33:24 +00:00
Rename paletteEditorEnabled to installerEnabled
This commit is contained in:
parent
6fb96fa3c1
commit
fca21ac126
@ -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.
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -187,7 +187,7 @@ module.exports = {
|
||||
getContext: context.get,
|
||||
|
||||
|
||||
paletteEditorEnabled: registry.paletteEditorEnabled,
|
||||
installerEnabled: registry.installerEnabled,
|
||||
installModule: installModule,
|
||||
uninstallModule: uninstallModule,
|
||||
|
||||
|
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user