Skip to content

Commit 9a2dc53

Browse files
authored
fix: [Platform:StackManagement:SnapshotAndRestore:Add repository page]Missing error warning announcement (#220633)
Closes: #219355 Closes: #219345 ## Summary This PR improves accessibility for users relying on assistive technologies for: `Analytics → Stack Management → Snapshot and Restore` by addressing the following: 1. Screen Reader Announcements for Error Warnings 2. Duplication of announcement
1 parent ed1f558 commit 9a2dc53

File tree

7 files changed

+13
-3
lines changed

7 files changed

+13
-3
lines changed

src/platform/plugins/shared/es_ui_shared/__packages_do_not_import__/authorization/components/section_error.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const SectionError: React.FunctionComponent<Props> = ({
3030
} = error;
3131

3232
return (
33-
<EuiCallOut title={title} color="danger" iconType="warning" {...rest}>
33+
<EuiCallOut title={title} role="alert" color="danger" iconType="warning" {...rest}>
3434
{cause ? message || errorString : <p>{message || errorString}</p>}
3535
{cause && (
3636
<Fragment>

x-pack/platform/plugins/private/snapshot_restore/public/application/components/policy_form/steps/step_logistics.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ export const PolicyStepLogistics: React.FunctionComponent<StepProps> = ({
529529
defaultMessage="Repository not found"
530530
/>
531531
}
532+
role="alert"
532533
color="danger"
533534
iconType="warning"
534535
>

x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ export const RepositoryFormStepOne: React.FunctionComponent<Props> = ({
352352
defaultMessage="Fix errors before continuing."
353353
/>
354354
}
355+
role="alert"
355356
color="danger"
356357
data-test-subj="repositoryFormError"
357358
/>

x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_two.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export const RepositoryFormStepTwo: React.FunctionComponent<Props> = ({
171171
defaultMessage="Fix errors before continuing."
172172
/>
173173
}
174+
role="alert"
174175
color="danger"
175176
iconType="cross"
176177
data-test-subj="repositoryFormError"

x-pack/platform/plugins/private/snapshot_restore/public/application/components/retention_update_modal_provider.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
EuiSpacer,
2222
EuiText,
2323
EuiCallOut,
24+
useGeneratedHtmlId,
2425
} from '@elastic/eui';
2526

2627
import { useCore, useServices, useToastNotifications } from '../app_context';
@@ -45,6 +46,7 @@ export const RetentionSettingsUpdateModalProvider: React.FunctionComponent<Props
4546
const { i18n } = useServices();
4647
const { docLinks } = useCore();
4748
const toastNotifications = useToastNotifications();
49+
const modalTitleId = useGeneratedHtmlId();
4850

4951
const [retentionSchedule, setRetentionSchedule] = useState<string>(DEFAULT_RETENTION_SCHEDULE);
5052
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
@@ -128,9 +130,9 @@ export const RetentionSettingsUpdateModalProvider: React.FunctionComponent<Props
128130
}
129131

130132
return (
131-
<EuiModal onClose={closeModal}>
133+
<EuiModal onClose={closeModal} aria-labelledby={modalTitleId}>
132134
<EuiModalHeader>
133-
<EuiModalHeaderTitle>
135+
<EuiModalHeaderTitle id={modalTitleId}>
134136
{isEditing ? (
135137
<FormattedMessage
136138
id="xpack.snapshotRestore.policyForm.stepRetention.policyUpdateRetentionEditTitle"
@@ -155,6 +157,7 @@ export const RetentionSettingsUpdateModalProvider: React.FunctionComponent<Props
155157
defaultMessage="Error saving retention schedule"
156158
/>
157159
}
160+
role="alert"
158161
color="danger"
159162
iconType="warning"
160163
>

x-pack/platform/plugins/private/snapshot_restore/public/application/sections/home/policy_list/policy_retention_schedule/policy_retention_schedule.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export const PolicyRetentionSchedule: React.FunctionComponent<Props> = ({
7979
defaultMessage="Run retention now"
8080
/>
8181
}
82+
disableScreenReaderOutput
8283
>
8384
<EuiButtonIcon
8485
iconType="play"
@@ -108,6 +109,7 @@ export const PolicyRetentionSchedule: React.FunctionComponent<Props> = ({
108109
defaultMessage="Edit retention schedule"
109110
/>
110111
}
112+
disableScreenReaderOutput
111113
>
112114
<EuiButtonIcon
113115
iconType="pencil"
@@ -254,6 +256,7 @@ export const PolicyRetentionSchedule: React.FunctionComponent<Props> = ({
254256
defaultMessage="Error fetching retention schedule"
255257
/>
256258
}
259+
role="alert"
257260
color="danger"
258261
iconType="warning"
259262
>

x-pack/platform/plugins/private/snapshot_restore/public/application/sections/home/snapshot_list/components/snapshot_search_bar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ export const SnapshotSearchBar: React.FunctionComponent<Props> = ({
169169
<EuiCallOut
170170
data-test-subj="snapshotListSearchError"
171171
iconType="warning"
172+
role="alert"
172173
color="danger"
173174
title={
174175
<FormattedMessage

0 commit comments

Comments
 (0)