From abec097da19a56a73270a3e9b30198c07b1210ea Mon Sep 17 00:00:00 2001
From: Florian Orben <florian.orben@gmail.com>
Date: Fri, 13 Nov 2015 03:15:33 +0100
Subject: PLT-1125: allow to toggle features in frontend

---
 web/react/utils/utils.jsx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'web/react/utils/utils.jsx')

diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 9b2f7e057..432cb05e0 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -1221,3 +1221,7 @@ export function getPostTerm(post) {
 
     return postTerm;
 }
+
+export function featureToggle(feature) {
+    return PreferenceStore.getPreference(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'feature_enabled_' + feature, {value: 'false'}).value === 'true';
+}
-- 
cgit v1.2.3-1-g7c22


From 6e1e5f7ae4dcc5645a5412e17b36e5d95bf4f7c6 Mon Sep 17 00:00:00 2001
From: Florian Orben <florian.orben@gmail.com>
Date: Fri, 13 Nov 2015 23:05:08 +0100
Subject: only show advanced settings section if there are any pre-release
 features

---
 web/react/utils/utils.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'web/react/utils/utils.jsx')

diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 432cb05e0..58e570455 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -1223,5 +1223,5 @@ export function getPostTerm(post) {
 }
 
 export function featureToggle(feature) {
-    return PreferenceStore.getPreference(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, 'feature_enabled_' + feature, {value: 'false'}).value === 'true';
+    return PreferenceStore.getPreference(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, Constants.FeatureTogglePrefix + feature, {value: 'false'}).value === 'true';
 }
-- 
cgit v1.2.3-1-g7c22


From 61a35066b64085d264fbd049e2a57f70125ca65a Mon Sep 17 00:00:00 2001
From: Florian Orben <florian.orben@gmail.com>
Date: Fri, 27 Nov 2015 23:16:56 +0100
Subject: rename 'featureToggle' to 'isFeatureEnable' and move definition of
 available prerelease-features to constants.jsx

---
 web/react/utils/utils.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'web/react/utils/utils.jsx')

diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx
index 58e570455..80c377d7f 100644
--- a/web/react/utils/utils.jsx
+++ b/web/react/utils/utils.jsx
@@ -1222,6 +1222,6 @@ export function getPostTerm(post) {
     return postTerm;
 }
 
-export function featureToggle(feature) {
-    return PreferenceStore.getPreference(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, Constants.FeatureTogglePrefix + feature, {value: 'false'}).value === 'true';
+export function isFeatureEnabled(feature) {
+    return PreferenceStore.getPreference(Constants.Preferences.CATEGORY_ADVANCED_SETTINGS, Constants.FeatureTogglePrefix + feature.label, {value: 'false'}).value === 'true';
 }
-- 
cgit v1.2.3-1-g7c22

