From 5c8909459f973c58f2ca1f5eef9e2acb129b4dbb Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Tue, 7 Feb 2023 11:21:45 +0200 Subject: [PATCH] [Unified search] Fixes ally issues --- .../public/filter_bar/filter_editor/phrase_value_input.tsx | 4 ++++ .../public/filter_bar/filter_editor/phrases_values_input.tsx | 4 ++++ .../public/filter_bar/filter_editor/value_input_type.tsx | 5 +++++ .../public/filters_builder/filter_item/field_input.tsx | 1 + .../public/filters_builder/filter_item/filter_item.tsx | 1 + .../public/filters_builder/filter_item/operator_input.tsx | 1 + 6 files changed, 16 insertions(+) diff --git a/src/plugins/unified_search/public/filter_bar/filter_editor/phrase_value_input.tsx b/src/plugins/unified_search/public/filter_bar/filter_editor/phrase_value_input.tsx index ff5fbc97477ca..ae87024bb61a9 100644 --- a/src/plugins/unified_search/public/filter_bar/filter_editor/phrase_value_input.tsx +++ b/src/plugins/unified_search/public/filter_bar/filter_editor/phrase_value_input.tsx @@ -78,6 +78,10 @@ class PhraseValueInputUI extends PhraseSuggestorUI { id: 'unifiedSearch.filter.filterEditor.valueSelectPlaceholder', defaultMessage: 'Select a value', })} + aria-label={intl.formatMessage({ + id: 'unifiedSearch.filter.filterEditor.valueSelectPlaceholder', + defaultMessage: 'Select a value', + })} options={options} getLabel={(option) => option} selectedOptions={value ? [valueAsStr] : []} diff --git a/src/plugins/unified_search/public/filter_bar/filter_editor/phrases_values_input.tsx b/src/plugins/unified_search/public/filter_bar/filter_editor/phrases_values_input.tsx index c1cb11f816535..336849c4ee65a 100644 --- a/src/plugins/unified_search/public/filter_bar/filter_editor/phrases_values_input.tsx +++ b/src/plugins/unified_search/public/filter_bar/filter_editor/phrases_values_input.tsx @@ -54,6 +54,10 @@ class PhrasesValuesInputUI extends PhraseSuggestorUI { id: 'unifiedSearch.filter.filterEditor.valuesSelectPlaceholder', defaultMessage: 'Select values', })} + aria-label={intl.formatMessage({ + id: 'unifiedSearch.filter.filterEditor.valuesSelectPlaceholder', + defaultMessage: 'Select values', + })} delimiter="," isCaseSensitive={true} options={options} diff --git a/src/plugins/unified_search/public/filter_bar/filter_editor/value_input_type.tsx b/src/plugins/unified_search/public/filter_bar/filter_editor/value_input_type.tsx index fc53c0e4631f7..f12c29897ff50 100644 --- a/src/plugins/unified_search/public/filter_bar/filter_editor/value_input_type.tsx +++ b/src/plugins/unified_search/public/filter_bar/filter_editor/value_input_type.tsx @@ -50,6 +50,7 @@ class ValueInputTypeUI extends Component { disabled={this.props.disabled} fullWidth={this.props.fullWidth} placeholder={this.props.placeholder} + aria-label={this.props.placeholder} value={value} onChange={this.onChange} isInvalid={!validateParams(value, this.props.field)} @@ -67,6 +68,7 @@ class ValueInputTypeUI extends Component { disabled={this.props.disabled} fullWidth={this.props.fullWidth} placeholder={this.props.placeholder} + aria-label={this.props.placeholder} value={this.getValueForNumberField(value)} onChange={this.onChange} controlOnly={this.props.controlOnly} @@ -83,6 +85,7 @@ class ValueInputTypeUI extends Component { disabled={this.props.disabled} fullWidth={this.props.fullWidth} placeholder={this.props.placeholder} + aria-label={this.props.placeholder} value={value} onChange={this.onChange} onBlur={this.onBlur} @@ -100,6 +103,7 @@ class ValueInputTypeUI extends Component { fullWidth={this.props.fullWidth} disabled={this.props.disabled} placeholder={this.props.placeholder} + aria-label={this.props.placeholder} value={value} onChange={this.onChange} isInvalid={!isEmpty(value) && !validateParams(value, this.props.field)} @@ -132,6 +136,7 @@ class ValueInputTypeUI extends Component { ]} value={value} onChange={this.onBoolChange} + aria-label={this.props.placeholder} className={this.props.className} fullWidth={this.props.fullWidth} compressed={this.props.compressed} diff --git a/src/plugins/unified_search/public/filters_builder/filter_item/field_input.tsx b/src/plugins/unified_search/public/filters_builder/filter_item/field_input.tsx index cbfe059b09263..7d2f3ac8cfa3d 100644 --- a/src/plugins/unified_search/public/filters_builder/filter_item/field_input.tsx +++ b/src/plugins/unified_search/public/filters_builder/filter_item/field_input.tsx @@ -84,6 +84,7 @@ export function FieldInput({ field, dataView, onHandleField }: FieldInputProps) placeholder={strings.getFieldSelectPlaceholderLabel()} sortMatchesBy="startsWith" singleSelection={{ asPlainText: true }} + aria-label={strings.getFieldSelectPlaceholderLabel()} isClearable={false} compressed fullWidth diff --git a/src/plugins/unified_search/public/filters_builder/filter_item/filter_item.tsx b/src/plugins/unified_search/public/filters_builder/filter_item/filter_item.tsx index b24429860d416..ac8fefa26a99f 100644 --- a/src/plugins/unified_search/public/filters_builder/filter_item/filter_item.tsx +++ b/src/plugins/unified_search/public/filters_builder/filter_item/filter_item.tsx @@ -240,6 +240,7 @@ export function FilterItem({ })} > ({ compressed isDisabled={!field || disabled} placeholder={strings.getOperatorSelectPlaceholderSelectLabel()} + aria-label={strings.getOperatorSelectPlaceholderSelectLabel()} options={operators} selectedOptions={operator ? [operator] : []} getLabel={({ message }) => message}