[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 = (
|
const teamButton = (
|
||||||
<Link
|
<Link
|
||||||
id={`${url.slice(1)}TeamButton`}
|
id={`${url.slice(1)}TeamButton`}
|
||||||
aria-label={ariaLabel}
|
aria-label={isNotCreateTeamButton ? ariaLabel : displayName}
|
||||||
to={url}
|
to={url}
|
||||||
onClick={handleSwitch}
|
onClick={handleSwitch}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -204,7 +204,6 @@ export class TeamSidebar extends React.PureComponent<Props, State> {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {intl} = this.props;
|
const {intl} = this.props;
|
||||||
|
|
||||||
const root: Element | null = document.querySelector('#root');
|
const root: Element | null = document.querySelector('#root');
|
||||||
if (this.props.myTeams.length <= 1) {
|
if (this.props.myTeams.length <= 1) {
|
||||||
root!.classList.remove('multi-teams');
|
root!.classList.remove('multi-teams');
|
||||||
@@ -267,6 +266,10 @@ export class TeamSidebar extends React.PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
content={plusIcon}
|
content={plusIcon}
|
||||||
switchTeam={this.props.actions.switchTeam}
|
switchTeam={this.props.actions.switchTeam}
|
||||||
|
displayName={intl.formatMessage({
|
||||||
|
id: 'team_sidebar.join',
|
||||||
|
defaultMessage: 'Other teams you can join',
|
||||||
|
})}
|
||||||
/>,
|
/>,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -286,6 +289,10 @@ export class TeamSidebar extends React.PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
content={plusIcon}
|
content={plusIcon}
|
||||||
switchTeam={this.props.actions.switchTeam}
|
switchTeam={this.props.actions.switchTeam}
|
||||||
|
displayName={intl.formatMessage({
|
||||||
|
id: 'navbar_dropdown.create',
|
||||||
|
defaultMessage: 'Create a Team',
|
||||||
|
})}
|
||||||
/>
|
/>
|
||||||
</SystemPermissionGate>,
|
</SystemPermissionGate>,
|
||||||
);
|
);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user