[Security Solution][Exceptions] - Updates exception hooks and viewer#73588
[Security Solution][Exceptions] - Updates exception hooks and viewer#73588yctercero merged 24 commits intoelastic:masterfrom
Conversation
…into exceptions_ui_find
…display more than two lists associated to rule
| ? filterOptions.tags.map((t) => `${namespace}.attributes.tags:${t}`) | ||
| : []), | ||
| ]; | ||
| const filters: string = filterOptions |
There was a problem hiding this comment.
What happens if listIds.length !== namespaceTypes.length? Maybe could use some extra validation around that...
There was a problem hiding this comment.
👍 The backend has validation for it x-pack/plugins/lists/server/routes/find_exception_list_item_route.ts (line 50)
| ); | ||
|
|
||
| try { | ||
| if (ids.length > 0 && namespaces.length > 0) { |
There was a problem hiding this comment.
What happens if they are not > 0?
There was a problem hiding this comment.
Just doesn't make the call here since there would be no lists to search.
There was a problem hiding this comment.
Updated so if ids are not > 0 then it still calls onSuccess but with defaults.
x-pack/plugins/lists/public/exceptions/hooks/use_exception_list.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/common/components/exceptions/viewer/index.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/lists/public/exceptions/hooks/use_exception_list.ts
Outdated
Show resolved
Hide resolved
| const abortCtrl = new AbortController(); | ||
| const { ids, namespaces } = lists | ||
| .filter((list) => { | ||
| if (showDetectionsListsOnly) { |
There was a problem hiding this comment.
This logic of filter and reduce looks like is duplicated elsewhere. Just mentioning in case you want to make it into a utility, but am fine if it needs to be duplicated here and later on but would be prone to possible changes/bug fixes in one vs. the other later.
There was a problem hiding this comment.
Moved to util and added test!
| }) | ||
| ); | ||
| await waitForNextUpdate(); | ||
| await waitForNextUpdate(); |
There was a problem hiding this comment.
Interesting there has to be two updates before the expect. I trust it, but that is interesting to me. Is there a comment of why two are needed we can add here? Otherwise I always will be like 🤔 when I read this or work with it later.
Optional change of a comment. Not required.
There was a problem hiding this comment.
So did a bit of digging. The first one is initialization. I added a note to them all.
FrankHassanabad
left a comment
There was a problem hiding this comment.
Read through it, a few optionals and I might not be the best person to trust giving a front end 👍 but I appreciate the extra conversations about your experience with the react reducer for my education of later when I make front end changes.
Everything looks clean enough and the demo of it looked great. Can't wait to see it in the product.
|
Pinging @elastic/siem (Team:SIEM) |
peluja1012
left a comment
There was a problem hiding this comment.
Pulled down the branch and did some testing on the feature. Looks to be functioning well. Thanks!
💚 Build SucceededBuild metricsasync chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
…lastic#73588) ## Summary This PR focuses on addressing issues around the pagination and functionality of rules with numerous (2+) exception lists. - Updated the `use_exception_list.ts` hook to make use of the new multi list find API - Updated the viewer to make use of the new multi list find API - Previously was doing a lot of the filtering and paging manually (and badly) in the UI, now the _find takes care of all that - Added logic for showing `No results` text if user filter/search returns no items - Previously would show the `This rule has not exceptions` text
…lastic#73588) ## Summary This PR focuses on addressing issues around the pagination and functionality of rules with numerous (2+) exception lists. - Updated the `use_exception_list.ts` hook to make use of the new multi list find API - Updated the viewer to make use of the new multi list find API - Previously was doing a lot of the filtering and paging manually (and badly) in the UI, now the _find takes care of all that - Added logic for showing `No results` text if user filter/search returns no items - Previously would show the `This rule has not exceptions` text
…73588) (#73747) ## Summary This PR focuses on addressing issues around the pagination and functionality of rules with numerous (2+) exception lists. - Updated the `use_exception_list.ts` hook to make use of the new multi list find API - Updated the viewer to make use of the new multi list find API - Previously was doing a lot of the filtering and paging manually (and badly) in the UI, now the _find takes care of all that - Added logic for showing `No results` text if user filter/search returns no items - Previously would show the `This rule has not exceptions` text
…73588) (#73748) ## Summary This PR focuses on addressing issues around the pagination and functionality of rules with numerous (2+) exception lists. - Updated the `use_exception_list.ts` hook to make use of the new multi list find API - Updated the viewer to make use of the new multi list find API - Previously was doing a lot of the filtering and paging manually (and badly) in the UI, now the _find takes care of all that - Added logic for showing `No results` text if user filter/search returns no items - Previously would show the `This rule has not exceptions` text
* master: [Vega][Inspector] Request panel should show correct names for requests (elastic#73655) [Security Solution] Update filter (elastic#73350) TSVB Inaccurate Group By (elastic#73683) [Vega][Inspect panel] Write tutorials and reference (elastic#73262) [ML] Removing node info check for file data viz import (elastic#73717) check that pathname has been updated. ignore other parts (elastic#73689) [build] rewrite source as transpiled JS later in the process (elastic#73749) Fix Snapshot Restore /policies/indices API endpoint on Cloud (elastic#73734) skip flaky suite (elastic#69783) (elastic#70043) [Security Solution][Exceptions] - Updates exception hooks and viewer (elastic#73588) skip failing suite (elastic#58815) [Canvas][fatal bug] Fix props confusion in TextStylePicker (elastic#73732) [DOCS] Changes level offset of monitoring pages (elastic#73573) Added close button to toast notifications by migrating to different API that is more widely used in Kibana and Security solution in particular. (elastic#73662) [ML] Transforms/DFA: Change action button size back to 'xs'. [Metrics UI] Fix evaluating rate-aggregated alerts when there's no normalized value (elastic#73545) [Metrics UI] Fix formatting of values in inventory context.reason (elastic#73155) [maps] rename GisMap to MapContainer and convert to TS (elastic#73690) [APM] docs: remove watcher documentation (elastic#73485)
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
This PR focuses on addressing issues around the pagination and functionality of rules with numerous (2+) exception lists.
use_exception_list.tshook to make use of the new multi list find APINo resultstext if user filter/search returns no itemsThis rule has not exceptionstextSamples 🤤
Empty exception lists
No search results found
Successful search 🔍
Checklist