-
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
[SIEM][Exceptions] - Part 1 of ExceptionViewer UI #68027
Conversation
Pinging @elastic/siem (Team:SIEM) |
value: 'Global Signer', | ||
}, | ||
], | ||
}); |
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.
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.
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.
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 @@ | |||
/* |
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.
These will be deleted once exceptions structure is updated to use those mocks.
@@ -0,0 +1,78 @@ | |||
/* |
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.
NOTE: Many of these types will go away when exceptions structure updated and will use those types instead.
x-pack/plugins/siem/public/common/components/exceptions/viewer/exception_details.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/public/common/components/exceptions/viewer/exception_details.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/public/common/components/exceptions/viewer/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/public/common/components/exceptions/viewer/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/public/common/components/exceptions/viewer/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/public/common/components/exceptions/viewer/index.tsx
Outdated
Show resolved
Hide resolved
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 for all the updates and the nice and easy to read code.
LGTM
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.
Looks great!
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
### 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
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.
Sorry for the late review, but it's mostly just some tips/tricks anyway. Nice work!
x-pack/plugins/siem/public/common/components/and_or_badge/__examples__/index.stories.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/public/common/components/and_or_badge/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/public/common/components/and_or_badge/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/public/common/components/and_or_badge/index.tsx
Outdated
Show resolved
Hide resolved
}, | ||
{ | ||
title: i18n.DATE_CREATED, | ||
value: moment(exceptionItem.created_at).format('MMMM Do YYYY @ HH:mm:ss'), |
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.
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'), |
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.
Ditto on respecting the dateFormat
UI setting
x-pack/plugins/siem/public/common/components/exceptions/viewer/exception_details.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/public/common/components/exceptions/viewer/exception_details.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/siem/public/common/components/exceptions/viewer/exception_details.tsx
Outdated
Show resolved
Hide resolved
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. |
### 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)
### 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)
### 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
) ### 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
…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
### 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.
### 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.
Pinging @elastic/security-solution (Team: SecuritySolution) |
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:
and_or_badge
component into thecommon
folderTo come in part 2:
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
ExceptionItem comments expanded
ExceptionItem dark mode
Checklist
Delete any items that are not applicable to this PR.