Merge remote-tracking branch 'origin/develop' into release-v0.10.7

This commit is contained in:
David Baker 2017-10-13 15:00:49 +01:00
commit 705254ac55

View file

@ -36,12 +36,21 @@ export default {
getLabsFeatures() {
const featuresConfig = SdkConfig.get()['features'] || {};
return FEATURES.filter((f) => {
const sdkConfigValue = featuresConfig[f.id];
if (!['enable', 'disable'].includes(sdkConfigValue)) {
return true;
}
}).map((f) => {
// The old flag: honourned for backwards compat
const enableLabs = SdkConfig.get()['enableLabs'];
let labsFeatures;
if (enableLabs) {
labsFeatures = FEATURES;
} else {
labsFeatures = FEATURES.filter((f) => {
const sdkConfigValue = featuresConfig[f.id];
if (sdkConfigValue === 'labs') {
return true;
}
});
}
return labsFeatures.map((f) => {
return f.id;
});
},
@ -193,7 +202,7 @@ export default {
isFeatureEnabled: function(featureId: string): boolean {
const featuresConfig = SdkConfig.get()['features'];
let sdkConfigValue = 'labs';
let sdkConfigValue = 'disable';
if (featuresConfig && featuresConfig[featureId] !== undefined) {
sdkConfigValue = featuresConfig[featureId];
}