Add aria labels to fields (#54510)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Phillip Burch 2020-01-14 08:46:49 -06:00 committed by GitHub
parent b7f37822a2
commit 2927373f8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 6 deletions

View file

@ -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 => ({

View file

@ -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 }]) || []}

View file

@ -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}
/>

View file

@ -71,6 +71,7 @@ export const MetricsExplorerMetrics = ({ options, onChange, fields, autoFocus =
return (
<EuiComboBox
aria-label={placeholderText}
isDisabled={options.aggregation === 'count'}
placeholder={placeholderText}
fullWidth