mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Rename paletteEditorEnabled to installerEnabled
This commit is contained in:
parent
6fb96fa3c1
commit
fca21ac126
@ -271,7 +271,7 @@ module.exports = {
|
|||||||
* @function
|
* @function
|
||||||
* @memberof @node-red/registry
|
* @memberof @node-red/registry
|
||||||
*/
|
*/
|
||||||
paletteEditorEnabled: installer.paletteEditorEnabled,
|
installerEnabled: installer.installerEnabled,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of all example flows provided by nodes in the registry.
|
* 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");
|
const {exec,log,events} = require("@node-red/util");
|
||||||
var child_process = require('child_process');
|
var child_process = require('child_process');
|
||||||
var npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
var npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm';
|
||||||
var paletteEditorEnabled = false;
|
var installerEnabled = false;
|
||||||
|
|
||||||
var settings;
|
var settings;
|
||||||
const moduleRe = /^(@[^/@]+?[/])?[^/@]+?$/;
|
const moduleRe = /^(@[^/@]+?[/])?[^/@]+?$/;
|
||||||
@ -342,20 +342,20 @@ function checkPrereq() {
|
|||||||
settings.editorTheme.palette.editable === false
|
settings.editorTheme.palette.editable === false
|
||||||
) {
|
) {
|
||||||
log.info(log._("server.palette-editor.disabled"));
|
log.info(log._("server.palette-editor.disabled"));
|
||||||
paletteEditorEnabled = false;
|
installerEnabled = false;
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
} else {
|
} else {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
child_process.execFile(npmCommand,['-v'],function(err,stdout) {
|
child_process.execFile(npmCommand,['-v'],function(err,stdout) {
|
||||||
if (err) {
|
if (err) {
|
||||||
log.info(log._("server.palette-editor.npm-not-found"));
|
log.info(log._("server.palette-editor.npm-not-found"));
|
||||||
paletteEditorEnabled = false;
|
installerEnabled = false;
|
||||||
} else {
|
} else {
|
||||||
if (parseInt(stdout.split(".")[0]) < 3) {
|
if (parseInt(stdout.split(".")[0]) < 3) {
|
||||||
log.info(log._("server.palette-editor.npm-too-old"));
|
log.info(log._("server.palette-editor.npm-too-old"));
|
||||||
paletteEditorEnabled = false;
|
installerEnabled = false;
|
||||||
} else {
|
} else {
|
||||||
paletteEditorEnabled = true;
|
installerEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resolve();
|
resolve();
|
||||||
@ -369,7 +369,7 @@ module.exports = {
|
|||||||
checkPrereq: checkPrereq,
|
checkPrereq: checkPrereq,
|
||||||
installModule: installModule,
|
installModule: installModule,
|
||||||
uninstallModule: uninstallModule,
|
uninstallModule: uninstallModule,
|
||||||
paletteEditorEnabled: function() {
|
installerEnabled: function() {
|
||||||
return paletteEditorEnabled
|
return installerEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ var api = module.exports = {
|
|||||||
safeSettings.flowFilePretty = runtime.settings.flowFilePretty;
|
safeSettings.flowFilePretty = runtime.settings.flowFilePretty;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!runtime.nodes.paletteEditorEnabled()) {
|
if (!runtime.nodes.installerEnabled()) {
|
||||||
safeSettings.editorTheme = safeSettings.editorTheme || {};
|
safeSettings.editorTheme = safeSettings.editorTheme || {};
|
||||||
safeSettings.editorTheme.palette = safeSettings.editorTheme.palette || {};
|
safeSettings.editorTheme.palette = safeSettings.editorTheme.palette || {};
|
||||||
safeSettings.editorTheme.palette.editable = false;
|
safeSettings.editorTheme.palette.editable = false;
|
||||||
|
@ -187,7 +187,7 @@ module.exports = {
|
|||||||
getContext: context.get,
|
getContext: context.get,
|
||||||
|
|
||||||
|
|
||||||
paletteEditorEnabled: registry.paletteEditorEnabled,
|
installerEnabled: registry.installerEnabled,
|
||||||
installModule: installModule,
|
installModule: installModule,
|
||||||
uninstallModule: uninstallModule,
|
uninstallModule: uninstallModule,
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ describe("runtime-api/settings", function() {
|
|||||||
},
|
},
|
||||||
nodes: {
|
nodes: {
|
||||||
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
||||||
paletteEditorEnabled: () => false,
|
installerEnabled: () => false,
|
||||||
getCredentialKeyType: () => "test-key-type"
|
getCredentialKeyType: () => "test-key-type"
|
||||||
},
|
},
|
||||||
storage: {}
|
storage: {}
|
||||||
@ -79,7 +79,7 @@ describe("runtime-api/settings", function() {
|
|||||||
},
|
},
|
||||||
nodes: {
|
nodes: {
|
||||||
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
||||||
paletteEditorEnabled: () => false,
|
installerEnabled: () => false,
|
||||||
getCredentialKeyType: () => "test-key-type"
|
getCredentialKeyType: () => "test-key-type"
|
||||||
},
|
},
|
||||||
storage: {}
|
storage: {}
|
||||||
@ -115,7 +115,7 @@ describe("runtime-api/settings", function() {
|
|||||||
},
|
},
|
||||||
nodes: {
|
nodes: {
|
||||||
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
||||||
paletteEditorEnabled: () => false,
|
installerEnabled: () => false,
|
||||||
getCredentialKeyType: () => "test-key-type"
|
getCredentialKeyType: () => "test-key-type"
|
||||||
},
|
},
|
||||||
storage: {
|
storage: {
|
||||||
@ -166,7 +166,7 @@ describe("runtime-api/settings", function() {
|
|||||||
},
|
},
|
||||||
nodes: {
|
nodes: {
|
||||||
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
||||||
paletteEditorEnabled: () => false,
|
installerEnabled: () => false,
|
||||||
getCredentialKeyType: () => "test-key-type"
|
getCredentialKeyType: () => "test-key-type"
|
||||||
},
|
},
|
||||||
storage: {
|
storage: {
|
||||||
@ -207,7 +207,7 @@ describe("runtime-api/settings", function() {
|
|||||||
},
|
},
|
||||||
nodes: {
|
nodes: {
|
||||||
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
||||||
paletteEditorEnabled: () => false,
|
installerEnabled: () => false,
|
||||||
getCredentialKeyType: () => "test-key-type"
|
getCredentialKeyType: () => "test-key-type"
|
||||||
},
|
},
|
||||||
storage: {
|
storage: {
|
||||||
@ -252,7 +252,7 @@ describe("runtime-api/settings", function() {
|
|||||||
},
|
},
|
||||||
nodes: {
|
nodes: {
|
||||||
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
listContextStores: () => { return {stores:["file","memory"], default: "file"} },
|
||||||
paletteEditorEnabled: () => false,
|
installerEnabled: () => false,
|
||||||
getCredentialKeyType: () => "test-key-type"
|
getCredentialKeyType: () => "test-key-type"
|
||||||
},
|
},
|
||||||
storage: {
|
storage: {
|
||||||
@ -632,7 +632,7 @@ describe("api/editor/sshkeys", function() {
|
|||||||
},
|
},
|
||||||
events:{on:function(){},removeListener:function(){}},
|
events:{on:function(){},removeListener:function(){}},
|
||||||
isStarted: function() { return isStarted; },
|
isStarted: function() { return isStarted; },
|
||||||
nodes: {paletteEditorEnabled: function() { return false }}
|
nodes: {installerEnabled: function() { return false }}
|
||||||
};
|
};
|
||||||
|
|
||||||
before(function() {
|
before(function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user