Add aria labels to fields (#54510)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
b7f37822a2
commit
2927373f8b
|
@ -52,11 +52,14 @@ export const MetricsExplorerAggregationPicker = ({ options, onChange }: Props) =
|
|||
[onChange]
|
||||
);
|
||||
|
||||
const placeholder = i18n.translate('xpack.infra.metricsExplorer.aggregationSelectLabel', {
|
||||
defaultMessage: 'Select an aggregation',
|
||||
});
|
||||
|
||||
return (
|
||||
<EuiSelect
|
||||
placeholder={i18n.translate('xpack.infra.metricsExplorer.aggregationSelectLabel', {
|
||||
defaultMessage: 'Select an aggregation',
|
||||
})}
|
||||
aria-label={placeholder}
|
||||
placeholder={placeholder}
|
||||
fullWidth
|
||||
value={options.aggregation}
|
||||
options={METRIC_EXPLORER_AGGREGATIONS.map(k => ({
|
||||
|
|
|
@ -44,6 +44,9 @@ export const MetricsExplorerGroupBy = ({ options, onChange, fields }: Props) =>
|
|||
placeholder={i18n.translate('xpack.infra.metricsExplorer.groupByLabel', {
|
||||
defaultMessage: 'Everything',
|
||||
})}
|
||||
aria-label={i18n.translate('xpack.infra.metricsExplorer.groupByAriaLabel', {
|
||||
defaultMessage: 'Graph per',
|
||||
})}
|
||||
fullWidth
|
||||
singleSelection={true}
|
||||
selectedOptions={(options.groupBy && [{ label: options.groupBy }]) || []}
|
||||
|
|
|
@ -48,18 +48,21 @@ export const MetricsExplorerKueryBar = ({ derivedIndexPattern, onSubmit, value }
|
|||
fields: derivedIndexPattern.fields.filter(field => isDisplayable(field)),
|
||||
};
|
||||
|
||||
const placeholder = i18n.translate('xpack.infra.homePage.toolbar.kqlSearchFieldPlaceholder', {
|
||||
defaultMessage: 'Search for infrastructure data… (e.g. host.name:host-1)',
|
||||
});
|
||||
|
||||
return (
|
||||
<WithKueryAutocompletion indexPattern={filteredDerivedIndexPattern}>
|
||||
{({ isLoadingSuggestions, loadSuggestions, suggestions }) => (
|
||||
<AutocompleteField
|
||||
aria-label={placeholder}
|
||||
isLoadingSuggestions={isLoadingSuggestions}
|
||||
isValid={isValid}
|
||||
loadSuggestions={loadSuggestions}
|
||||
onChange={handleChange}
|
||||
onSubmit={onSubmit}
|
||||
placeholder={i18n.translate('xpack.infra.homePage.toolbar.kqlSearchFieldPlaceholder', {
|
||||
defaultMessage: 'Search for infrastructure data… (e.g. host.name:host-1)',
|
||||
})}
|
||||
placeholder={placeholder}
|
||||
suggestions={suggestions}
|
||||
value={draftQuery}
|
||||
/>
|
||||
|
|
|
@ -71,6 +71,7 @@ export const MetricsExplorerMetrics = ({ options, onChange, fields, autoFocus =
|
|||
|
||||
return (
|
||||
<EuiComboBox
|
||||
aria-label={placeholderText}
|
||||
isDisabled={options.aggregation === 'count'}
|
||||
placeholder={placeholderText}
|
||||
fullWidth
|
||||
|
|
Loading…
Reference in a new issue