fix: autocomplete search in AdhocFilter operator dropdown (#9654)

Searching for 'equ' in AdhocFilter's operator dropdown doesn't find the
options who's label contain that substring.

I'd write a unit test but it's pretty tricky.
This commit is contained in:
Maxime Beauchemin 2020-05-05 21:43:33 -07:00 committed by GitHub
parent eee6280780
commit 67d8b634b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -313,7 +313,11 @@ export default class AdhocFilterEditPopoverSimpleTabContent extends React.Compon
.filter(operator =>
this.isOperatorRelevant(operator, adhocFilter.subject),
)
.map(operator => ({ operator })),
.map(operator => ({
operator,
label: translateOperator(operator),
value: operator,
})),
value: adhocFilter.operator,
onChange: this.onOperatorChange,
optionRenderer: VirtualizedRendererWrap(operator =>