Skip to content
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

Merged
merged 6 commits into from
Feb 15, 2024

Conversation

mbondyra
Copy link
Contributor

@mbondyra mbondyra commented Feb 14, 2024

Summary

Fixes #156842

Here's the table with how we transform/clear/preserve values:

Screenshot 2024-02-14 at 17 17 36
Feb-15-2024.11-40-12.mp4

@mbondyra mbondyra added release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure Feature:Unified search Unified search related tasks v8.14.0 labels Feb 14, 2024
@mbondyra mbondyra force-pushed the unified_search/operator_value_persist branch 2 times, most recently from ca834e1 to f0e8b26 Compare February 14, 2024 13:11
@elastic elastic deleted a comment from kibana-ci Feb 14, 2024
@mbondyra mbondyra force-pushed the unified_search/operator_value_persist branch from c808ff2 to 26fd806 Compare February 14, 2024 16:22
@mbondyra mbondyra marked this pull request as ready for review February 15, 2024 10:17
@mbondyra mbondyra requested a review from a team as a code owner February 15, 2024 10:17
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

Copy link
Contributor

@stratoula stratoula left a 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) => {
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks 😊

Comment on lines 102 to 108
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];
}
},
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Contributor

@dej611 dej611 left a comment

Choose a reason for hiding this comment

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

Code review only. 👍

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
unifiedSearch 224.3KB 225.2KB +920.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@mbondyra mbondyra merged commit 10b69a4 into elastic:main Feb 15, 2024
16 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Feb 15, 2024
@mbondyra mbondyra deleted the unified_search/operator_value_persist branch February 15, 2024 12:45
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
CoenWarmer pushed a commit to CoenWarmer/kibana that referenced this pull request Feb 15, 2024
awahab07 pushed a commit to awahab07/kibana that referenced this pull request Feb 19, 2024
fkanout pushed a commit to fkanout/kibana that referenced this pull request Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Unified search Unified search related tasks release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Unified search] Consider not clearing the value on the filter builder when the operator changes
6 participants