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

pull/21833/head
David Baker 2017-10-13 15:00:49 +01:00
commit 705254ac55
1 changed files with 16 additions and 7 deletions

View File

@ -36,12 +36,21 @@ export default {
getLabsFeatures() {
const featuresConfig = SdkConfig.get()['features'] || {};
return FEATURES.filter((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 (!['enable', 'disable'].includes(sdkConfigValue)) {
if (sdkConfigValue === 'labs') {
return true;
}
}).map((f) => {
});
}
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];
}