diff --git a/e2e-tests/cypress/tests/integration/channels/bot_accounts/in_teams_and_channels_spec.ts b/e2e-tests/cypress/tests/integration/channels/bot_accounts/in_teams_and_channels_spec.ts index 2004d4daaa..6baf89138d 100644 --- a/e2e-tests/cypress/tests/integration/channels/bot_accounts/in_teams_and_channels_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/bot_accounts/in_teams_and_channels_spec.ts @@ -73,7 +73,7 @@ describe('Managing bots in Teams and Channels', () => { cy.postMessage(`/invite @${bot.username} `); // * Verify system message in-channel - cy.uiWaitUntilMessagePostedIncludes(`@${bot.username} is not a member of the team.`); + cy.uiWaitUntilMessagePostedIncludes(`You can add @${bot.username} to this channel once they are members of`); }); }); diff --git a/e2e-tests/cypress/tests/integration/channels/channel/channel_info_rhs_spec.ts b/e2e-tests/cypress/tests/integration/channels/channel/channel_info_rhs_spec.ts index 88ae7cda0e..cc35e4ab50 100644 --- a/e2e-tests/cypress/tests/integration/channels/channel/channel_info_rhs_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/channel/channel_info_rhs_spec.ts @@ -239,7 +239,7 @@ describe('Channel Info RHS', () => { cy.uiGetRHS().findByText('Notification Preferences').should('be.visible').click(); // * Ensures the modal is there - cy.get('.channel-notifications-settings-modal').should('be.visible'); + cy.get('.ChannelNotificationModal').should('be.visible'); }); it('should be able to view files and come back', () => { // # Go to test channel @@ -401,7 +401,7 @@ describe('Channel Info RHS', () => { cy.uiGetRHS().findByText('Notification Preferences').should('be.visible').click(); // * Ensures the modal is there - cy.get('.channel-notifications-settings-modal').should('be.visible'); + cy.get('.ChannelNotificationModal').should('be.visible'); }); }); }); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.ts index c11aad30d3..95fb568b85 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/accessibility/accessibility_modals_dialogs_spec.ts @@ -206,7 +206,7 @@ describe('Verify Accessibility Support in Modals & Dialogs', () => { cy.get('#invitePeople').should('be.visible').click(); // * Verify accessibility support in Invite People Dialog - cy.get('.InvitationModal').should('have.attr', 'aria-modal', 'true').and('have.attr', 'aria-labelledby', 'invitation_modal_title').and('have.attr', 'role', 'dialog'); + cy.findByTestId('invitationModal').should('have.attr', 'aria-modal', 'true').and('have.attr', 'aria-labelledby', 'invitation_modal_title').and('have.attr', 'role', 'dialog'); cy.get('#invitation_modal_title').should('be.visible').and('contain.text', 'Invite people to'); // # Press tab diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_guest_access_ui_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_guest_access_ui_spec.ts index 6445bb4f0e..09d222d47d 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_guest_access_ui_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_guest_access_ui_spec.ts @@ -82,8 +82,8 @@ describe('Guest Account - Verify Guest Access UI', () => { // * Verify the confirmation message displayed cy.get('#confirmModal').should('be.visible').within(() => { - cy.get('#confirmModalLabel').should('be.visible').and('have.text', 'Save and Disable Guest Access?'); - cy.get('.modal-body').should('be.visible').and('have.text', 'Disabling guest access will revoke all current Guest Account sessions. Guests will no longer be able to login and new guests cannot be invited into Mattermost. Guest users will be marked as inactive in user lists. Enabling this feature will not reinstate previous guest accounts. Are you sure you wish to remove these users?'); + cy.get('#genericModalLabel').should('be.visible').and('have.text', 'Save and Disable Guest Access?'); + cy.get('.ConfirmModal__body').should('be.visible').and('have.text', 'Disabling guest access will revoke all current Guest Account sessions. Guests will no longer be able to login and new guests cannot be invited into Mattermost. Guest users will be marked as inactive in user lists. Enabling this feature will not reinstate previous guest accounts. Are you sure you wish to remove these users?'); cy.get('#confirmModalButton').should('have.text', 'Save and Disable Guest Access'); }); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_manage_guest_not_cloud_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_manage_guest_not_cloud_spec.ts index 24ae4654f1..bdf1d9ddc5 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_manage_guest_not_cloud_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_manage_guest_not_cloud_spec.ts @@ -65,8 +65,8 @@ describe('Guest Account - Verify Manage Guest Users', () => { // * Verify the confirmation message displayed cy.get('#confirmModal').should('be.visible').within(() => { - cy.get('#confirmModalLabel').should('be.visible').and('have.text', `Deactivate ${guestUser.username}`); - cy.get('.modal-body').should('be.visible').and('have.text', `This action deactivates ${guestUser.username}. They will be logged out and not have access to any teams or channels on this system.\nAre you sure you want to deactivate ${guestUser.username}?`); + cy.get('#genericModalLabel').should('be.visible').and('have.text', `Deactivate ${guestUser.username}`); + cy.get('.modal-body .ConfirmModal__body').should('be.visible').and('have.text', `This action deactivates ${guestUser.username}. They will be logged out and not have access to any teams or channels on this system.\nAre you sure you want to deactivate ${guestUser.username}?`); }); // * Verify the behavior when Cancel button in the confirmation message is clicked diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_manage_guest_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_manage_guest_spec.ts index 796198ab93..c70962e1f8 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_manage_guest_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/guest_accounts/system_console_manage_guest_spec.ts @@ -106,8 +106,8 @@ describe('Guest Account - Verify Manage Guest Users', () => { // * Verify the confirmation message displayed cy.get('#confirmModal').should('be.visible').within(() => { - cy.get('#confirmModalLabel').should('be.visible').and('have.text', `Revoke Sessions for ${guestUser.username}`); - cy.get('.modal-body').should('be.visible').and('have.text', `This action revokes all sessions for ${guestUser.username}. They will be logged out from all devices. Are you sure you want to revoke all sessions for ${guestUser.username}?`); + cy.get('#genericModalLabel').should('be.visible').and('have.text', `Revoke Sessions for ${guestUser.username}`); + cy.get('.modal-body .ConfirmModal__body').should('be.visible').and('have.text', `This action revokes all sessions for ${guestUser.username}. They will be logged out from all devices. Are you sure you want to revoke all sessions for ${guestUser.username}?`); }); // * Verify the behavior when Cancel button in the confirmation message is clicked diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/channel_moderation/channel_mentions_spec.ts b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/channel_moderation/channel_mentions_spec.ts index 7758bb80e8..cc2b6ba37a 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/channel_moderation/channel_mentions_spec.ts +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/channel_moderation/channel_mentions_spec.ts @@ -169,14 +169,14 @@ describe('MM-23102 - Channel Moderation - Channel Mentions', () => { // * Type at all and enter that no confirmation dialogue shows up cy.postMessage('@all '); - cy.get('#confirmModalLabel').should('not.exist'); + cy.get('#genericModalLabel').should('not.exist'); // * Type at channel and enter that no confirmation dialogue shows up cy.postMessage('@channel '); - cy.get('#confirmModalLabel').should('not.exist'); + cy.get('#genericModalLabel').should('not.exist'); // * Type at here and enter that no confirmation dialogue shows up cy.postMessage('@here '); - cy.get('#confirmModalLabel').should('not.exist'); + cy.get('#genericModalLabel').should('not.exist'); }); }); diff --git a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/user_management/user_management_admin_control_spec.js b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/user_management/user_management_admin_control_spec.js index d1eccbb172..df14a3cc79 100644 --- a/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/user_management/user_management_admin_control_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/enterprise/system_console/user_management/user_management_admin_control_spec.js @@ -103,11 +103,11 @@ describe('User Management', () => { function verifyManageUserSettingModal(user, writeAccess) { if (writeAccess) { cy.get('.manageUserSettingsBtn').should('be.visible').should('have.text', 'Manage User Settings').click(); - cy.get('#confirmModalLabel').should('be.visible').should('have.text', `Manage ${user.nickname}'s Settings`); + cy.get('#genericModalLabel').should('be.visible').should('have.text', `Manage ${user.nickname}'s Settings`); cy.get('#cancelModalButton').should('be.visible').should('have.text', 'Cancel'); cy.get('#confirmModalButton').should('be.visible').should('have.text', 'Manage User Settings').click(); - cy.get('h2#accountSettingsModalLabel').should('be.visible').should('have.text', `Manage ${user.nickname}'s Settings`); + cy.get('span#accountSettingsModalLabel').should('be.visible').should('have.text', `Manage ${user.nickname}'s Settings`); cy.get('.adminModeBadge').should('be.visible').should('have.text', 'Admin Mode'); } else { cy.get('.manageUserSettingsBtn').should('not.exist'); diff --git a/e2e-tests/cypress/tests/integration/channels/messaging/permalink_click_spec.js b/e2e-tests/cypress/tests/integration/channels/messaging/permalink_click_spec.js index bed65aa3ee..67a842c41b 100644 --- a/e2e-tests/cypress/tests/integration/channels/messaging/permalink_click_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/messaging/permalink_click_spec.js @@ -127,6 +127,6 @@ function joinPrivateChannel(channel) { function verifyPrivateChannelJoinPromptIsVisible(channel) { // * Verify modal is shown before joining the private channel cy.get('#confirmModal').should('be.visible'); - cy.get('#confirmModalLabel').should('be.visible').and('have.text', 'Join private channel'); + cy.get('#genericModalLabel').should('be.visible').and('have.text', 'Join private channel'); cy.get('#confirmModalBody').should('be.visible').and('have.text', `You are about to join ${channel.name} without explicitly being added by the channel admin. Are you sure you wish to join this private channel?`); } diff --git a/e2e-tests/cypress/tests/integration/channels/notifications/notification_preferences_do_not_save_spec.js b/e2e-tests/cypress/tests/integration/channels/notifications/notification_preferences_do_not_save_spec.js index 165030ea7d..ddf73c68f6 100644 --- a/e2e-tests/cypress/tests/integration/channels/notifications/notification_preferences_do_not_save_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/notifications/notification_preferences_do_not_save_spec.js @@ -55,7 +55,7 @@ describe('Notifications', () => { cy.wait(TIMEOUTS.HALF_SEC); // # Close the modal - cy.get('#accountSettingsHeader').find('button').should('be.visible').click(); + cy.uiClose(); } else { // * Ensure that 'Send email notifications' is set to 'Immediately' cy.get('#emailNotificationImmediately').should('be.visible').and('be.checked'); diff --git a/e2e-tests/cypress/tests/integration/channels/settings/display/channel_display_mode_spec.js b/e2e-tests/cypress/tests/integration/channels/settings/display/channel_display_mode_spec.js index 16ae396810..f7750da925 100644 --- a/e2e-tests/cypress/tests/integration/channels/settings/display/channel_display_mode_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/settings/display/channel_display_mode_spec.js @@ -43,7 +43,6 @@ describe('Settings > Display > Channel Display Mode', () => { cy.get('#channel_display_modeTitle').should('contain', 'Channel Display'); cy.get('#channel_display_modeDesc').should('contain', 'Full width'); cy.get('#channel_display_modeEdit').should('contain', 'Edit'); - cy.get('#accountSettingsHeader > .close').should('be.visible'); }); it('should render in max setting view', () => { @@ -59,7 +58,6 @@ describe('Settings > Display > Channel Display Mode', () => { cy.get('#channel_display_modeFormatB').should('be.visible'); cy.get('#saveSetting').should('contain', 'Save'); cy.get('#cancelSetting').should('contain', 'Cancel'); - cy.get('#accountSettingsHeader > .close').should('be.visible'); }); it('MM-T296 change channel display mode setting to "Full width"', () => { diff --git a/e2e-tests/cypress/tests/integration/channels/settings/display/theme/code_theme_colors_spec.js b/e2e-tests/cypress/tests/integration/channels/settings/display/theme/code_theme_colors_spec.js index c2b0bbfd78..795b811fe8 100644 --- a/e2e-tests/cypress/tests/integration/channels/settings/display/theme/code_theme_colors_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/settings/display/theme/code_theme_colors_spec.js @@ -38,7 +38,10 @@ describe('Settings > Display > Theme > Custom Theme Colors', () => { cy.get('#centerChannelStylesAccordion').click({force: true}).wait(TIMEOUTS.ONE_HUNDRED_MILLIS); // # Select custom code theme - cy.get('#codeThemeSelect').scrollIntoView().should('be.visible').select(theme.name); + cy.get('#codeThemeSelect'). + scrollIntoView({offset: {top: 20, left: 0}}). + should('exist'). + select(theme.name, {force: true}); // * Verify that the setting changes in the background? verifyLastPostStyle(theme); diff --git a/e2e-tests/cypress/tests/integration/channels/settings/display/timezone_display_mode_spec.js b/e2e-tests/cypress/tests/integration/channels/settings/display/timezone_display_mode_spec.js index f65d741b00..8fb29bda4a 100644 --- a/e2e-tests/cypress/tests/integration/channels/settings/display/timezone_display_mode_spec.js +++ b/e2e-tests/cypress/tests/integration/channels/settings/display/timezone_display_mode_spec.js @@ -196,7 +196,7 @@ function setTimezoneDisplayTo(isAutomatic, value) { }); // # Close Settings modal - cy.get('#accountSettingsHeader > .close').should('be.visible').click(); + cy.uiClose(); } function setTimezoneDisplayToAutomatic(value) { diff --git a/e2e-tests/cypress/tests/support/ui/channel_sidebar.ts b/e2e-tests/cypress/tests/support/ui/channel_sidebar.ts index bdbed42164..569a2fec07 100644 --- a/e2e-tests/cypress/tests/support/ui/channel_sidebar.ts +++ b/e2e-tests/cypress/tests/support/ui/channel_sidebar.ts @@ -16,7 +16,7 @@ function uiCreateSidebarCategory(categoryName: string = `category-${getRandomId( // # Click on the sidebar menu dropdown and select Create Category cy.uiBrowseOrCreateChannel('Create new category'); - cy.findByRole('dialog', {name: 'Rename Category'}).should('be.visible').within(() => { + cy.findByRole('dialog', {name: 'Create New Category'}).should('be.visible').within(() => { // # Fill in the category name and click 'Create' cy.findByRole('textbox').should('be.visible').typeWithForce(categoryName). invoke('val').should('equal', categoryName); @@ -59,7 +59,7 @@ function uiMoveChannelToCategory(channelName: string, categoryName: string, newC }); if (newCategory) { - cy.findByRole('dialog', {name: 'Rename Category'}).should('be.visible').within(() => { + cy.findByRole('dialog', {name: 'Create New Category'}).should('be.visible').within(() => { // # Fill in the category name and click 'Create' cy.findByRole('textbox').should('be.visible').typeWithForce(categoryName). invoke('val').should('equal', categoryName); diff --git a/webapp/channels/src/actions/views/onboarding_tasks.ts b/webapp/channels/src/actions/views/onboarding_tasks.ts index d20ad07fc1..968ccbb985 100644 --- a/webapp/channels/src/actions/views/onboarding_tasks.ts +++ b/webapp/channels/src/actions/views/onboarding_tasks.ts @@ -43,8 +43,6 @@ export function openInvitationsModal(timeout = 1): ActionFunc { dispatch(openModal({ modalId: ModalIdentifiers.INVITATION, dialogType: InvitationModal, - dialogProps: { - }, })); }, timeout); return {data: true}; diff --git a/webapp/channels/src/components/admin_console/system_user_detail/__snapshots__/system_user_detail.test.tsx.snap b/webapp/channels/src/components/admin_console/system_user_detail/__snapshots__/system_user_detail.test.tsx.snap index 375df66329..01d7c3fd10 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/__snapshots__/system_user_detail.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/system_user_detail/__snapshots__/system_user_detail.test.tsx.snap @@ -766,6 +766,7 @@ exports[`SystemUserDetail should show manage user settings button as activated 1 diff --git a/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx b/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx index 2684f2d324..295acf2558 100644 --- a/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx +++ b/webapp/channels/src/components/admin_console/system_user_detail/system_user_detail.tsx @@ -302,6 +302,7 @@ export class SystemUserDetail extends PureComponent { dialogProps: { user: this.state.user, onConfirm: this.openUserSettingsModal, + focusOriginElement: 'manageUserSettingsBtn', }, }); }; @@ -318,6 +319,7 @@ export class SystemUserDetail extends PureComponent { adminMode: true, isContentProductSettings: true, userID: this.state.user.id, + focusOriginElement: 'manageUserSettingsBtn', }, }); }; @@ -448,6 +450,7 @@ export class SystemUserDetail extends PureComponent { +
+
+

+
+

+ Notification Preferences +

+
+

+ channel_display_name +

+
+

+
+
- -
-
+
+

+ Desktop Notifications + +

+

+ Available on Chrome, Edge, Firefox, and the Mattermost Desktop App. +

+
+
- - + Notify me about… + +
+
+ + Notify me about… + + + + +
+
-

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

-
- - - -
-
-
-

- Desktop Notifications - -

-

- Available on Chrome, Edge, Firefox, and the Mattermost Desktop App. -

-
-
-
-

- Notify me about… -

+
-
- - Notify me about… - - - - -
-
-
- - -
-
-
-

- Mobile Notifications - -

-

- Notification alerts are pushed to your mobile device when there is activity in Mattermost. -

-
-
-
-
+
- - + Mobile Notifications + + +

+ Notification alerts are pushed to your mobile device when there is activity in Mattermost. +

-
-
-
-
-
-
-
-

- Follow all threads in this channel -

-

- When enabled, all new replies in this channel will be automatically followed and will appear in your Threads view. -

-
-
-
+
+
+
+
+ + +
+
+
+
+
+
- - + Follow all threads in this channel + +

+ When enabled, all new replies in this channel will be automatically followed and will appear in your Threads view. +

-
-
+
+
+
+
+ + +
+
+
+
+ +
- - -
- - - -
+
+ + + +
+ + @@ -458,526 +499,567 @@ Object { class="fade modal-backdrop" /> @@ -1059,244 +1141,285 @@ Object { class="fade modal-backdrop" /> @@ -1378,464 +1501,505 @@ Object { class="fade modal-backdrop" /> @@ -1917,464 +2081,505 @@ Object { class="fade modal-backdrop" /> @@ -2456,413 +2661,454 @@ Object { class="fade modal-backdrop" /> @@ -648,46 +668,34 @@ https://myothersite.com/api/v2" show={false} title="Save Outgoing OAuth Connection" > - - + > + + + @@ -1268,45 +1304,38 @@ https://myothersite.com/api/v2" /> } > - } + modalLocation="center" onHide={[Function]} - renderBackdrop={[Function]} - restoreFocus={true} - role="none" show={false} + showCloseButton={true} + showHeader={true} > - + > + + + @@ -1368,46 +1424,34 @@ https://myothersite.com/api/v2" show={false} title="Save Outgoing OAuth Connection" > - - + > + + + @@ -1987,45 +2059,38 @@ https://myothersite.com/api/v2" /> } > - } + modalLocation="center" onHide={[Function]} - renderBackdrop={[Function]} - restoreFocus={true} - role="none" show={false} + showCloseButton={true} + showHeader={true} > - + > + + + @@ -2087,46 +2179,34 @@ https://myothersite.com/api/v2" show={false} title="Save Outgoing OAuth Connection" > - - + > + + + diff --git a/webapp/channels/src/components/invitation_modal/invitation_modal.scss b/webapp/channels/src/components/invitation_modal/invitation_modal.scss index 45646d93ba..93f461ab7b 100644 --- a/webapp/channels/src/components/invitation_modal/invitation_modal.scss +++ b/webapp/channels/src/components/invitation_modal/invitation_modal.scss @@ -12,5 +12,13 @@ justify-content: center; margin: auto; transform: translate(-50%, -50%) !important; + + } + &__header { + padding-left: 0 !important; + } + + &__footer { + padding-right: 0 !important; } } diff --git a/webapp/channels/src/components/invitation_modal/invitation_modal.test.tsx b/webapp/channels/src/components/invitation_modal/invitation_modal.test.tsx index 6136cca255..5529d042cb 100644 --- a/webapp/channels/src/components/invitation_modal/invitation_modal.test.tsx +++ b/webapp/channels/src/components/invitation_modal/invitation_modal.test.tsx @@ -48,6 +48,7 @@ const defaultProps: Props = deepFreeze({ townSquareDisplayName: '', onExited: jest.fn(), roleForTrackFlow: {started_by_role: General.SYSTEM_USER_ROLE}, + focusOriginElement: 'elementId', }); let props = defaultProps; diff --git a/webapp/channels/src/components/invitation_modal/invitation_modal.tsx b/webapp/channels/src/components/invitation_modal/invitation_modal.tsx index c68e84661a..45656c39c0 100644 --- a/webapp/channels/src/components/invitation_modal/invitation_modal.tsx +++ b/webapp/channels/src/components/invitation_modal/invitation_modal.tsx @@ -2,9 +2,9 @@ // See LICENSE.txt for license information. import React from 'react'; -import {Modal} from 'react-bootstrap'; import {defineMessages} from 'react-intl'; +import {GenericModal} from '@mattermost/components'; import type {Channel} from '@mattermost/types/channels'; import type {Team} from '@mattermost/types/teams'; import type {UserProfile} from '@mattermost/types/users'; @@ -16,6 +16,8 @@ import {isEmail} from 'mattermost-redux/utils/helpers'; import {trackEvent} from 'actions/telemetry_actions'; +import {focusElement} from 'utils/a11y_utils'; + import {InviteType} from './invite_as'; import InviteView, {initializeInviteState} from './invite_view'; import type {InviteState} from './invite_view'; @@ -81,6 +83,7 @@ export type Props = { initialValue?: string; inviteAsGuest?: boolean; roleForTrackFlow: {started_by_role: string}; + focusOriginElement: string; } export const View = { @@ -128,6 +131,11 @@ export default class InvitationModal extends React.PureComponent { this.setState({show: false}); }; + handleExit = () => { + focusElement(this.props.focusOriginElement, true); + this.props.onExited?.(); + }; + toggleCustomMessage = () => { this.setState((state) => ({ ...state, @@ -416,21 +424,21 @@ export default class InvitationModal extends React.PureComponent { } return ( - {view} - + ); } } diff --git a/webapp/channels/src/components/invitation_modal/invite_as.tsx b/webapp/channels/src/components/invitation_modal/invite_as.tsx index 66ba707246..1af0f59e87 100644 --- a/webapp/channels/src/components/invitation_modal/invite_as.tsx +++ b/webapp/channels/src/components/invitation_modal/invite_as.tsx @@ -115,7 +115,7 @@ export default function InviteAs(props: Props) { clickCallback={closeInviteModal} tooltipMessage={hasPriorTrial ? formatMessage({id: 'free.professional_feature.upgrade', defaultMessage: 'Upgrade'}) : undefined} - // the secondary back button first closes the restridted feature modal and then opens back the invitation modal + // the secondary back button first closes the restricted feature modal and then opens back the invitation modal customSecondaryButtonInModal={hasPriorTrial ? undefined : { msg: formatMessage({id: 'free.professional_feature.back', defaultMessage: 'Back'}), action: () => { diff --git a/webapp/channels/src/components/invitation_modal/invite_view.scss b/webapp/channels/src/components/invitation_modal/invite_view.scss index ff3aaaf25f..f39a4feac7 100644 --- a/webapp/channels/src/components/invitation_modal/invite_view.scss +++ b/webapp/channels/src/components/invitation_modal/invite_view.scss @@ -11,9 +11,14 @@ } } + &__header { + padding-left: 0 !important; + } + &__footer { display: flex; justify-content: space-between; + padding-right: 0 !important; // to override clearfix rule in clearfix.less &::before, diff --git a/webapp/channels/src/components/invitation_modal/result_view.tsx b/webapp/channels/src/components/invitation_modal/result_view.tsx index 249f877490..ebc11c5314 100644 --- a/webapp/channels/src/components/invitation_modal/result_view.tsx +++ b/webapp/channels/src/components/invitation_modal/result_view.tsx @@ -1,6 +1,7 @@ // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. +import classNames from 'classnames'; import React from 'react'; import {Modal} from 'react-bootstrap'; import {FormattedMessage} from 'react-intl'; @@ -86,7 +87,7 @@ export default function ResultView(props: Props) { /> )} - + - + } ); } diff --git a/webapp/channels/src/plugins/test/__snapshots__/main_menu_action.test.tsx.snap b/webapp/channels/src/plugins/test/__snapshots__/main_menu_action.test.tsx.snap index 38129186fb..f49f4292e6 100644 --- a/webapp/channels/src/plugins/test/__snapshots__/main_menu_action.test.tsx.snap +++ b/webapp/channels/src/plugins/test/__snapshots__/main_menu_action.test.tsx.snap @@ -67,6 +67,7 @@ exports[`plugins/MainMenuActions should match snapshot in mobile view with some