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

[SIEM][Exceptions] - Part 1 of ExceptionViewer UI #68027

Merged
merged 17 commits into from
Jun 4, 2020

Conversation

yctercero
Copy link
Contributor

@yctercero yctercero commented Jun 2, 2020

Summary

The ExceptionViewer is a component that displays all of a user's exception list items. It will allow them to delete, edit, search and add exception items.

This is part 1 of the UI for the ExceptionViewer. Trying to keep PRs relatively small and found this was one way to split it up. This first part accomplishes the following:

  • adds helper functions that will be used in the ExceptionBuilder as well and offer ways to format and access the new exception list item structure
  • creates ExceptionItem component, this is the component that displays the exception item information
  • moves the and_or_badge component into the common folder
  • adds stories for the ExceptionItem to easily test changes (Note that the color of some things like the and_or_badge is a bit off, as the light gray color used for it isn't picked up in the mock eui theme)

To come in part 2:

  • ExceptionViewer component that includes search bar, add exception button and logic to view endpoint exceptions vs. detection exceptions

NOTE: temporarily created an ExceptionListItemSchema with the updated structure. Once the schema is updated in lists, all will be updated to use that

Testing

To test, run yarn storybook siem. A webpage will automatically open up once it's ready and you can view the different possible states of the ExceptionItem component.

Alternatively, you can plop the component in anywhere to render locally.

Screenshots

ExceptionItem comments hidden

Screen Shot 2020-06-02 at 5 11 54 PM

ExceptionItem comments expanded

Screen Shot 2020-06-02 at 5 12 16 PM

ExceptionItem dark mode

Screen Shot 2020-06-03 at 1 51 44 PM

Checklist

Delete any items that are not applicable to this PR.

@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

value: 'Global Signer',
},
],
});
Copy link
Contributor

@FrankHassanabad FrankHassanabad Jun 2, 2020

Choose a reason for hiding this comment

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

You might be able to pull the mock items from the lists plugin since they live within the common section and be able to avoid adding another mock item here. The less mock data items we have, the less areas we have to update when we change structures.

If you have to expand that mock to include entries which it might not have:

x-pack/plugins/lists/common/schemas/response/exception_list_schema.mock.ts

I think that is ok, as well. Otherwise if this is just very specific for here, it is ok to leave IMHO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, I should've added a to do there. This was just temporary until the structures are updated in the lists plugin. But def, will remove these then.

@@ -0,0 +1,89 @@
/*
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 will be deleted once exceptions structure is updated to use those mocks.

@@ -0,0 +1,78 @@
/*
Copy link
Contributor Author

Choose a reason for hiding this comment

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

NOTE: Many of these types will go away when exceptions structure updated and will use those types instead.

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.

Thanks for all the updates and the nice and easy to read code.

LGTM

Copy link
Contributor

@peluja1012 peluja1012 left a comment

Choose a reason for hiding this comment

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

Looks great!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

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

@yctercero yctercero merged commit c5e9ad5 into elastic:master Jun 4, 2020
yctercero added a commit to yctercero/kibana that referenced this pull request Jun 4, 2020
### Summary

The ExceptionViewer is a component that displays all of a user's exception list items. It will allow them to delete, edit, search and add exception items.

This is part 1 of the UI for the ExceptionViewer. Trying to keep PRs relatively small and found this was one way to split it up. This first part accomplishes the following:

- adds helper functions that will be used in the ExceptionBuilder as well and offer ways to format and access the new exception list item structure
- creates ExceptionItem component, this is the component that displays the exception item information
- moves the and_or_badge component into the common folder
- adds stories for the ExceptionItem to easily test changes (Note that the color of some things like the and_or_badge is a bit off, as the light gray color used for it isn't picked up in the mock eui theme)
# Conflicts:
#	x-pack/plugins/siem/public/common/components/and_or_badge/__examples__/index.stories.tsx
#	x-pack/plugins/siem/public/common/components/and_or_badge/index.test.tsx
#	x-pack/plugins/siem/public/common/components/and_or_badge/index.tsx
#	x-pack/plugins/siem/public/common/components/and_or_badge/translations.ts
#	x-pack/plugins/siem/public/common/components/exceptions/__examples__/index.stories.tsx
#	x-pack/plugins/siem/public/common/components/exceptions/helpers.test.tsx
#	x-pack/plugins/siem/public/common/components/exceptions/helpers.tsx
#	x-pack/plugins/siem/public/common/components/exceptions/mocks.ts
#	x-pack/plugins/siem/public/common/components/exceptions/operators.ts
#	x-pack/plugins/siem/public/common/components/exceptions/translations.ts
#	x-pack/plugins/siem/public/common/components/exceptions/types.ts
#	x-pack/plugins/siem/public/common/components/exceptions/viewer/exception_details.test.tsx
#	x-pack/plugins/siem/public/common/components/exceptions/viewer/exception_details.tsx
#	x-pack/plugins/siem/public/common/components/exceptions/viewer/exception_entries.test.tsx
#	x-pack/plugins/siem/public/common/components/exceptions/viewer/exception_entries.tsx
#	x-pack/plugins/siem/public/common/components/exceptions/viewer/index.test.tsx
#	x-pack/plugins/siem/public/common/components/exceptions/viewer/index.tsx
#	x-pack/plugins/siem/public/timelines/components/timeline/and_or_badge/__examples__/index.stories.tsx
#	x-pack/plugins/siem/public/timelines/components/timeline/and_or_badge/index.tsx
Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

Sorry for the late review, but it's mostly just some tips/tricks anyway. Nice work!

x-pack/plugins/siem/scripts/storybook.js Outdated Show resolved Hide resolved
},
{
title: i18n.DATE_CREATED,
value: moment(exceptionItem.created_at).format('MMMM Do YYYY @ HH:mm:ss'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these respect the user's dateFormat settings?

export const getFormattedComments = (comments: Comment[]): EuiCommentProps[] =>
comments.map((comment) => ({
username: comment.user,
timestamp: moment(comment.timestamp).format('on MMM Do YYYY @ HH:mm:ss'),
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto on respecting the dateFormat UI setting

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 8, 2020
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.

yctercero added a commit to yctercero/kibana that referenced this pull request Jun 8, 2020
### Summary

The ExceptionViewer is a component that displays all of a user's exception list items. It will allow them to delete, edit, search and add exception items.

This is part 1 of the UI for the ExceptionViewer. Trying to keep PRs relatively small and found this was one way to split it up. This first part accomplishes the following:

- adds helper functions that will be used in the ExceptionBuilder as well and offer ways to format and access the new exception list item structure
- creates ExceptionItem component, this is the component that displays the exception item information
- moves the and_or_badge component into the common folder
- adds stories for the ExceptionItem to easily test changes (Note that the color of some things like the and_or_badge is a bit off, as the light gray color used for it isn't picked up in the mock eui theme)
yctercero added a commit that referenced this pull request Jun 8, 2020
### Summary

The ExceptionViewer is a component that displays all of a user's exception list items. It will allow them to delete, edit, search and add exception items.

This is part 1 of the UI for the ExceptionViewer. Trying to keep PRs relatively small and found this was one way to split it up. This first part accomplishes the following:

- adds helper functions that will be used in the ExceptionBuilder as well and offer ways to format and access the new exception list item structure
- creates ExceptionItem component, this is the component that displays the exception item information
- moves the and_or_badge component into the common folder
- adds stories for the ExceptionItem to easily test changes (Note that the color of some things like the and_or_badge is a bit off, as the light gray color used for it isn't picked up in the mock eui theme)
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 8, 2020
@yctercero
Copy link
Contributor Author

Sorry for the late review, but it's mostly just some tips/tricks anyway. Nice work!

Thanks @rylnd ! I followed up with your suggestions here: #68651

yctercero added a commit that referenced this pull request Jun 10, 2020
### Summary 

This PR is a follow up to #68027 . It brings it all together to complete the exceptions viewer component. This component is meant to display all exception items and allow a user to create, edit, delete, and search these exception items.

- Moves ExceptionItem (from part 1) into its own folder
- Adds exceptions_viewer_header component that includes the search, list toggle, and add exception buttons
- Adds actual ExceptionViewer component
- Updates the useExceptionList hook refresh function logic. Noticed that the previous version was creating some issues
yctercero added a commit to yctercero/kibana that referenced this pull request Jun 10, 2020
)

### Summary 

This PR is a follow up to elastic#68027 . It brings it all together to complete the exceptions viewer component. This component is meant to display all exception items and allow a user to create, edit, delete, and search these exception items.

- Moves ExceptionItem (from part 1) into its own folder
- Adds exceptions_viewer_header component that includes the search, list toggle, and add exception buttons
- Adds actual ExceptionViewer component
- Updates the useExceptionList hook refresh function logic. Noticed that the previous version was creating some issues
yctercero added a commit that referenced this pull request Jun 10, 2020
…68729)

### Summary 

This PR is a follow up to #68027 . It brings it all together to complete the exceptions viewer component. This component is meant to display all exception items and allow a user to create, edit, delete, and search these exception items.

- Moves ExceptionItem (from part 1) into its own folder
- Adds exceptions_viewer_header component that includes the search, list toggle, and add exception buttons
- Adds actual ExceptionViewer component
- Updates the useExceptionList hook refresh function logic. Noticed that the previous version was creating some issues
yctercero added a commit that referenced this pull request Jun 10, 2020
### Summary

This PR is a follow up to #68027 where some feedback didn't make it in. It cleans up the and_or_badge component, updates some css, and cleans up stories.
yctercero added a commit to yctercero/kibana that referenced this pull request Jun 10, 2020
### Summary

This PR is a follow up to elastic#68027 where some feedback didn't make it in. It cleans up the and_or_badge component, updates some css, and cleans up stories.
yctercero added a commit that referenced this pull request Jun 10, 2020
### Summary

This PR is a follow up to #68027 where some feedback didn't make it in. It cleans up the and_or_badge component, updates some css, and cleans up stories.
@yctercero yctercero deleted the all-exc-view branch October 14, 2020 12:02
@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 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants