-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Unified search] not clearing the value on the filter builder when the operator changes #176911
[Unified search] not clearing the value on the filter builder when the operator changes #176911
Conversation
ca834e1
to
f0e8b26
Compare
c808ff2
to
26fd806
Compare
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My dear Marta this works fantastic ❤️ (and I love the implementation!)
message: strings.getIsNotBetweenOperatorOptionLabel(), | ||
negate: true, | ||
id: OPERATORS.NOT_BETWEEN, | ||
getParamsFromPrevOperator: (prevOperator, params) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This getParamsFromPrevOperator
is very smart Marta, I like it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 😊
getParamsFromPrevOperator: (prevOperator, params) => { | ||
if (!prevOperator) return; | ||
if ([OPERATORS.IS, OPERATORS.IS_NOT].includes(prevOperator.id)) return params; | ||
if ([OPERATORS.IS_ONE_OF, OPERATORS.IS_NOT_ONE_OF].includes(prevOperator.id)) { | ||
if (Array.isArray(params) && params.length > 0) return params[0]; | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this looks like the same function as below. Perhaps we could merge them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_operators.ts
Show resolved
Hide resolved
…search/operator_value_persist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review only. 👍
src/plugins/unified_search/public/filter_bar/filter_editor/lib/filter_operators.ts
Outdated
Show resolved
Hide resolved
…/filter_operators.ts
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
…e operator changes (elastic#176911) ## Summary Fixes elastic#156842 Here's the table with how we transform/clear/preserve values: <img width="1127" alt="Screenshot 2024-02-14 at 17 17 36" src="https://github.com/elastic/kibana/assets/4283304/1ee878d5-8734-4143-9d1c-e7f0399c0eaf"> https://github.com/elastic/kibana/assets/4283304/0fccf3a9-a8fd-485b-b252-b9e3845ca9da
…e operator changes (elastic#176911) ## Summary Fixes elastic#156842 Here's the table with how we transform/clear/preserve values: <img width="1127" alt="Screenshot 2024-02-14 at 17 17 36" src="https://github.com/elastic/kibana/assets/4283304/1ee878d5-8734-4143-9d1c-e7f0399c0eaf"> https://github.com/elastic/kibana/assets/4283304/0fccf3a9-a8fd-485b-b252-b9e3845ca9da
…e operator changes (elastic#176911) ## Summary Fixes elastic#156842 Here's the table with how we transform/clear/preserve values: <img width="1127" alt="Screenshot 2024-02-14 at 17 17 36" src="https://github.com/elastic/kibana/assets/4283304/1ee878d5-8734-4143-9d1c-e7f0399c0eaf"> https://github.com/elastic/kibana/assets/4283304/0fccf3a9-a8fd-485b-b252-b9e3845ca9da
…e operator changes (elastic#176911) ## Summary Fixes elastic#156842 Here's the table with how we transform/clear/preserve values: <img width="1127" alt="Screenshot 2024-02-14 at 17 17 36" src="https://github.com/elastic/kibana/assets/4283304/1ee878d5-8734-4143-9d1c-e7f0399c0eaf"> https://github.com/elastic/kibana/assets/4283304/0fccf3a9-a8fd-485b-b252-b9e3845ca9da
Summary
Fixes #156842
Here's the table with how we transform/clear/preserve values:
Feb-15-2024.11-40-12.mp4