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

[Security Solution][Exceptions] - Update UI exceptions builder nested logic #72490

Merged
merged 23 commits into from
Jul 22, 2020

Conversation

yctercero
Copy link
Contributor

@yctercero yctercero commented Jul 20, 2020

Summary

🥁 This PR is meant to update the exception builder logic to handle nested fields. If you're unfamiliar with nested fields, you can read up more on it here and here. It also does a bit of cleanup, so though it may look like a lot of changes, parts of it were just moving some things around.

  • Breaks the exceptions/helpers.tsx file into separate helper files under the corresponding components (builder or viewer) where there wasn't any overlap
  • Adds onClick to add/edit exceptions modal mask overlay so that user does not need to refresh page if modal hits an issue
  • Updates the builder_button_options.tsx to now expose the Add nested field to UI
  • Fixes bug that does not allow user to use delete key in field input
  • Updates logic to be as follows:
    • Add nested field is available at all times - it can be disabled if need be by the consumer of the exceptions builder
      • If a user clicks Add nested field, a new empty entry is shown that limits the fields to only nested types that match the parent and Or is disabled
      • When the user selects a field, 2 new entries appear, one is the parent, the other the selected nested field
      • If user selects Add, another entry, still under the nested parent is added
      • If user is finished adding to their nested field, they can click Add non nested field and it returns them to the normal flow
      • User can delete a single nested entry
        • If it is the only nested entry, the entire nested parent and child is removed
        • Clicking Delete next to the parent entry, deletes the entire nested entry and children
    • If a user is left with one entry in the builder and they select Delete, an empty entry, similar to the one shown on init is displayed

Note: Double checked with @marrasherrier on the design. The initial designs limited the user to adding one nested field as the last item. This allows a user to add multiple nested fields and non-nested fields.

Samples 🤤

Close modal when overlay mask clicked

click_modal

Allow user to delete field selection with delete key

fix_delete

If user deletes last item, goest back to empty default

delete

Adding a nested entry

nested

Deleting nested entry

nested_delete

Sample and, or, nested

sample

To Do

  • Cleanup builder/entry_item.tsx
  • Add better logic for when user selects Add nested --> then selects Add non nested without having selected any nested field

Checklist

Delete any items that are not applicable to this PR.

@apmmachine
Copy link
Contributor

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #72490 updated]

  • Start Time: 2020-07-21T12:36:21.286+0000

  • Duration: 5 min 49 sec

*/
export const getFormattedEntries = (entries: BuilderEntry[]): FormattedEntry[] => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These big chunks that appear as removed were just moved into builder/helper.ts since they weren't shared utils, just applied to the builder. Was trying to cleanup as this file is getting large.

@@ -22,14 +23,25 @@ const MyFirstRowContainer = styled(EuiFlexItem)`
padding-top: 20px;
`;

const MyBeautifulLine = styled(EuiFlexItem)`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happy to remain, my creativity was running low...

@yctercero yctercero marked this pull request as ready for review July 22, 2020 03:16
@yctercero yctercero requested a review from a team as a code owner July 22, 2020 03:16
@yctercero yctercero requested a review from a team as a code owner July 22, 2020 03:16
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

},
entryIndex
);
if (entry.nested === 'parent') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Want to follow up moving all this logic out to easily testable helpers.

Copy link
Contributor

@FrankHassanabad FrankHassanabad left a comment

Choose a reason for hiding this comment

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

LGTM! Wow, you really did us all so many favors this release with all these features and nested.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Build metrics

async chunks size

id value diff baseline
securitySolution 7.3MB +24.7KB 7.3MB

History

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

@yctercero yctercero merged commit f7a1679 into elastic:master Jul 22, 2020
yctercero added a commit to yctercero/kibana that referenced this pull request Jul 22, 2020
… logic (elastic#72490)

## Summary

This PR is meant to update the exception builder logic to handle nested fields. If you're unfamiliar with nested fields, you can read up more on it [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) and [here](elastic#44554). It also does a bit of cleanup, so though it may look like a lot of changes, parts of it were just moving some things around.
yctercero added a commit to yctercero/kibana that referenced this pull request Jul 22, 2020
… logic (elastic#72490)

## Summary

This PR is meant to update the exception builder logic to handle nested fields. If you're unfamiliar with nested fields, you can read up more on it [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) and [here](elastic#44554). It also does a bit of cleanup, so though it may look like a lot of changes, parts of it were just moving some things around.
yctercero added a commit that referenced this pull request Jul 23, 2020
… logic (#72490) (#72982)

## Summary

This PR is meant to update the exception builder logic to handle nested fields. If you're unfamiliar with nested fields, you can read up more on it [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) and [here](#44554). It also does a bit of cleanup, so though it may look like a lot of changes, parts of it were just moving some things around.
yctercero added a commit that referenced this pull request Jul 23, 2020
… logic (#72490) (#72983)

## Summary

This PR is meant to update the exception builder logic to handle nested fields. If you're unfamiliar with nested fields, you can read up more on it [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/nested.html) and [here](#44554). It also does a bit of cleanup, so though it may look like a lot of changes, parts of it were just moving some things around.
gmmorris added a commit to gmmorris/kibana that referenced this pull request Jul 23, 2020
* master: (35 commits)
  Migrated karma tests to jest (elastic#72649)
  Migrate status page app to core (elastic#72017)
  Failing test: Jest Tests.src/plugins/vis_type_vega/public (elastic#71834)
  Fix Firefox TSVB flaky test with switch index patterns (elastic#72882)
  [ML] Fixing link to index management from file data visualizer (elastic#72863)
  test: 💍 add test for sub-expression variables (elastic#71644)
  fix bug (elastic#72809)
  [keystore] use get_keystore in server cli (elastic#72954)
  Show step number instead of incomplete step. (elastic#72866)
  Fix bug where user can't add an exception when "close alert" is checked (elastic#72919)
  [Monitoring] Fix issues displaying alerts (elastic#72891)
  [Ingest Manager] Add more Fleet concurrency tests elastic#71744 (elastic#72338)
  [Security Solution][Exceptions] - Update UI exceptions builder nested logic (elastic#72490)
  disable renovate masterIssue
  [ML] API integration tests for UPDATE data frame analytics endpoint (elastic#72710)
  [Uptime] Fix accessibility issue in Uptime app nav links (elastic#72926)
  [Maps] fix removing global filter from layer can cause app to start thrashing (elastic#72763)
  [Maps] fix blended layer aggregation error when using composite aggregation (elastic#72759)
  fix unexpected arguments to unload command
  Limits the upload size of lists to 9 meg size (elastic#72898)
  ...
@yctercero yctercero deleted the builder_nested branch October 14, 2020 12:00
@MindyRS MindyRS added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Sep 23, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:enhancement Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM v7.9.0 v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants