[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 <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
12fea07714
Коммит
faeb6f52ac
@@ -164,7 +164,7 @@ export default function TeamButton({
|
||||
const teamButton = (
|
||||
<Link
|
||||
id={`${url.slice(1)}TeamButton`}
|
||||
aria-label={ariaLabel}
|
||||
aria-label={isNotCreateTeamButton ? ariaLabel : displayName}
|
||||
to={url}
|
||||
onClick={handleSwitch}
|
||||
>
|
||||
|
||||
@@ -204,7 +204,6 @@ export class TeamSidebar extends React.PureComponent<Props, State> {
|
||||
|
||||
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<Props, State> {
|
||||
}
|
||||
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<Props, State> {
|
||||
}
|
||||
content={plusIcon}
|
||||
switchTeam={this.props.actions.switchTeam}
|
||||
displayName={intl.formatMessage({
|
||||
id: 'navbar_dropdown.create',
|
||||
defaultMessage: 'Create a Team',
|
||||
})}
|
||||
/>
|
||||
</SystemPermissionGate>,
|
||||
);
|
||||
|
||||
Ссылка в новой задаче
Block a user