[Snapshot Restore] Fix a11y issue in policy form (#169635)

Fixes https://github.com/elastic/kibana/issues/153788

## Summary

This PR fixes the a11y issue in the "Create policy" form for the two
"Expiration" fields.

**Before:**
<img width="1674" alt="Screenshot 2023-10-24 at 12 06 03"
src="8ac5d406-8b84-418c-a327-7edf2d8dac3d">



**After:**
<img width="1674" alt="Screenshot 2023-10-24 at 12 06 35"
src="e09689c6-8d0c-43a9-9e97-b63cca2d060d">



The aria-labels can also be tested with a screen reader (e.g. VoiceOver
on Mac).
This commit is contained in:
Elena Stoeva 2023-10-27 12:46:03 +01:00 committed by GitHub
parent 6e21d81091
commit 7ef118ce79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View file

@ -18,6 +18,7 @@ import {
EuiSelect,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { SlmPolicyPayload } from '../../../../../common/types';
import { TIME_UNITS } from '../../../../../common/constants';
import { StepProps } from '.';
@ -102,6 +103,12 @@ export const PolicyStepRetention: React.FunctionComponent<StepProps> = ({
}}
data-test-subj="expireAfterValueInput"
min={0}
aria-label={i18n.translate(
'xpack.snapshotRestore.policyForm.stepRetention.expireAfterAriaLabel',
{
defaultMessage: 'Expiration time input',
}
)}
/>
</EuiFlexItem>
<EuiFlexItem>
@ -116,6 +123,12 @@ export const PolicyStepRetention: React.FunctionComponent<StepProps> = ({
});
}}
data-test-subj="expireAfterUnitSelect"
aria-label={i18n.translate(
'xpack.snapshotRestore.policyForm.stepRetention.expireAfterUnitsAriaLabel',
{
defaultMessage: 'Expiration time units selection',
}
)}
/>
</EuiFlexItem>
</EuiFlexGroup>

View file

@ -47,8 +47,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) {
// Please make sure that the remote clusters, snapshot and restore and
// CCR tests stay in that order. Their execution fails if rearranged.
require.resolve('./apps/remote_clusters'),
// https://github.com/elastic/kibana/issues/153788
// require.resolve('./apps/snapshot_and_restore'),
require.resolve('./apps/snapshot_and_restore'),
// https://github.com/elastic/kibana/issues/153599
// require.resolve('./apps/cross_cluster_replication'),
require.resolve('./apps/reporting'),