From a501d698aabbf6a99909b80906a3aae5c5552c87 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 27 Oct 2020 19:20:25 -0600 Subject: [PATCH 1/2] Add a UI Feature flag for room history settings --- .../tabs/room/SecurityRoomSettingsTab.js | 16 ++++++++++++---- src/settings/Settings.ts | 4 ++++ src/settings/UIFeature.ts | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js index 0a0c693158..f72e78fa3f 100644 --- a/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js +++ b/src/components/views/settings/tabs/room/SecurityRoomSettingsTab.js @@ -25,6 +25,7 @@ import QuestionDialog from "../../../dialogs/QuestionDialog"; import StyledRadioGroup from '../../../elements/StyledRadioGroup'; import {SettingLevel} from "../../../../../settings/SettingLevel"; import SettingsStore from "../../../../../settings/SettingsStore"; +import {UIFeature} from "../../../../../settings/UIFeature"; export default class SecurityRoomSettingsTab extends React.Component { static propTypes = { @@ -350,6 +351,16 @@ export default class SecurityRoomSettingsTab extends React.Component { />; } + let historySection = (<> + {_t("Who can read history?")} +
+ {this._renderHistory()} +
+ ); + if (!SettingsStore.getValue(UIFeature.RoomHistorySettings)) { + historySection = null; + } + return (
{_t("Security & Privacy")}
@@ -371,10 +382,7 @@ export default class SecurityRoomSettingsTab extends React.Component { {this._renderRoomAccess()}
- {_t("Who can read history?")} -
- {this._renderHistory()} -
+ {historySection} ); } diff --git a/src/settings/Settings.ts b/src/settings/Settings.ts index c8430a1767..6f4357973a 100644 --- a/src/settings/Settings.ts +++ b/src/settings/Settings.ts @@ -630,6 +630,10 @@ export const SETTINGS: {[setting: string]: ISetting} = { supportedLevels: LEVELS_ACCOUNT_SETTINGS, default: null, }, + [UIFeature.RoomHistorySettings]: { + supportedLevels: LEVELS_UI_FEATURE, + default: true, + }, [UIFeature.AdvancedEncryption]: { supportedLevels: LEVELS_UI_FEATURE, default: true, diff --git a/src/settings/UIFeature.ts b/src/settings/UIFeature.ts index 231752e19c..82dfdf0bb5 100644 --- a/src/settings/UIFeature.ts +++ b/src/settings/UIFeature.ts @@ -31,4 +31,5 @@ export enum UIFeature { Flair = "UIFeature.flair", Communities = "UIFeature.communities", AdvancedSettings = "UIFeature.advancedSettings", + RoomHistorySettings = "UIFeature.roomHistorySettings", } From 09b02d0120a1f978986cddc0860fe882fcbdf1c9 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Wed, 28 Oct 2020 10:50:38 -0600 Subject: [PATCH 2/2] Fix i18n --- src/i18n/strings/en_EN.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 1548dd5c13..ade1d0a3a1 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1000,11 +1000,11 @@ "Members only (since the point in time of selecting this option)": "Members only (since the point in time of selecting this option)", "Members only (since they were invited)": "Members only (since they were invited)", "Members only (since they joined)": "Members only (since they joined)", + "Who can read history?": "Who can read history?", "Security & Privacy": "Security & Privacy", "Once enabled, encryption cannot be disabled.": "Once enabled, encryption cannot be disabled.", "Encrypted": "Encrypted", "Who can access this room?": "Who can access this room?", - "Who can read history?": "Who can read history?", "Unable to revoke sharing for email address": "Unable to revoke sharing for email address", "Unable to share email address": "Unable to share email address", "Your email address hasn't been verified yet": "Your email address hasn't been verified yet",