[Security Solution] Fix filtering on searching for lists (#147096)

## Summary

- Addresses https://github.com/elastic/kibana/issues/145677
- Use the filter of the list type every time we call the fetch list.
- On search we need to append the ` types:
[ExceptionListTypeEnum.DETECTION, ExceptionListTypeEnum.ENDPOINT],` to
the users' filters, to filter out the other list type that should not be
displayed on `Rule Exceptions` page
This commit is contained in:
Wafaa Nasr 2022-12-06 15:09:45 +01:00 committed by GitHub
parent 132f6a557f
commit 727df5e36b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,9 +94,7 @@ export const SharedLists = React.memo(() => {
const [referenceModalState, setReferenceModalState] = useState<ReferenceModalState>(
exceptionReferenceModalInitialState
);
const [filters, setFilters] = useState<ExceptionListFilter | undefined>({
types: [ExceptionListTypeEnum.DETECTION, ExceptionListTypeEnum.ENDPOINT],
});
const [filters, setFilters] = useState<ExceptionListFilter | undefined>();
const [
loadingExceptions,
@ -108,7 +106,10 @@ export const SharedLists = React.memo(() => {
setSort,
] = useExceptionLists({
errorMessage: i18n.ERROR_EXCEPTION_LISTS,
filterOptions: filters,
filterOptions: {
...filters,
types: [ExceptionListTypeEnum.DETECTION, ExceptionListTypeEnum.ENDPOINT],
},
http,
namespaceTypes: ['single', 'agnostic'],
notifications,