Better logging when deprecated editorTheme.palette.* settings used

This commit is contained in:
Nick O'Leary 2021-01-06 17:36:59 +00:00
parent 5743a5f91d
commit af19536222
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
5 changed files with 25 additions and 7 deletions

View File

@ -520,9 +520,6 @@ RED.palette.editor = (function() {
installAllowList = parseModuleList(installAllowList);
installDenyList = parseModuleList(installDenyList);
console.log(installAllowList);
console.log(installDenyList);
createSettingsPane();
RED.userSettings.add({

View File

@ -362,6 +362,14 @@ function uninstallModule(module) {
}
async function checkPrereq() {
if (settings.editorTheme && settings.editorTheme.palette) {
if (settings.editorTheme.palette.hasOwnProperty("editable")) {
log.warn(log._("server.deprecatedOption",{old:"editorTheme.palette.editable", new:"externalModules.palette.allowInstall"}));
}
if (settings.editorTheme.palette.hasOwnProperty("upload")) {
log.warn(log._("server.deprecatedOption",{old:"editorTheme.palette.upload", new:"externalModules.palette.allowUpload"}));
}
}
try {
if (settings.editorTheme.palette.editable === false) {

View File

@ -90,8 +90,21 @@ var api = module.exports = {
safeSettings.flowFilePretty = runtime.settings.flowFilePretty;
}
if (runtime.settings.editorTheme && runtime.settings.editorTheme.palette) {
if (runtime.settings.editorTheme.palette.upload === false || runtime.settings.editorTheme.palette.editable === false) {
safeSettings.externalModules = {palette: { } }
}
if (runtime.settings.editorTheme.palette.upload === false) {
safeSettings.externalModules.palette.allowUpload = false;
}
if (runtime.settings.editorTheme.palette.editable === false) {
safeSettings.externalModules.palette.allowInstall = false;
safeSettings.externalModules.palette.allowUpload = false;
}
}
if (runtime.settings.externalModules) {
safeSettings.externalModules = runtime.settings.externalModules;
safeSettings.externalModules = extend(safeSettings.externalModules||{},runtime.settings.externalModules);
}
if (!runtime.nodes.installerEnabled()) {

View File

@ -125,7 +125,7 @@ function start() {
return redNodes.load().then(function() {
let autoInstallModules = false;
if (settings.hasOwnProperty('autoInstallModules')) {
log.warn(log._("runtime.deprecatedOption",{old:"autoInstallModules", new:"externalModules.autoInstall"}));
log.warn(log._("server.deprecatedOption",{old:"autoInstallModules", new:"externalModules.autoInstall"}));
autoInstallModules = true;
}
if (settings.externalModules) {
@ -198,7 +198,7 @@ function reinstallModules(moduleList) {
const reinstallList = [];
const installRetry = 30000;
if (settings.hasOwnProperty('autoInstallModulesRetry')) {
log.warn(log._("runtime.deprecatedOption",{old:"autoInstallModulesRetry", new:"externalModules.autoInstallRetry"}));
log.warn(log._("server.deprecatedOption",{old:"autoInstallModulesRetry", new:"externalModules.autoInstallRetry"}));
installRetry = settings.autoInstallModulesRetry;
}
if (settings.externalModules && settings.externalModules.hasOwnProperty('autoInstallRetry')) {

View File

@ -42,7 +42,7 @@
"uninstall-failed-long": "Uninstall of module __name__ failed:",
"uninstalled": "Uninstalled module: __name__"
},
"deprecatedOption": "use of __old__ is deprecated. Use __new__ instead",
"deprecatedOption": "Use of __old__ is deprecated. Use __new__ instead",
"unable-to-listen": "Unable to listen on __listenpath__",
"port-in-use": "Error: port in use",
"uncaught-exception": "Uncaught Exception:",