From 12fea07714550e1a84acb7af1d352f3d1fefe47f Mon Sep 17 00:00:00 2001 From: Saurabh Sharma Date: Wed, 22 Jan 2025 02:18:20 +0530 Subject: [PATCH 1/4] [MM-61633]: Add aria-label in the on-boarding button (#29812) * MM-61633: Add aria-label in the onboarding button * MM-61633: Update formatting * MM-61633: Add strings for localization --------- Co-authored-by: Mattermost Build --- .../components/onboarding_tasklist/onboarding_tasklist.tsx | 4 +++- webapp/channels/src/i18n/en.json | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/webapp/channels/src/components/onboarding_tasklist/onboarding_tasklist.tsx b/webapp/channels/src/components/onboarding_tasklist/onboarding_tasklist.tsx index 7ed0e7c3bc50..679e68955dea 100644 --- a/webapp/channels/src/components/onboarding_tasklist/onboarding_tasklist.tsx +++ b/webapp/channels/src/components/onboarding_tasklist/onboarding_tasklist.tsx @@ -2,7 +2,7 @@ // See LICENSE.txt for license information. import React, {useRef, useCallback, useEffect, useState} from 'react'; -import {FormattedMessage} from 'react-intl'; +import {FormattedMessage, useIntl} from 'react-intl'; import {useDispatch, useSelector} from 'react-redux'; import styled, {css} from 'styled-components'; @@ -126,6 +126,7 @@ const Button = styled.button<{open: boolean}>(({open}) => { }); const OnBoardingTaskList = (): JSX.Element | null => { + const {formatMessage} = useIntl(); const hasPreferences = useSelector((state: GlobalState) => Object.keys(getMyPreferencesSelector(state)).length !== 0); useEffect(() => { @@ -255,6 +256,7 @@ const OnBoardingTaskList = (): JSX.Element | null => { ref={trigger} open={open} data-cy='onboarding-task-list-action-button' + aria-label={formatMessage({id: 'onboardingTask.checklist.start_onboarding_process', defaultMessage: 'Start the onboarding process.'})} > {open ? : } {itemsLeft !== 0 && ({itemsLeft})} diff --git a/webapp/channels/src/i18n/en.json b/webapp/channels/src/i18n/en.json index b3096c6cc763..d69c1995e5e5 100644 --- a/webapp/channels/src/i18n/en.json +++ b/webapp/channels/src/i18n/en.json @@ -4570,6 +4570,7 @@ "onboardingTask.checklist.main_subtitle": "Let's get up and running.", "onboardingTask.checklist.no_thanks": "No, thanks", "onboardingTask.checklist.start_enterprise_now": "Start your free Enterprise trial now!", + "onboardingTask.checklist.start_onboarding_process": "Start the onboarding process.", "onboardingTask.checklist.task_complete_your_profile": "Complete your profile.", "onboardingTask.checklist.task_download_mm_apps": "Download the Desktop and Mobile Apps.", "onboardingTask.checklist.task_invite_team_members": "Invite team members to the workspace.", From faeb6f52accef994076c87c9fffbca7d053ad831 Mon Sep 17 00:00:00 2001 From: ayush-chauhan233 Date: Wed, 22 Jan 2025 04:30:33 +0530 Subject: [PATCH 2/4] [MM-55284]: Fixed adding aria-label logic in team sidebar (#29562) * [MA-6]: Fixed adding aria-label logic in team sidebar * [MA-6]: Updated en.json, added create team button id * [MA-6]: Fix: Added logic to add aria-label to users type * [MA-6]: Fix typo * [MA-6]: Added translation function to team button * [MA-6]: Added translation function to team button --------- Co-authored-by: Mattermost Build --- .../components/team_sidebar/components/team_button.tsx | 2 +- .../src/components/team_sidebar/team_sidebar.tsx | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/webapp/channels/src/components/team_sidebar/components/team_button.tsx b/webapp/channels/src/components/team_sidebar/components/team_button.tsx index 5cc4468c6319..cbd774fc5ec4 100644 --- a/webapp/channels/src/components/team_sidebar/components/team_button.tsx +++ b/webapp/channels/src/components/team_sidebar/components/team_button.tsx @@ -164,7 +164,7 @@ export default function TeamButton({ const teamButton = ( diff --git a/webapp/channels/src/components/team_sidebar/team_sidebar.tsx b/webapp/channels/src/components/team_sidebar/team_sidebar.tsx index fab3dcacb286..d17ab5234ae9 100644 --- a/webapp/channels/src/components/team_sidebar/team_sidebar.tsx +++ b/webapp/channels/src/components/team_sidebar/team_sidebar.tsx @@ -204,7 +204,6 @@ export class TeamSidebar extends React.PureComponent { render() { const {intl} = this.props; - const root: Element | null = document.querySelector('#root'); if (this.props.myTeams.length <= 1) { root!.classList.remove('multi-teams'); @@ -267,6 +266,10 @@ export class TeamSidebar extends React.PureComponent { } content={plusIcon} switchTeam={this.props.actions.switchTeam} + displayName={intl.formatMessage({ + id: 'team_sidebar.join', + defaultMessage: 'Other teams you can join', + })} />, ); } else { @@ -286,6 +289,10 @@ export class TeamSidebar extends React.PureComponent { } content={plusIcon} switchTeam={this.props.actions.switchTeam} + displayName={intl.formatMessage({ + id: 'navbar_dropdown.create', + defaultMessage: 'Create a Team', + })} /> , ); From a08341d398f1c2d348e86d4c4b71899252328506 Mon Sep 17 00:00:00 2001 From: ayush-chauhan233 Date: Wed, 22 Jan 2025 04:36:32 +0530 Subject: [PATCH 3/4] [MA-21]: Added role='alert' to the error message element (#29723) --- .../channel_notifications_modal.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 52bbf8a0bab2..6779e1021ea7 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 @@ -391,7 +391,10 @@ export default function ChannelNotificationsModal(props: Props) {