Merge pull request #4499 from matrix-org/dbkr/link_from_settings_to_userprofile_rel

Add a link from settings / devices to your user profile
This commit is contained in:
David Baker 2020-04-27 17:28:46 +01:00 committed by GitHub
commit 582747d2ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 3 deletions

View file

@ -89,7 +89,7 @@ export default class UserSettingsDialog extends React.Component {
tabs.push(new Tab( tabs.push(new Tab(
_td("Security & Privacy"), _td("Security & Privacy"),
"mx_UserSettingsDialog_securityIcon", "mx_UserSettingsDialog_securityIcon",
<SecurityUserSettingsTab />, <SecurityUserSettingsTab closeSettingsFn={this.props.onFinished} />,
)); ));
if (SdkConfig.get()['showLabsSettings'] || SettingsStore.getLabsFeatures().length > 0) { if (SdkConfig.get()['showLabsSettings'] || SettingsStore.getLabsFeatures().length > 0) {
tabs.push(new Tab( tabs.push(new Tab(

View file

@ -50,6 +50,10 @@ export class IgnoredUser extends React.Component {
} }
export default class SecurityUserSettingsTab extends React.Component { export default class SecurityUserSettingsTab extends React.Component {
static propTypes = {
closeSettingsFn: PropTypes.func.isRequired,
};
constructor() { constructor() {
super(); 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) => { _onUserUnignored = async (userId) => {
// Don't use this.state to get the ignored user list as it might be // 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 // ever so slightly outdated. Instead, prefer to get a fresh list and
@ -284,7 +293,18 @@ export default class SecurityUserSettingsTab extends React.Component {
<div className="mx_SettingsTab mx_SecurityUserSettingsTab"> <div className="mx_SettingsTab mx_SecurityUserSettingsTab">
<div className="mx_SettingsTab_heading">{_t("Security & Privacy")}</div> <div className="mx_SettingsTab_heading">{_t("Security & Privacy")}</div>
<div className="mx_SettingsTab_section"> <div className="mx_SettingsTab_section">
<span className="mx_SettingsTab_subheading">{_t("Sessions")}</span> <span className="mx_SettingsTab_subheading">{_t("Where youre logged in")}</span>
<span>
{_t(
"Manage the names of and sign out of your sessions below or " +
"<a>verify them in your User Profile</a>.", {},
{
a: sub => <a href={"#/user/" + MatrixClientPeg.get().getUserId()}
onClick={this._onGoToUserProfileClick}
>{sub}</a>,
},
)}
</span>
<div className='mx_SettingsTab_subsectionText'> <div className='mx_SettingsTab_subsectionText'>
{_t("A session's public name is visible to people you communicate with")} {_t("A session's public name is visible to people you communicate with")}
<DevicesPanel /> <DevicesPanel />

View file

@ -842,7 +842,8 @@
"Message search": "Message search", "Message search": "Message search",
"Cross-signing": "Cross-signing", "Cross-signing": "Cross-signing",
"Security & Privacy": "Security & Privacy", "Security & Privacy": "Security & Privacy",
"Sessions": "Sessions", "Where youre logged in": "Where youre logged in",
"Manage the names of and sign out of your sessions below or <a>verify them in your User Profile</a>.": "Manage the names of and sign out of your sessions below or <a>verify them in your User Profile</a>.",
"A session's public name is visible to people you communicate with": "A session's public name is visible to people you communicate with", "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.", "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.", "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.",
@ -1027,6 +1028,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.", "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?", "Are you sure?": "Are you sure?",
"No sessions with registered encryption keys": "No sessions with registered encryption keys", "No sessions with registered encryption keys": "No sessions with registered encryption keys",
"Sessions": "Sessions",
"Jump to read receipt": "Jump to read receipt", "Jump to read receipt": "Jump to read receipt",
"Mention": "Mention", "Mention": "Mention",
"Invite": "Invite", "Invite": "Invite",