From e8ee5c2f9625f27644c56dede6c3d33d89d3e745 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 5 Aug 2016 16:13:06 +0100 Subject: [PATCH 1/3] Add config to hide the labs section --- src/components/structures/MatrixChat.js | 11 ++++++++++- src/components/structures/UserSettings.js | 8 +++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 33e6499e21..b075db166f 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -139,6 +139,10 @@ module.exports = React.createClass({ return this.props.config.default_is_url || "https://vector.im"; }, + getEnableLabs() { + return this.props.config.enableLabs === undefined ? true : this.props.config.enableLabs; + }, + componentWillMount: function() { this.favicon = new Favico({animation: 'none'}); @@ -1060,7 +1064,12 @@ module.exports = React.createClass({ right_panel = break; case this.PageTypes.UserSettings: - page_element = + page_element = right_panel = break; case this.PageTypes.CreateRoom: diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 89146229fa..8ee9cbd2dc 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -50,11 +50,15 @@ module.exports = React.createClass({ onClose: React.PropTypes.func, // The brand string given when creating email pushers brand: React.PropTypes.string, + + // True to show the 'labs' section of experimental features + enableLabs: React.PropTypes.boolean, }, getDefaultProps: function() { return { - onClose: function() {} + onClose: function() {}, + enableLabs: true, }; }, @@ -359,6 +363,8 @@ module.exports = React.createClass({ }, _renderLabs: function () { + if (!this.props.enableLabs) return false; + let features = LABS_FEATURES.map(feature => (
Date: Fri, 5 Aug 2016 16:36:35 +0100 Subject: [PATCH 2/3] pr feedback --- src/components/structures/MatrixChat.js | 6 +----- src/components/structures/UserSettings.js | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index b075db166f..e3f0c9be83 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -139,10 +139,6 @@ module.exports = React.createClass({ return this.props.config.default_is_url || "https://vector.im"; }, - getEnableLabs() { - return this.props.config.enableLabs === undefined ? true : this.props.config.enableLabs; - }, - componentWillMount: function() { this.favicon = new Favico({animation: 'none'}); @@ -1068,7 +1064,7 @@ module.exports = React.createClass({ onClose={this.onUserSettingsClose} version={this.state.version} brand={this.props.config.brand} - enableLabs={this.getEnableLabs()} + enableLabs={this.props.config.enableLabs} /> right_panel = break; diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 8ee9cbd2dc..2885606f27 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -52,7 +52,7 @@ module.exports = React.createClass({ brand: React.PropTypes.string, // True to show the 'labs' section of experimental features - enableLabs: React.PropTypes.boolean, + enableLabs: React.PropTypes.bool, }, getDefaultProps: function() { @@ -363,7 +363,7 @@ module.exports = React.createClass({ }, _renderLabs: function () { - if (!this.props.enableLabs) return false; + if (this.props.enableLabs === false) return null; let features = LABS_FEATURES.map(feature => (
From 5e358b8cf6c0417fb74e8e3d54cde8258f22708e Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 5 Aug 2016 17:18:45 +0100 Subject: [PATCH 3/3] Add comment --- src/components/structures/UserSettings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 2885606f27..242fd0d73c 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -363,6 +363,7 @@ module.exports = React.createClass({ }, _renderLabs: function () { + // default to enabled if undefined if (this.props.enableLabs === false) return null; let features = LABS_FEATURES.map(feature => (