Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ export function Sort({ type, onChange }: Props) {
return (
<EuiSelect
data-test-subj="apmSortSelect"
aria-label={i18n.translate('xpack.apm.serviceGroups.list.sort.ariaLabel', {
defaultMessage: 'Sort service groups by',
})}
options={options}
value={type}
onChange={(e) => onChange(e.target.value as ServiceGroupsSortType)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { i18n } from '@kbn/i18n';
import React, { Fragment } from 'react';
import styled from '@emotion/styled';
import { isEmpty } from 'lodash';
import { css } from '@emotion/react';

interface KeyValue {
key: string;
Expand Down Expand Up @@ -79,23 +80,41 @@ export function KeyValueFilterList({
<Fragment key={key}>
<EuiDescriptionListTitle
className="descriptionList__title"
style={{ height: '40px' }}
css={css`
height: 40px;
`}
>
<EuiText size="s" style={{ fontWeight: 'bold' }}>
<EuiText
size="s"
css={css`
font-weight: bold;
`}
>
{key}
</EuiText>
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
className="descriptionList__description"
style={{ height: '40px' }}
css={css`
height: 40px;
`}
>
<EuiFlexGroup alignItems="baseline" responsive={false} gutterSize="none">
<EuiFlexItem style={{ minWidth: '32px' }} grow={false}>
<EuiFlexItem
css={css`
min-width: 32px;
`}
grow={false}
>
{isFilterable && (
<EuiButtonEmpty
onClick={() => {
onClickFilter({ key, value });
}}
aria-label={i18n.translate(
'xpack.apm.keyValueFilterList.actionFilterLabel',
{ defaultMessage: 'Filter by value' }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: Why do we have filter by key in the test subject and filter by value in the aria label

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On line 118 we have data-test-subj={filter_by_${key}} but I guess this is fine - also in the test you shared we have filter by foo not foo value but I guess the purpose there is to be unique so that's why we use the key, I was just wondering

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see, I suppose that is used for the testing, and we need to know which field we want to target explicitly, that's why we use the key for

)}
data-test-subj={`filter_by_${key}`}
>
<EuiToolTip
Expand Down