From 520659242b799f0574ea535834e79dcd58cc4bab Mon Sep 17 00:00:00 2001 From: Kerry Date: Mon, 29 May 2023 10:20:44 +1200 Subject: [PATCH] Fix spacing regression in user settings - roles & permissions (#10993) * add content container to settingsfieldset * fix spacing --- res/css/views/settings/_JoinRuleSettings.pcss | 1 - res/css/views/settings/_ProfileSettings.pcss | 2 + res/css/views/settings/_SettingsFieldset.pcss | 6 + .../views/settings/SettingsFieldset.tsx | 2 +- .../tabs/room/RolesRoomSettingsTab.tsx | 2 +- .../SettingsFieldset-test.tsx.snap | 24 ++- .../RolesRoomSettingsTab-test.tsx.snap | 32 ++-- .../SecurityRoomSettingsTab-test.tsx.snap | 164 ++++++++-------- .../SpaceSettingsVisibilityTab-test.tsx.snap | 178 +++++++++--------- 9 files changed, 221 insertions(+), 190 deletions(-) diff --git a/res/css/views/settings/_JoinRuleSettings.pcss b/res/css/views/settings/_JoinRuleSettings.pcss index 18c4395efe..92721f3acc 100644 --- a/res/css/views/settings/_JoinRuleSettings.pcss +++ b/res/css/views/settings/_JoinRuleSettings.pcss @@ -57,7 +57,6 @@ limitations under the License. .mx_JoinRuleSettings_radioButton { padding-top: 16px; - margin-bottom: 8px; .mx_StyledRadioButton_content { margin-left: 14px; diff --git a/res/css/views/settings/_ProfileSettings.pcss b/res/css/views/settings/_ProfileSettings.pcss index 86b6835dc8..4dc8168945 100644 --- a/res/css/views/settings/_ProfileSettings.pcss +++ b/res/css/views/settings/_ProfileSettings.pcss @@ -34,6 +34,8 @@ limitations under the License. } .mx_ProfileSettings_profile_controls_topic { + margin-top: $spacing-8; + & > textarea { font-family: inherit; resize: vertical; diff --git a/res/css/views/settings/_SettingsFieldset.pcss b/res/css/views/settings/_SettingsFieldset.pcss index 5acf3754a7..3443ba7970 100644 --- a/res/css/views/settings/_SettingsFieldset.pcss +++ b/res/css/views/settings/_SettingsFieldset.pcss @@ -43,3 +43,9 @@ limitations under the License. } } } + +.mx_SettingsFieldset_content { + display: flex; + flex-direction: column; + gap: $spacing-8; +} diff --git a/src/components/views/settings/SettingsFieldset.tsx b/src/components/views/settings/SettingsFieldset.tsx index 617564aed3..d63b5bf787 100644 --- a/src/components/views/settings/SettingsFieldset.tsx +++ b/src/components/views/settings/SettingsFieldset.tsx @@ -31,7 +31,7 @@ const SettingsFieldset: React.FC = ({ legend, className, children, descri {description} )} - {children} +
{children}
); diff --git a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx index 0ed44cf173..eb8a4ec083 100644 --- a/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx +++ b/src/components/views/settings/tabs/room/RolesRoomSettingsTab.tsx @@ -466,7 +466,7 @@ export default class RolesRoomSettingsTab extends React.Component { label = _t("Send %(eventType)s events", { eventType }); } return ( -
+
renders fieldset with plain text description 1`] = Changes to who can read history.
-
- test +
+
+ test +
@@ -54,8 +58,12 @@ exports[` renders fieldset with react description 1`] = `
-
- test +
+
+ test +
@@ -72,8 +80,12 @@ exports[` renders fieldset without description 1`] = ` > Who can read history? -
- test +
+
+ test +
diff --git a/test/components/views/settings/tabs/room/__snapshots__/RolesRoomSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/room/__snapshots__/RolesRoomSettingsTab-test.tsx.snap index aea4839894..e589363309 100644 --- a/test/components/views/settings/tabs/room/__snapshots__/RolesRoomSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/room/__snapshots__/RolesRoomSettingsTab-test.tsx.snap @@ -9,20 +9,24 @@ exports[`RolesRoomSettingsTab Banned users renders banned users 1`] = ` > Banned users -
    -
  • - - - @bob:server.org - - - Reason: just testing - -
  • -
+
    +
  • + + + @bob:server.org + + + Reason: just testing + +
  • +
+
`; diff --git a/test/components/views/settings/tabs/room/__snapshots__/SecurityRoomSettingsTab-test.tsx.snap b/test/components/views/settings/tabs/room/__snapshots__/SecurityRoomSettingsTab-test.tsx.snap index 28e4382176..d3642a1a7e 100644 --- a/test/components/views/settings/tabs/room/__snapshots__/SecurityRoomSettingsTab-test.tsx.snap +++ b/test/components/views/settings/tabs/room/__snapshots__/SecurityRoomSettingsTab-test.tsx.snap @@ -18,91 +18,95 @@ exports[` history visibility uses shared as default h Changes to who can read history will only apply to future messages in this room. The visibility of existing history will be unchanged.
-