From 1999ff9263ecbe0fac2d180b7e37dff2fb66d863 Mon Sep 17 00:00:00 2001 From: Saurabh Sharma Date: Tue, 28 Jan 2025 21:43:38 +0530 Subject: [PATCH] [MA-50]: Provide fieldsets for groups of form controls (#29905) Co-authored-by: Mattermost Build --- .../channel_notifications_modal.test.tsx.snap | 902 ++++++++++-------- .../channel_notifications_modal.tsx | 23 +- .../modals/components/base_setting_item.scss | 4 + .../components/checkbox_setting_item.tsx | 26 +- 4 files changed, 535 insertions(+), 420 deletions(-) diff --git a/webapp/channels/src/components/channel_notifications_modal/__snapshots__/channel_notifications_modal.test.tsx.snap b/webapp/channels/src/components/channel_notifications_modal/__snapshots__/channel_notifications_modal.test.tsx.snap index 9c6c41ca74..3379dbf451 100644 --- a/webapp/channels/src/components/channel_notifications_modal/__snapshots__/channel_notifications_modal.test.tsx.snap +++ b/webapp/channels/src/components/channel_notifications_modal/__snapshots__/channel_notifications_modal.test.tsx.snap @@ -63,83 +63,96 @@ Object {
-
-
-

- Mute or ignore -

-
-
+

+ + Mute or ignore + +

+
+
-
- -
-
-

- Turns off notifications for this channel. You'll still see badges if you're mentioned. -

-
-
-
-
+ Mute channel + +
+
+

-

+
+
+
- Ignore mentions for @channel, @here and @all - - + +
+
+

+ When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel +

-

- When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel -

- -
+ +
@@ -270,22 +283,24 @@ Object { class="mm-modal-generic-section-item__content" data-testid="mm-modal-generic-section-item__content" > -
+ -
+
@@ -320,21 +335,23 @@ Object { class="mm-modal-generic-section-item__content" data-testid="mm-modal-generic-section-item__content" > -
+ -
+ @@ -482,83 +499,96 @@ Object {
-
-
-

- Mute or ignore -

-
-
+

+ + Mute or ignore + +

+
+
-
- -
-
-

- Turns off notifications for this channel. You'll still see badges if you're mentioned. -

-
-
-
-
+ Mute channel + +
+
+

-

+
+
+
- Ignore mentions for @channel, @here and @all - - + +
+
+

+ When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel +

-

- When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel -

- -
+ +
@@ -770,21 +800,23 @@ Object { class="mm-modal-generic-section-item__content" data-testid="mm-modal-generic-section-item__content" > -
+ -
+
-
+ -
+
@@ -1039,83 +1073,96 @@ Object {
-
-
-

- Mute or ignore -

-
-
+

+ + Mute or ignore + +

+
+
-
- -
-
-

- Turns off notifications for this channel. You'll still see badges if you're mentioned. -

-
-
-
-
+ Mute channel + +
+
+

-

+
+
+
- Ignore mentions for @channel, @here and @all - - + +
+
+

+ When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel +

-

- When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel -

- -
+ +
-
+ -
+
@@ -1343,83 +1392,96 @@ Object {
-
-
-

- Mute or ignore -

-
-
+

+ + Mute or ignore + +

+
+
-
- -
-
-

- Turns off notifications for this channel. You'll still see badges if you're mentioned. -

-
-
-
-
+ Mute channel + +
+
+

-

+
+
+
- Ignore mentions for @channel, @here and @all - - + +
+
+

+ When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel +

-

- When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel -

- -
+ +
@@ -1631,22 +1693,24 @@ Object { class="mm-modal-generic-section-item__content" data-testid="mm-modal-generic-section-item__content" > -
+ -
+
@@ -1681,21 +1745,23 @@ Object { class="mm-modal-generic-section-item__content" data-testid="mm-modal-generic-section-item__content" > -
+ -
+ @@ -1843,83 +1909,96 @@ Object {
-
-
-

- Mute or ignore -

-
-
+

+ + Mute or ignore + +

+
+
-
- -
-
-

- Turns off notifications for this channel. You'll still see badges if you're mentioned. -

-
-
-
-
+ Mute channel + +
+
+

-

+
+
+
- Ignore mentions for @channel, @here and @all - - + +
+
+

+ When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel +

-

- When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel -

- -
+ +
@@ -2131,22 +2210,24 @@ Object { class="mm-modal-generic-section-item__content" data-testid="mm-modal-generic-section-item__content" > -
+ -
+
@@ -2181,21 +2262,23 @@ Object { class="mm-modal-generic-section-item__content" data-testid="mm-modal-generic-section-item__content" > -
+ -
+ @@ -2343,83 +2426,96 @@ Object {
-
-
-

- Mute or ignore -

-
-
+

+ + Mute or ignore + +

+
+
-
- -
-
-

- Turns off notifications for this channel. You'll still see badges if you're mentioned. -

-
-
-
-
+ Mute channel + +
+
+

-

+
+
+
- Ignore mentions for @channel, @here and @all - - + +
+
+

+ When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel +

-

- When enabled, @channel, @here and @all will not trigger mentions or mention notifications in this channel -

- -
+ +
@@ -2631,22 +2727,24 @@ Object { class="mm-modal-generic-section-item__content" data-testid="mm-modal-generic-section-item__content" > -
+ -
+
diff --git a/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.tsx b/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.tsx index 6779e1021e..b184d50b8b 100644 --- a/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.tsx +++ b/webapp/channels/src/components/channel_notifications_modal/channel_notifications_modal.tsx @@ -364,13 +364,22 @@ export default function ChannelNotificationsModal(props: Props) { handleClose={handleHide} />
- +
+ + {formatMessage({ + id: 'channel_notifications.muteAndIgnore', + defaultMessage: 'Mute or ignore', + })} + + } + content={muteOrIgnoreSectionContent} + /> +
{desktopAndMobileNotificationSectionContent} {props.collapsedReplyThreads && <> diff --git a/webapp/channels/src/components/widgets/modals/components/base_setting_item.scss b/webapp/channels/src/components/widgets/modals/components/base_setting_item.scss index bc9f3111f9..cfc485892d 100644 --- a/webapp/channels/src/components/widgets/modals/components/base_setting_item.scss +++ b/webapp/channels/src/components/widgets/modals/components/base_setting_item.scss @@ -60,12 +60,16 @@ &__fieldset-checkbox-ctr { display: flex; flex-direction: row; + align-items: center; + margin-bottom: 5px; + gap: 8px; } &__fieldset-checkbox { display: flex; flex-direction: row; align-items: center; + margin-bottom: 0; cursor: pointer; font-size: 14px; gap: 8px; diff --git a/webapp/channels/src/components/widgets/modals/components/checkbox_setting_item.tsx b/webapp/channels/src/components/widgets/modals/components/checkbox_setting_item.tsx index c6d11589be..515f33d0b8 100644 --- a/webapp/channels/src/components/widgets/modals/components/checkbox_setting_item.tsx +++ b/webapp/channels/src/components/widgets/modals/components/checkbox_setting_item.tsx @@ -37,22 +37,26 @@ export default function CheckboxSettingItem({ descriptionAboveContent = false, }: Props) { const content = ( -
-
+ ); return (