diff --git a/packages/node_modules/@node-red/registry/lib/index.js b/packages/node_modules/@node-red/registry/lib/index.js index ebcde8cea..3632f40cf 100644 --- a/packages/node_modules/@node-red/registry/lib/index.js +++ b/packages/node_modules/@node-red/registry/lib/index.js @@ -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. diff --git a/packages/node_modules/@node-red/registry/lib/installer.js b/packages/node_modules/@node-red/registry/lib/installer.js index 9735aa8a1..0c3359382 100644 --- a/packages/node_modules/@node-red/registry/lib/installer.js +++ b/packages/node_modules/@node-red/registry/lib/installer.js @@ -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 } } diff --git a/packages/node_modules/@node-red/runtime/lib/api/settings.js b/packages/node_modules/@node-red/runtime/lib/api/settings.js index b34e9a27c..067a8e83a 100644 --- a/packages/node_modules/@node-red/runtime/lib/api/settings.js +++ b/packages/node_modules/@node-red/runtime/lib/api/settings.js @@ -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; diff --git a/packages/node_modules/@node-red/runtime/lib/nodes/index.js b/packages/node_modules/@node-red/runtime/lib/nodes/index.js index 858274be2..7c6b6085e 100644 --- a/packages/node_modules/@node-red/runtime/lib/nodes/index.js +++ b/packages/node_modules/@node-red/runtime/lib/nodes/index.js @@ -187,7 +187,7 @@ module.exports = { getContext: context.get, - paletteEditorEnabled: registry.paletteEditorEnabled, + installerEnabled: registry.installerEnabled, installModule: installModule, uninstallModule: uninstallModule, diff --git a/test/unit/@node-red/runtime/lib/api/settings_spec.js b/test/unit/@node-red/runtime/lib/api/settings_spec.js index 02bbf48e7..d01235604 100644 --- a/test/unit/@node-red/runtime/lib/api/settings_spec.js +++ b/test/unit/@node-red/runtime/lib/api/settings_spec.js @@ -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() {