Skip to content

Commit

Permalink
Create generic get filter method to be used with an array of list id's (
Browse files Browse the repository at this point in the history
#127983)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
dasansol92 and kibanamachine authored Mar 24, 2022
1 parent 2d12c94 commit 968f350
Show file tree
Hide file tree
Showing 13 changed files with 77 additions and 750 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ export interface UseExceptionListsProps {
namespaceTypes: NamespaceType[];
notifications: NotificationsStart;
initialPagination?: Pagination;
showTrustedApps: boolean;
showEventFilters: boolean;
showHostIsolationExceptions: boolean;
hideLists?: readonly string[];
}

export interface UseExceptionListProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ const DEFAULT_PAGINATION = {
* @param filterOptions filter by certain fields
* @param namespaceTypes spaces to be searched
* @param notifications kibana service for displaying toasters
* @param showTrustedApps boolean - include/exclude trusted app lists
* @param showEventFilters boolean - include/exclude event filters lists
* @param showHostIsolationExceptions boolean - include/exclude host isolation exceptions lists
* @param hideLists a list of listIds we don't want to query
* @param initialPagination
*
*/
Expand All @@ -52,9 +50,7 @@ export const useExceptionLists = ({
filterOptions = {},
namespaceTypes,
notifications,
showTrustedApps = false,
showEventFilters = false,
showHostIsolationExceptions = false,
hideLists = [],
}: UseExceptionListsProps): ReturnExceptionLists => {
const [exceptionLists, setExceptionLists] = useState<ExceptionListSchema[]>([]);
const [pagination, setPagination] = useState<Pagination>(initialPagination);
Expand All @@ -67,11 +63,9 @@ export const useExceptionLists = ({
getFilters({
filters: filterOptions,
namespaceTypes,
showTrustedApps,
showEventFilters,
showHostIsolationExceptions,
hideLists,
}),
[namespaceTypes, filterOptions, showTrustedApps, showEventFilters, showHostIsolationExceptions]
[namespaceTypes, filterOptions, hideLists]
);

const fetchData = useCallback(async (): Promise<void> => {
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 968f350

Please sign in to comment.