-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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][Endpoint] Delete Event Filter from the List #99686
[Security Solution][Endpoint] Delete Event Filter from the List #99686
Conversation
…t-filter-delete # Conflicts: # x-pack/plugins/security_solution/public/management/pages/event_filters/state/index.ts # x-pack/plugins/security_solution/public/management/pages/event_filters/store/builders.ts # x-pack/plugins/security_solution/public/management/pages/event_filters/store/middleware.ts
Pinging @elastic/security-onboarding-and-lifecycle-mgt (Team:Onboarding and Lifecycle Mgt) |
|
||
dispatch({ | ||
type: 'eventFilterDeleteStatusChanged', | ||
// Ignore will be fixed with when AsyncResourceState is refactored (#830) |
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.
👍
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.
Just a few comments (mostly questions) but it looks great!!! 🔥 🔥
Could you add some tests for the middleware and the new reducers?
// Show toast for success | ||
useEffect(() => { | ||
if (wasDeleted) { | ||
toasts.addSuccess( |
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.
I think you can manage this with the useEventFiltersNotification
hook adding the new conditions for delete action.
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.
I feel that having the notifications closer to the code that generates them makes the component (in this case the delete modal) clearer to understand. Someone looking at this component would not be able to understand how errors/success are presented back to the UI - they would have to go look elsewhere. I think it also overloads that hook in that it starts to have too broad of concerns. I remember having that same feedback when that Trusted Apps approach was done - several new approaches were trialed during that implementation, this being one of them.
Give this background, let me know if you still feel this should be moved over to the hook - I can do that if feels like the better approach.
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.
Oh I see. Yeah it make sense.
Idea - Maybe we could move this logic to the middleware (not now) just to keep the component itself as clean as we can. What I'm thinking is have an entry on our redux store for notifications and have a component that listens it to display the toast or not.
Doing this we could move all of this logic (this and the ones in the hook) to the middleware and let components more clean.
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.
@dasansol92 yeah, that could work. Maybe we add this as a topic of discussion for our weekly eng. office hours.
useEffect(() => { | ||
if (deleteError) { | ||
toasts.addDanger( | ||
i18n.translate('xpack.securitySolution.eventFilters.deletionDialog.deleteFailure', { |
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.
Same comment as above
x-pack/plugins/security_solution/public/management/pages/event_filters/store/action.ts
Outdated
Show resolved
Hide resolved
...ins/security_solution/public/management/pages/event_filters/view/event_filters_list_page.tsx
Outdated
Show resolved
Hide resolved
…t-filter-delete # Conflicts: # x-pack/plugins/security_solution/public/management/pages/event_filters/view/event_filters_list_page.tsx
💚 Build SucceededMetrics [docs]Async chunks
Unknown metric groupsReferences to deprecated APIs
History
To update your PR or re-run it, just comment with: |
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.
🔥 🔥 🚢
…tic#99686) * modal for delete of event filter * Add total count of items to the List view
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
…) (#100024) * modal for delete of event filter * Add total count of items to the List view Co-authored-by: Paul Tavares <[email protected]>
Summary
Checklist