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] Create a filter builder component which works with nested OR/AND filters #136815

Merged
merged 203 commits into from
Sep 13, 2022

Conversation

nlatipov
Copy link
Contributor

@nlatipov nlatipov commented Jul 21, 2022

Summary

This PR solve Step 1 of the issue ([Unified search] Complex filter capabilities - Support ORs) - Create a filter form component which will work with nested OR/AND filters
Notes:

  • nesting is limited by the passed parameter;
  • user should be able to add/modify multiple filters with complex relationships;
  • new component should support drag and drop experience;
  • new component should be developed with the focus of what will become shared.

The subtask new component should be developed with the focus of what will become shared will be implemented in another PR

Filter.Builder.mov

What was done

  1. Created a FilterBuilder component for creating nested filters with complex relationships (OR/AND);
  2. In FilterBuilder, the ability to add a filter with an AND and OR relation was implemented, as well as removing a filter;
  3. Added the ability support drag and drop experience;
  4. Added filter builder storybook;
  5. IDataPluginServices has been replaced with IUnifiedSearchPluginServices;
  6. 2 svg files were added to create relationships using drag and drop - add and or. add and or are visualized when moving the mouse cursor over the filter item while dragging;
Add.Or.mov
  1. Added validation for params input;
  2. Tests has been added to test methods: getFilterByPath, getConditionalOperationType, getPathInArray, addFilter, removeFilter, moveFilter, normalizeFilters;
  3. The autocomplete state has been removed from plugin's service and provided by kibana service;
  4. External interface (props) PhraseValueInput, PhrasesValuesInput and RangeValueInput have been extended - the following fields have been added - compressed, disabled, isInvalid;
  5. For implementation filter item in accordance by design PhraseValueInput and PhrasesValuesInput components has been changed: the EuiFormRow component has been moved one level up, to the filterEditor component.

@nlatipov nlatipov marked this pull request as ready for review September 9, 2022 12:38
@alexwizp
Copy link
Contributor

alexwizp commented Sep 9, 2022

@elasticmachine merge upstream

@nlatipov
Copy link
Contributor Author

@elasticmachine merge upstream

@nlatipov
Copy link
Contributor Author

nlatipov commented Sep 12, 2022

Hi @ryankeairns , we have a question about styling. Currently the EuiPanel with the color 'plain' has no border. Is this normal or should we override the styles?
image

@nlatipov
Copy link
Contributor Author

@ppisljar could you please review this PR?!

Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

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

LGTM

@ryankeairns
Copy link
Contributor

No border is good, overrides are not needed. Thanks for asking.
cc:/ @andreadelrio

@ryankeairns ryankeairns self-requested a review September 12, 2022 15:46
@nlatipov
Copy link
Contributor Author

@elastic/security-onboarding-and-lifecycle-mgt, @elastic/security-threat-hunting-investigations, @elastic/security-solution, @elastic/kibana-data-discovery, @dasansol92, @paul-tavares we need your 👀 here. Сould you please review?

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.

Code LGTM! It works fine! We can revisit when we wire it with the unified search bar!

Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

DataDiscover.team Graph changes LGTM, there were just types and tests changed, did not test

Copy link
Contributor

@michaelolo24 michaelolo24 left a comment

Choose a reason for hiding this comment

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

Nice feature! Threat hunting investigations changes, LGTM!

Copy link
Contributor

@paul-tavares paul-tavares left a comment

Choose a reason for hiding this comment

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

👍 for Security Solution OLM team

@nlatipov
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
unifiedSearch 226 229 +3

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
data 2444 2434 -10
unifiedSearch 85 96 +11
total +1

Async chunks

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

id before after diff
unifiedSearch 233.7KB 262.0KB +28.4KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
unifiedSearch 47.0KB 47.0KB -40.0B
Unknown metric groups

API count

id before after diff
data 3144 3134 -10
unifiedSearch 111 122 +11
total +1

async chunk count

id before after diff
unifiedSearch 14 15 +1

ESLint disabled line counts

id before after diff
unifiedSearch 19 20 +1

Total ESLint disabled count

id before after diff
unifiedSearch 19 20 +1

History

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

cc @nlatipov

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 ci:build-storybooks Feature:Unified search Unified search related tasks release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.