From 853d33a93a75cd9d8775e2b39b4462e44c33e950 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 10 Nov 2017 15:42:11 +0000 Subject: [PATCH 1/4] Make groups a fully-fleged baked-in feature --- src/UserSettingsStore.js | 4 ---- src/components/views/elements/Flair.js | 4 +--- src/components/views/rooms/RoomSettings.js | 12 +++++------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index ce39939bc0..34f9a28d57 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -26,10 +26,6 @@ import SdkConfig from './SdkConfig'; */ const FEATURES = [ - { - id: 'feature_groups', - name: _td("Communities"), - }, { id: 'feature_pinning', name: _td("Message Pinning"), diff --git a/src/components/views/elements/Flair.js b/src/components/views/elements/Flair.js index 17d37d593c..ec0276ab55 100644 --- a/src/components/views/elements/Flair.js +++ b/src/components/views/elements/Flair.js @@ -83,9 +83,7 @@ export default class Flair extends React.Component { componentWillMount() { this._unmounted = false; - if (UserSettingsStore.isFeatureEnabled('feature_groups') && FlairStore.groupSupport()) { - this._generateAvatars(); - } + this._generateAvatars(); this.context.matrixClient.on('RoomState.events', this.onRoomStateEvents); } diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index 2f46a9308e..c7e839ab40 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -671,13 +671,11 @@ module.exports = React.createClass({ const self = this; - let relatedGroupsSection; - if (UserSettingsStore.isFeatureEnabled('feature_groups')) { - relatedGroupsSection = ; - } + const relatedGroupsSection = ; let userLevelsSection; if (Object.keys(user_levels).length) { From ceda5939f9fe2a433558cacc612dee39b4bb0877 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 10 Nov 2017 15:55:55 +0000 Subject: [PATCH 2/4] Remember to import React --- src/components/views/elements/GroupsButton.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/views/elements/GroupsButton.js b/src/components/views/elements/GroupsButton.js index 9e803c87db..75dfe4e9ad 100644 --- a/src/components/views/elements/GroupsButton.js +++ b/src/components/views/elements/GroupsButton.js @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +import React from 'react'; import sdk from '../../../index'; import PropTypes from 'prop-types'; import { _t } from '../../../languageHandler'; From 1c82df216e9b47a4930ed473c4e56bed42863575 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 10 Nov 2017 16:11:59 +0000 Subject: [PATCH 3/4] Ignore unused React when using JSX --- .eslintrc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 429aa24993..fd4d1da631 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -33,6 +33,8 @@ module.exports = { // This just uses the react plugin to help eslint known when // variables have been used in JSX "react/jsx-uses-vars": "error", + // Don't mark React as unused if we're using JSX + "react/jsx-uses-react": "error", // bind or arrow function in props causes performance issues "react/jsx-no-bind": ["error", { From a96bfee9f27fc2e782a372378bcaf79f1a6f37de Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 10 Nov 2017 16:12:07 +0000 Subject: [PATCH 4/4] Remove unused UserSettingsStore import --- src/components/views/elements/Flair.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/views/elements/Flair.js b/src/components/views/elements/Flair.js index ec0276ab55..4a34dac0de 100644 --- a/src/components/views/elements/Flair.js +++ b/src/components/views/elements/Flair.js @@ -19,7 +19,6 @@ import React from 'react'; import PropTypes from 'prop-types'; import {MatrixClient} from 'matrix-js-sdk'; -import UserSettingsStore from '../../../UserSettingsStore'; import FlairStore from '../../../stores/FlairStore'; import dis from '../../../dispatcher';