mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[APM] Fix custom link filter select value (#137025)
* [APM] Fix custom link filters to clear values after selecting field (#126066) * adds line comment * adds e2e test to validate the fix
This commit is contained in:
parent
b8b57d530d
commit
bd5abb1c80
2 changed files with 16 additions and 1 deletions
|
@ -34,4 +34,17 @@ describe('Custom links', () => {
|
|||
cy.get('[data-test-subj="editCustomLink"]').click();
|
||||
cy.contains('Delete').click();
|
||||
});
|
||||
|
||||
it('clears filter values when field is selected', () => {
|
||||
cy.visit(basePath);
|
||||
cy.contains('Create custom link').click();
|
||||
cy.get('[data-test-subj="filter-0"]').select('service.name');
|
||||
cy.get(
|
||||
'[data-test-subj="service.name.value"] [data-test-subj="comboBoxSearchInput"]'
|
||||
).type('foo');
|
||||
cy.get('[data-test-subj="filter-0"]').select('service.environment');
|
||||
cy.get(
|
||||
'[data-test-subj="service.environment.value"] [data-test-subj="comboBoxInput"]'
|
||||
).should('not.contain', 'foo');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -108,7 +108,8 @@ export function FiltersSection({
|
|||
}
|
||||
)}
|
||||
onChange={(e) =>
|
||||
onChangeFilter(e.target.value as FilterKey, value, idx)
|
||||
// set value to empty string to reset value when new field is selected
|
||||
onChangeFilter(e.target.value as FilterKey, '', idx)
|
||||
}
|
||||
isInvalid={
|
||||
!isEmpty(value) &&
|
||||
|
@ -118,6 +119,7 @@ export function FiltersSection({
|
|||
</EuiFlexItem>
|
||||
<EuiFlexItem>
|
||||
<SuggestionsSelect
|
||||
key={key}
|
||||
dataTestSubj={`${key}.value`}
|
||||
fieldName={key}
|
||||
placeholder={i18n.translate(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue