Ignored member email settings in import

no issue

- Member email settings - newsletter and support - was previously being set to null for all cases, which can lead to `null` values being set for those addresses on a successful import whereas the expected behavior is to retain the old values.
- Adds the 2 email settings to ignored settings list so they are not changed during import process
This commit is contained in:
Rish 2020-10-15 15:32:05 +05:30
parent 54e638310c
commit 3e0948d04e

View File

@ -8,7 +8,7 @@ const keyGroupMapper = require('../../../../api/shared/serializers/input/utils/s
const keyTypeMapper = require('../../../../api/shared/serializers/input/utils/settings-key-type-mapper');
const labsDefaults = JSON.parse(defaultSettings.labs.labs.defaultValue);
const ignoredSettings = ['active_apps', 'installed_apps'];
const ignoredSettings = ['active_apps', 'installed_apps', 'members_from_address', 'members_support_address'];
const deprecatedSupportedSettingsMap = {
default_locale: 'lang',
active_timezone: 'timezone',
@ -75,7 +75,7 @@ class SettingsImporter extends BaseImporter {
});
}
// Don't import any old, deprecated settings
// Don't import any old, deprecated or excluded settings
this.dataToImport = _.filter(this.dataToImport, (data) => {
return !_.includes(ignoredSettings, data.key);
});
@ -110,7 +110,7 @@ class SettingsImporter extends BaseImporter {
const oldIsPrivate = _.find(this.existingData, {key: 'is_private'});
this.dataToImport = _.filter(this.dataToImport, (data) => {
return data.key !== 'is_private';
return !_.includes([['is_private']], data.key);
});
this.dataToImport = _.filter(this.dataToImport, (data) => {