Skip to content

Commit

Permalink
Fix identity server settings visibility (#29083)
Browse files Browse the repository at this point in the history
* Fix identity server settings visibility

The IS settings got confused with the posthog settings and were only
shown if analytics were enabled.

* Update snapshot
  • Loading branch information
dbkr authored Jan 24, 2025
1 parent ac565dc commit 197afd6
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -319,17 +319,16 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
);
}

let privacySection;
let posthogSection;
if (PosthogAnalytics.instance.isEnabled()) {
const onClickAnalyticsLearnMore = (): void => {
showAnalyticsLearnMoreDialog({
primaryButton: _t("action|ok"),
hasCancel: false,
});
};
privacySection = (
<SettingsSection heading={_t("common|privacy")}>
<DiscoverySettings />
posthogSection = (
<>
<SettingsSubsection
heading={_t("common|analytics")}
description={_t("settings|security|analytics_description")}
Expand All @@ -344,7 +343,7 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
<SettingsSubsection heading={_t("settings|sessions|title")}>
<SettingsFlag name="deviceClientInformationOptIn" level={SettingLevel.ACCOUNT} />
</SettingsSubsection>
</SettingsSection>
</>
);
}

Expand Down Expand Up @@ -373,7 +372,10 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
{crossSigning}
<CryptographyPanel />
</SettingsSection>
{privacySection}
<SettingsSection heading={_t("common|privacy")}>
<DiscoverySettings />
{posthogSection}
</SettingsSection>
{advancedSection}
</SettingsTab>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,89 @@ exports[`<SecurityUserSettingsTab /> renders security section 1`] = `
</div>
</div>
</div>
<div
class="mx_SettingsSection"
>
<h2
class="mx_Heading_h3"
>
Privacy
</h2>
<div
class="mx_SettingsSection_subSections"
>
<div
class="mx_SettingsSubsection"
data-testid="discoverySection"
>
<div
class="mx_SettingsSubsectionHeading"
>
<h3
class="mx_Heading_h4 mx_SettingsSubsectionHeading_heading"
>
How to find you
</h3>
</div>
<div
class="mx_SettingsSubsection_content mx_SettingsSubsection_contentStretch"
>
<fieldset
class="mx_SettingsFieldset"
>
<legend
class="mx_SettingsFieldset_legend"
>
Identity server
</legend>
<div
class="mx_SettingsFieldset_description"
>
<div
class="mx_SettingsSubsection_text"
>
You are not currently using an identity server. To discover and be discoverable by existing contacts you know, add one below.
</div>
</div>
<div
class="mx_SettingsFieldset_content"
>
<form
class="mx_SetIdServer"
>
<div
class="mx_Field mx_Field_input"
>
<input
autocomplete="off"
id="mx_Field_1"
label="Enter a new identity server"
placeholder=""
type="text"
value=""
/>
<label
for="mx_Field_1"
>
Enter a new identity server
</label>
</div>
<div
aria-disabled="true"
class="mx_AccessibleButton mx_AccessibleButton_hasKind mx_AccessibleButton_kind_primary_sm mx_AccessibleButton_disabled"
disabled=""
role="button"
tabindex="0"
>
Change
</div>
</form>
</div>
</fieldset>
</div>
</div>
</div>
</div>
<div
class="mx_SettingsSection"
>
Expand Down

0 comments on commit 197afd6

Please sign in to comment.