From 658ee17262b4c787b366e6d2486a9622d76c24d9 Mon Sep 17 00:00:00 2001 From: Kerry Gallagher Date: Fri, 2 Aug 2019 11:44:53 +0100 Subject: [PATCH] [InfraUI] [LogsUI] Accessibility fixes (#41883) * Fixes #40411 - Add aria-label to search input * Fixes #40425 - Align gear icon aria-labels * Fixes #40419 - Make use of EuiDescribedFormGroup in the source configuration panel * Add data-test-subj attribute back for functional test * Revert "Fixes #40419 - Make use of EuiDescribedFormGroup in the source configuration panel" This reverts commit 5075777e537a11c7e14c319dae6ab079ef37b345. --- .../autocomplete_field/autocomplete_field.tsx | 11 ++++++++++- .../logging/log_text_stream/column_headers.tsx | 2 +- .../plugins/infra/public/pages/logs/page_toolbar.tsx | 4 ++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/x-pack/legacy/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx b/x-pack/legacy/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx index 2e8d99bdf5419..940d187f2f3a0 100644 --- a/x-pack/legacy/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx +++ b/x-pack/legacy/plugins/infra/public/components/autocomplete_field/autocomplete_field.tsx @@ -28,6 +28,7 @@ interface AutocompleteFieldProps { suggestions: AutocompleteSuggestion[]; value: string; autoFocus?: boolean; + 'aria-label'?: string; } interface AutocompleteFieldState { @@ -49,7 +50,14 @@ export class AutocompleteField extends React.Component< private inputElement: HTMLInputElement | null = null; public render() { - const { suggestions, isLoadingSuggestions, isValid, placeholder, value } = this.props; + const { + suggestions, + isLoadingSuggestions, + isValid, + placeholder, + value, + 'aria-label': ariaLabel, + } = this.props; const { areSuggestionsVisible, selectedIndex } = this.state; return ( @@ -67,6 +75,7 @@ export class AutocompleteField extends React.Component< onSearch={this.submit} placeholder={placeholder} value={value} + aria-label={ariaLabel} /> {areSuggestionsVisible && !isLoadingSuggestions && suggestions.length > 0 ? ( diff --git a/x-pack/legacy/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx b/x-pack/legacy/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx index c49178a92f8dc..398ef42048d70 100644 --- a/x-pack/legacy/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx +++ b/x-pack/legacy/plugins/infra/public/components/logging/log_text_stream/column_headers.tsx @@ -31,7 +31,7 @@ export const LogColumnHeaders = injectI18n<{ }>(({ columnConfigurations, columnWidths, intl, showColumnConfiguration }) => { const showColumnConfigurationLabel = intl.formatMessage({ id: 'xpack.infra.logColumnHeaders.configureColumnsLabel', - defaultMessage: 'Configure columns', + defaultMessage: 'Configure source', }); return ( diff --git a/x-pack/legacy/plugins/infra/public/pages/logs/page_toolbar.tsx b/x-pack/legacy/plugins/infra/public/pages/logs/page_toolbar.tsx index 2255cbff3d0cd..a6300ccd1daf8 100644 --- a/x-pack/legacy/plugins/infra/public/pages/logs/page_toolbar.tsx +++ b/x-pack/legacy/plugins/infra/public/pages/logs/page_toolbar.tsx @@ -80,6 +80,10 @@ export const LogsToolbar = injectI18n(({ intl }) => { })} suggestions={suggestions} value={filterQueryDraft ? filterQueryDraft.expression : ''} + aria-label={intl.formatMessage({ + id: 'xpack.infra.logsPage.toolbar.kqlSearchFieldAriaLabel', + defaultMessage: 'Search for log entries', + })} /> )}