Merge pull request #6693 from SimonBrandner/fix/guest/18776
Render guest settings only in public rooms/spacespull/21833/head
commit
a6d2bb5e6c
|
@ -634,6 +634,22 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
||||||
historySection = null;
|
historySection = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let advanced;
|
||||||
|
if (this.state.joinRule === JoinRule.Public) {
|
||||||
|
advanced = (
|
||||||
|
<>
|
||||||
|
<AccessibleButton
|
||||||
|
onClick={this.toggleAdvancedSection}
|
||||||
|
kind="link"
|
||||||
|
className="mx_SettingsTab_showAdvanced"
|
||||||
|
>
|
||||||
|
{ this.state.showAdvancedSection ? _t("Hide advanced") : _t("Show advanced") }
|
||||||
|
</AccessibleButton>
|
||||||
|
{ this.state.showAdvancedSection && this.renderAdvanced() }
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mx_SettingsTab mx_SecurityRoomSettingsTab">
|
<div className="mx_SettingsTab mx_SecurityRoomSettingsTab">
|
||||||
<div className="mx_SettingsTab_heading">{ _t("Security & Privacy") }</div>
|
<div className="mx_SettingsTab_heading">{ _t("Security & Privacy") }</div>
|
||||||
|
@ -659,15 +675,7 @@ export default class SecurityRoomSettingsTab extends React.Component<IProps, ISt
|
||||||
{ this.renderJoinRule() }
|
{ this.renderJoinRule() }
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<AccessibleButton
|
{ advanced }
|
||||||
onClick={this.toggleAdvancedSection}
|
|
||||||
kind="link"
|
|
||||||
className="mx_SettingsTab_showAdvanced"
|
|
||||||
>
|
|
||||||
{ this.state.showAdvancedSection ? _t("Hide advanced") : _t("Show advanced") }
|
|
||||||
</AccessibleButton>
|
|
||||||
{ this.state.showAdvancedSection && this.renderAdvanced() }
|
|
||||||
|
|
||||||
{ historySection }
|
{ historySection }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -94,30 +94,32 @@ const SpaceSettingsVisibilityTab = ({ matrixClient: cli, space }: IProps) => {
|
||||||
const canonicalAliasEv = space.currentState.getStateEvents(EventType.RoomCanonicalAlias, "");
|
const canonicalAliasEv = space.currentState.getStateEvents(EventType.RoomCanonicalAlias, "");
|
||||||
|
|
||||||
let advancedSection;
|
let advancedSection;
|
||||||
if (showAdvancedSection) {
|
if (visibility === SpaceVisibility.Unlisted) {
|
||||||
advancedSection = <>
|
if (showAdvancedSection) {
|
||||||
<AccessibleButton onClick={toggleAdvancedSection} kind="link" className="mx_SettingsTab_showAdvanced">
|
advancedSection = <>
|
||||||
{ _t("Hide advanced") }
|
<AccessibleButton onClick={toggleAdvancedSection} kind="link" className="mx_SettingsTab_showAdvanced">
|
||||||
</AccessibleButton>
|
{ _t("Hide advanced") }
|
||||||
|
</AccessibleButton>
|
||||||
|
|
||||||
<LabelledToggleSwitch
|
<LabelledToggleSwitch
|
||||||
value={guestAccessEnabled}
|
value={guestAccessEnabled}
|
||||||
onChange={setGuestAccessEnabled}
|
onChange={setGuestAccessEnabled}
|
||||||
disabled={!canSetGuestAccess}
|
disabled={!canSetGuestAccess}
|
||||||
label={_t("Enable guest access")}
|
label={_t("Enable guest access")}
|
||||||
/>
|
/>
|
||||||
<p>
|
<p>
|
||||||
{ _t("Guests can join a space without having an account.") }
|
{ _t("Guests can join a space without having an account.") }
|
||||||
<br />
|
<br />
|
||||||
{ _t("This may be useful for public spaces.") }
|
{ _t("This may be useful for public spaces.") }
|
||||||
</p>
|
</p>
|
||||||
</>;
|
</>;
|
||||||
} else {
|
} else {
|
||||||
advancedSection = <>
|
advancedSection = <>
|
||||||
<AccessibleButton onClick={toggleAdvancedSection} kind="link" className="mx_SettingsTab_showAdvanced">
|
<AccessibleButton onClick={toggleAdvancedSection} kind="link" className="mx_SettingsTab_showAdvanced">
|
||||||
{ _t("Show advanced") }
|
{ _t("Show advanced") }
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
</>;
|
</>;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let addressesSection;
|
let addressesSection;
|
||||||
|
|
Loading…
Reference in New Issue