Fix identity server settings visibility (#29083)

* Fix identity server settings visibility

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

* Update snapshot
This commit is contained in:
David Baker
2025-01-24 10:07:26 +00:00
committed by GitHub
parent ac565dca80
commit 197afd6a9e
2 changed files with 91 additions and 6 deletions

View File

@@ -319,7 +319,7 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
);
}
let privacySection;
let posthogSection;
if (PosthogAnalytics.instance.isEnabled()) {
const onClickAnalyticsLearnMore = (): void => {
showAnalyticsLearnMoreDialog({
@@ -327,9 +327,8 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
hasCancel: false,
});
};
privacySection = (
<SettingsSection heading={_t("common|privacy")}>
<DiscoverySettings />
posthogSection = (
<>
<SettingsSubsection
heading={_t("common|analytics")}
description={_t("settings|security|analytics_description")}
@@ -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>
</>
);
}
@@ -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>
);

View File

@@ -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"
>