From b64ba1dbbf1c7be6cb40a0946f5f68bbfc11dd25 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Fri, 31 Jan 2020 11:09:49 +0000 Subject: [PATCH] Add temporary feature flag to control padlocks This default on feature flag will help in case we want to trial padlocks on vs. off this weekend. Fixes https://github.com/vector-im/riot-web/issues/12166 --- src/components/views/rooms/InviteOnlyIcon.js | 5 +++++ src/i18n/strings/en_EN.json | 1 + src/settings/Settings.js | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/src/components/views/rooms/InviteOnlyIcon.js b/src/components/views/rooms/InviteOnlyIcon.js index 5afaa7f0f2..07156b2973 100644 --- a/src/components/views/rooms/InviteOnlyIcon.js +++ b/src/components/views/rooms/InviteOnlyIcon.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import { _t } from '../../../languageHandler'; import * as sdk from '../../../index'; +import SettingsStore from '../../../settings/SettingsStore'; export default class InviteOnlyIcon extends React.Component { constructor() { @@ -36,6 +37,10 @@ export default class InviteOnlyIcon extends React.Component { }; render() { + if (!SettingsStore.isFeatureEnabled("feature_invite_only_padlocks")) { + return null; + } + const Tooltip = sdk.getComponent("elements.Tooltip"); let tooltip; if (this.state.hover) { diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 154e8d0d28..8b89524f69 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -374,6 +374,7 @@ "Enable cross-signing to verify per-user instead of per-session (in development)": "Enable cross-signing to verify per-user instead of per-session (in development)", "Enable local event indexing and E2EE search (requires restart)": "Enable local event indexing and E2EE search (requires restart)", "Show info about bridges in room settings": "Show info about bridges in room settings", + "Show padlocks on invite only rooms": "Show padlocks on invite only rooms", "Enable Emoji suggestions while typing": "Enable Emoji suggestions while typing", "Use compact timeline layout": "Use compact timeline layout", "Show a placeholder for removed messages": "Show a placeholder for removed messages", diff --git a/src/settings/Settings.js b/src/settings/Settings.js index 5ea871dc69..ecaf9cd2e3 100644 --- a/src/settings/Settings.js +++ b/src/settings/Settings.js @@ -160,6 +160,12 @@ export const SETTINGS = { displayName: _td("Show info about bridges in room settings"), default: false, }, + "feature_invite_only_padlocks": { + isFeature: true, + supportedLevels: LEVELS_FEATURE, + displayName: _td("Show padlocks on invite only rooms"), + default: true, + }, "MessageComposerInput.suggestEmoji": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, displayName: _td('Enable Emoji suggestions while typing'),