From 0a89813de1a1fa3a83d5ae27ef14d00c7e5fcb6c Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 27 Apr 2020 14:25:47 +0100 Subject: [PATCH 1/4] Add a link from settings / devices to your user profile Temporarily until you can verify devices in settings Fixes https://github.com/vector-im/riot-web/issues/13401 --- src/components/views/dialogs/UserSettingsDialog.js | 2 +- .../settings/tabs/user/SecurityUserSettingsTab.js | 12 ++++++++++++ src/i18n/strings/en_EN.json | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/UserSettingsDialog.js b/src/components/views/dialogs/UserSettingsDialog.js index b135d5f5f6..210773c524 100644 --- a/src/components/views/dialogs/UserSettingsDialog.js +++ b/src/components/views/dialogs/UserSettingsDialog.js @@ -89,7 +89,7 @@ export default class UserSettingsDialog extends React.Component { tabs.push(new Tab( _td("Security & Privacy"), "mx_UserSettingsDialog_securityIcon", - , + , )); if (SdkConfig.get()['showLabsSettings'] || SettingsStore.getLabsFeatures().length > 0) { tabs.push(new Tab( diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js index a88f35da68..a8435857ad 100644 --- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js @@ -50,6 +50,10 @@ export class IgnoredUser extends React.Component { } export default class SecurityUserSettingsTab extends React.Component { + static propTypes = { + closeSettingsFn: PropTypes.func.isRequired, + }; + constructor() { super(); @@ -85,6 +89,11 @@ export default class SecurityUserSettingsTab extends React.Component { ); }; + _onGoToUserProfileClick = () => { + // close the settings dialog & let the default action run (ie. navigate to the link) + this.props.closeSettingsFn(); + } + _onUserUnignored = async (userId) => { // Don't use this.state to get the ignored user list as it might be // ever so slightly outdated. Instead, prefer to get a fresh list and @@ -283,6 +292,9 @@ export default class SecurityUserSettingsTab extends React.Component { return (
{_t("Security & Privacy")}
+ + {_t("Verify your devices in your User Profile")} +
{_t("Sessions")}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index c141931dd7..94d02b30dd 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -843,6 +843,7 @@ "Message search": "Message search", "Cross-signing": "Cross-signing", "Security & Privacy": "Security & Privacy", + "Verify your devices in your User Profile": "Verify your devices in your User Profile", "Sessions": "Sessions", "A session's public name is visible to people you communicate with": "A session's public name is visible to people you communicate with", "Riot collects anonymous analytics to allow us to improve the application.": "Riot collects anonymous analytics to allow us to improve the application.", From ef1e40c83995a6495678d86a4c67d59982b0e0da Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 27 Apr 2020 14:35:32 +0100 Subject: [PATCH 2/4] Update to (almost) match design --- .../tabs/user/SecurityUserSettingsTab.js | 16 ++++++++++++---- src/i18n/strings/en_EN.json | 4 +++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js index a8435857ad..688668d0cb 100644 --- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js @@ -292,11 +292,19 @@ export default class SecurityUserSettingsTab extends React.Component { return (
{_t("Security & Privacy")}
- - {_t("Verify your devices in your User Profile")} -
- {_t("Sessions")} + {_t("Where you’re logged in")} + + {_t( + "Manage the names of and sign out of your sessions below or " + + "verify them in your User Profile.", {}, + { + a: sub => {sub} + } + )} +
{_t("A session's public name is visible to people you communicate with")} diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 94d02b30dd..775e04b55f 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -843,8 +843,9 @@ "Message search": "Message search", "Cross-signing": "Cross-signing", "Security & Privacy": "Security & Privacy", + "Where you’re logged in": "Where you’re logged in", + "Manage the names of and sign out of your sessions below or verify them in your User Profile.": "Manage the names of and sign out of your sessions below or verify them in your User Profile.", "Verify your devices in your User Profile": "Verify your devices in your User Profile", - "Sessions": "Sessions", "A session's public name is visible to people you communicate with": "A session's public name is visible to people you communicate with", "Riot collects anonymous analytics to allow us to improve the application.": "Riot collects anonymous analytics to allow us to improve the application.", "Privacy is important to us, so we don't collect any personal or identifiable data for our analytics.": "Privacy is important to us, so we don't collect any personal or identifiable data for our analytics.", @@ -1029,6 +1030,7 @@ "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.": "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.", "Are you sure?": "Are you sure?", "No sessions with registered encryption keys": "No sessions with registered encryption keys", + "Sessions": "Sessions", "Jump to read receipt": "Jump to read receipt", "Mention": "Mention", "Invite": "Invite", From d6f96f2f27b5329b0e0b59a08bebf11195380fd3 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 27 Apr 2020 14:38:22 +0100 Subject: [PATCH 3/4] Update i18n --- src/i18n/strings/en_EN.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 775e04b55f..2d36f756e6 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -845,7 +845,6 @@ "Security & Privacy": "Security & Privacy", "Where you’re logged in": "Where you’re logged in", "Manage the names of and sign out of your sessions below or verify them in your User Profile.": "Manage the names of and sign out of your sessions below or verify them in your User Profile.", - "Verify your devices in your User Profile": "Verify your devices in your User Profile", "A session's public name is visible to people you communicate with": "A session's public name is visible to people you communicate with", "Riot collects anonymous analytics to allow us to improve the application.": "Riot collects anonymous analytics to allow us to improve the application.", "Privacy is important to us, so we don't collect any personal or identifiable data for our analytics.": "Privacy is important to us, so we don't collect any personal or identifiable data for our analytics.", From 63d2d128c5f12ba1549dc4955f6d6c59e806288c Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 27 Apr 2020 14:43:17 +0100 Subject: [PATCH 4/4] Lint --- .../views/settings/tabs/user/SecurityUserSettingsTab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js index 688668d0cb..0eec59806a 100644 --- a/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js +++ b/src/components/views/settings/tabs/user/SecurityUserSettingsTab.js @@ -301,8 +301,8 @@ export default class SecurityUserSettingsTab extends React.Component { { a: sub => {sub} - } + >{sub}, + }, )}