From cf70f1731eee00a322a69987d77563f6429f5402 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Thu, 4 Aug 2016 23:26:27 +0100 Subject: [PATCH] hide integration management behind labs checkbox --- src/components/structures/UserSettings.js | 6 +++- src/components/views/rooms/RoomSettings.js | 34 ++++++++++------------ 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 6555668ff4..efbf943687 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -34,7 +34,11 @@ const LABS_FEATURES = [ { name: 'End-to-End Encryption', id: 'e2e_encryption' - } + }, + { + name: 'Integration Management', + id: 'integration_management' + }, ]; // if this looks like a release, use the 'version' from package.json; else use diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 9c13d27f68..f9c91bcc5b 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -67,18 +67,14 @@ module.exports = React.createClass({ tags_changed: false, tags: tags, areNotifsMuted: areNotifsMuted, -<<<<<<< HEAD - isRoomPublished: this._originalIsRoomPublished, // loaded async in componentWillMount - scalar_token: null, - scalar_error: null, -======= // isRoomPublished is loaded async in componentWillMount so when the component // inits, the saved value will always be undefined, however getInitialState() // is also called from the saving code so we must return the correct value here // if we have it (although this could race if the user saves before we load whether // the room is published or not). isRoomPublished: this._originalIsRoomPublished, ->>>>>>> develop + scalar_token: null, + scalar_error: null, }; }, @@ -621,18 +617,20 @@ module.exports = React.createClass({ } var integrations_section; - if (this.state.scalar_token) { - integrations_section = ( -
- Manage integrations -
- ); - } else if (this.state.scalar_error) { - integrations_section =
- Unable to contact integrations server -
; - } else { - integrations_section = ; + if (UserSettingsStore.isFeatureEnabled("integration_management")) { + if (this.state.scalar_token) { + integrations_section = ( +
+ Manage integrations +
+ ); + } else if (this.state.scalar_error) { + integrations_section =
+ Unable to contact integrations server +
; + } else { + integrations_section = ; + } } return (