mirror of
https://github.com/Unleash/unleash.git
synced 2025-02-23 00:22:19 +01:00
refactor: misc login page accessibility improvements (#914)
* refactor: add missing input field labels * refactor: add missing className prop * refactor: add missing image labels * refactor: fix forgot password title size * refactor fix StandaloneLayout page landmarks * refactor: improve project page title * refactor: add autoFocus to login fields
This commit is contained in:
parent
f7266cde10
commit
531d969fa6
@ -4,6 +4,7 @@ interface IGradientProps {
|
||||
from: string;
|
||||
to: string;
|
||||
style?: object;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const Gradient: React.FC<IGradientProps> = ({
|
||||
|
@ -49,7 +49,7 @@ export const ProjectFeatureToggles = ({
|
||||
headerContent={
|
||||
<HeaderTitle
|
||||
className={styles.title}
|
||||
title={`Project features (${filteredFeatures.length})`}
|
||||
title={`Project feature toggles (${filteredFeatures.length})`}
|
||||
actions={
|
||||
<div className={styles.actionsContainer}>
|
||||
<SearchField
|
||||
|
@ -36,7 +36,7 @@ const DemoAuth = ({ authDetails, redirect }) => {
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit}>
|
||||
<Logo className={styles.logo} />
|
||||
<Logo className={styles.logo} aria-label="Unleash logo" />
|
||||
<div className={styles.container}>
|
||||
<h2>Access the Unleash demo instance</h2>
|
||||
<p>No further data or Credit Card required</p>
|
||||
@ -50,6 +50,7 @@ const DemoAuth = ({ authDetails, redirect }) => {
|
||||
variant="outlined"
|
||||
label="Email"
|
||||
name="email"
|
||||
id="email"
|
||||
data-testid={LOGIN_EMAIL_ID}
|
||||
required
|
||||
type="email"
|
||||
|
@ -49,8 +49,7 @@ const ForgottenPassword = () => {
|
||||
)}
|
||||
ref={ref}
|
||||
>
|
||||
<Typography
|
||||
variant="h2"
|
||||
<h2
|
||||
className={classnames(
|
||||
commonStyles.title,
|
||||
commonStyles.textCenter
|
||||
@ -58,7 +57,7 @@ const ForgottenPassword = () => {
|
||||
data-loading
|
||||
>
|
||||
Forgotten password
|
||||
</Typography>
|
||||
</h2>
|
||||
<ConditionallyRender
|
||||
condition={attempted}
|
||||
show={
|
||||
|
@ -102,6 +102,7 @@ const HostedAuth = ({ authDetails, redirect }) => {
|
||||
<TextField
|
||||
label="Username or email"
|
||||
name="username"
|
||||
id="username"
|
||||
type="string"
|
||||
onChange={evt => setUsername(evt.target.value)}
|
||||
value={username}
|
||||
@ -115,6 +116,7 @@ const HostedAuth = ({ authDetails, redirect }) => {
|
||||
label="Password"
|
||||
onChange={evt => setPassword(evt.target.value)}
|
||||
name="password"
|
||||
id="password"
|
||||
value={password}
|
||||
error={!!passwordError}
|
||||
helperText={passwordError}
|
||||
|
@ -63,6 +63,8 @@ export const NewUser = () => {
|
||||
<TextField
|
||||
data-loading
|
||||
value={data?.email || ''}
|
||||
id="username"
|
||||
label="Username"
|
||||
variant="outlined"
|
||||
size="small"
|
||||
className={styles.emailField}
|
||||
|
@ -102,6 +102,7 @@ const PasswordAuth = ({ authDetails, redirect }) => {
|
||||
<TextField
|
||||
label="Username or email"
|
||||
name="username"
|
||||
id="username"
|
||||
type="string"
|
||||
onChange={evt => setUsername(evt.target.value)}
|
||||
value={username}
|
||||
@ -111,11 +112,13 @@ const PasswordAuth = ({ authDetails, redirect }) => {
|
||||
data-testid={LOGIN_EMAIL_ID}
|
||||
variant="outlined"
|
||||
size="small"
|
||||
autoFocus
|
||||
/>
|
||||
<PasswordField
|
||||
label="Password"
|
||||
onChange={evt => setPassword(evt.target.value)}
|
||||
name="password"
|
||||
id="password"
|
||||
value={password}
|
||||
error={!!passwordError}
|
||||
helperText={passwordError}
|
||||
|
@ -56,9 +56,11 @@ const SimpleAuth = ({ authDetails, redirect }) => {
|
||||
variant="outlined"
|
||||
label="Email"
|
||||
name="email"
|
||||
id="email"
|
||||
required
|
||||
type="email"
|
||||
data-testid={LOGIN_EMAIL_ID}
|
||||
autoFocus
|
||||
/>
|
||||
<br />
|
||||
|
||||
|
@ -20,7 +20,6 @@ const StandaloneBanner: FC<IStandaloneBannerProps> = ({ title, children }) => {
|
||||
from={theme.palette.primary.main}
|
||||
// @ts-expect-error
|
||||
to={theme.palette.login.gradient.bottom}
|
||||
// @ts-expect-error
|
||||
className={styles.gradient}
|
||||
>
|
||||
<div className={styles.container}>
|
||||
@ -35,8 +34,18 @@ const StandaloneBanner: FC<IStandaloneBannerProps> = ({ title, children }) => {
|
||||
<div className={styles.logoContainer}>
|
||||
<ConditionallyRender
|
||||
condition={smallScreen}
|
||||
show={<LogoWithText className={styles.logo} />}
|
||||
elseShow={<Logo className={styles.logo} />}
|
||||
show={
|
||||
<LogoWithText
|
||||
className={styles.logo}
|
||||
aria-label="Unleash logo"
|
||||
/>
|
||||
}
|
||||
elseShow={
|
||||
<Logo
|
||||
className={styles.logo}
|
||||
aria-label="Unleash logo"
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</Gradient>
|
||||
|
@ -21,10 +21,10 @@ const StandaloneLayout: FC<IStandaloneLayout> = ({
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
<div className={styles.leftContainer}>{banner}</div>
|
||||
<div className={styles.rightContainer}>
|
||||
<header className={styles.leftContainer}>{banner}</header>
|
||||
<main className={styles.rightContainer}>
|
||||
<div className={styles.innerRightContainer}>{children}</div>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user