[MM-62980][MM-62970] Login and Password Reset accessibility fixes (#31028)

* [MM-62980] Set aria-describedby for Input component when again custom message is set

* [MM-62970] Change password reset send link input to Input

* Fix i18n

* Fix e2e

* fix snapshots

---------

Co-authored-by: yasserfaraazkhan <attitude3cena.yf@gmail.com>
Этот коммит содержится в:
Devin Binnie
2025-05-15 12:23:03 -04:00
коммит произвёл GitHub
родитель 8127d105ad
Коммит 62a93cd36f
8 изменённых файлов: 12 добавлений и 8 удалений

Просмотреть файл

@@ -55,7 +55,7 @@ describe('Authentication', () => {
cy.url().should('contain', '/reset_password'); cy.url().should('contain', '/reset_password');
// # Enter an email that doesn't have an account on the server (but that you CAN receive email at) // # Enter an email that doesn't have an account on the server (but that you CAN receive email at)
cy.findByPlaceholderText('Email').type('test@test.com'); cy.get('#passwordResetEmailInput').type('test@test.com');
cy.findByText('Reset my password').should('be.visible').click(); cy.findByText('Reset my password').should('be.visible').click();

Просмотреть файл

@@ -22,7 +22,7 @@ export default class ResetPasswordPage {
this.title = page.locator('h1:has-text("Password Reset")'); this.title = page.locator('h1:has-text("Password Reset")');
this.subtitle = page.locator('text=To reset your password, enter the email address you used to sign up'); this.subtitle = page.locator('text=To reset your password, enter the email address you used to sign up');
this.emailInput = page.locator(`[placeholder="Email"]`); this.emailInput = page.locator('#passwordResetEmailInput');
this.resetButton = page.locator('#passwordResetButton'); this.resetButton = page.locator('#passwordResetButton');
this.formContainer = page.locator('.signup-team__container'); this.formContainer = page.locator('.signup-team__container');

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 185 KiB

После

Ширина:  |  Высота:  |  Размер: 185 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 208 KiB

После

Ширина:  |  Высота:  |  Размер: 209 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 210 KiB

После

Ширина:  |  Высота:  |  Размер: 211 KiB

Просмотреть файл

@@ -9,7 +9,7 @@ import type {ActionResult} from 'mattermost-redux/types/actions';
import {isEmail} from 'mattermost-redux/utils/helpers'; import {isEmail} from 'mattermost-redux/utils/helpers';
import BackButton from 'components/common/back_button'; import BackButton from 'components/common/back_button';
import LocalizedPlaceholderInput from 'components/localized_placeholder_input'; import Input from 'components/widgets/inputs/input/input';
export interface Props { export interface Props {
intl: IntlShape; intl: IntlShape;
@@ -134,15 +134,18 @@ export class PasswordResetSendLink extends React.PureComponent<Props, State> {
/> />
</p> </p>
<div className={formClass}> <div className={formClass}>
<LocalizedPlaceholderInput <Input
id='passwordResetEmailInput' id='passwordResetEmailInput'
type='email' type='email'
className='form-control'
name='email' name='email'
placeholder={defineMessage({ label={defineMessage({
id: 'password_send.email', id: 'password_send.email',
defaultMessage: 'Email', defaultMessage: 'Email',
})} })}
placeholder={defineMessage({
id: 'password_send.email.placeholder',
defaultMessage: 'Enter the email address you used to sign up',
})}
ref={this.emailInput} ref={this.emailInput}
spellCheck='false' spellCheck='false'
autoFocus={true} autoFocus={true}

Просмотреть файл

@@ -210,7 +210,7 @@ const Input = React.forwardRef((
value={value} value={value}
placeholder={placeholderValue} placeholder={placeholderValue}
aria-label={ariaLabel} aria-label={ariaLabel}
aria-describedby={error ? errorId : undefined} aria-describedby={customInputLabel ? errorId : undefined}
aria-invalid={error || hasError || limitExceeded > 0} aria-invalid={error || hasError || limitExceeded > 0}
rows={3} rows={3}
name={name} name={name}
@@ -230,7 +230,7 @@ const Input = React.forwardRef((
value={value} value={value}
placeholder={placeholderValue} placeholder={placeholderValue}
aria-label={ariaLabel} aria-label={ariaLabel}
aria-describedby={error ? errorId : undefined} aria-describedby={customInputLabel ? errorId : undefined}
aria-invalid={error || hasError || limitExceeded > 0} aria-invalid={error || hasError || limitExceeded > 0}
name={name} name={name}
disabled={disabled} disabled={disabled}

Просмотреть файл

@@ -4840,6 +4840,7 @@
"password_send.checkInbox": "Please check your inbox.", "password_send.checkInbox": "Please check your inbox.",
"password_send.description": "To reset your password, enter the email address you used to sign up", "password_send.description": "To reset your password, enter the email address you used to sign up",
"password_send.email": "Email", "password_send.email": "Email",
"password_send.email.placeholder": "Enter the email address you used to sign up",
"password_send.error": "Please enter a valid email address.", "password_send.error": "Please enter a valid email address.",
"password_send.link": "If the account exists, a password reset email will be sent to:", "password_send.link": "If the account exists, a password reset email will be sent to:",
"password_send.reset": "Reset my password", "password_send.reset": "Reset my password",