From 36e97724b60602438f5898756b13cb3d1e6a7aba Mon Sep 17 00:00:00 2001 From: Cee Chen Date: Tue, 15 Aug 2023 12:02:01 -0700 Subject: [PATCH] [kbn-securitysolution-exception-list-components] Require `pageSize` and DRY out types --- .../src/exception_items/index.tsx | 6 ++---- .../src/types/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_items/index.tsx b/packages/kbn-securitysolution-exception-list-components/src/exception_items/index.tsx index b774b0d0609b0..d9085b08f536d 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_items/index.tsx +++ b/packages/kbn-securitysolution-exception-list-components/src/exception_items/index.tsx @@ -11,8 +11,6 @@ import { css } from '@emotion/react'; import type { FC } from 'react'; import { EuiCommentProps, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import type { Pagination as PaginationType } from '@elastic/eui'; - import type { CommentsArray, ExceptionListItemSchema, @@ -20,7 +18,7 @@ import type { } from '@kbn/securitysolution-io-ts-list-types'; import { euiThemeVars } from '@kbn/ui-theme'; -import { EmptyViewerState, ExceptionItemCard, Pagination } from '../..'; +import { EmptyViewerState, ExceptionItemCard, Pagination, PaginationProps } from '../..'; import type { RuleReferences, @@ -46,7 +44,7 @@ interface ExceptionItemsProps { exceptions: ExceptionListItemSchema[]; listType: ExceptionListTypeEnum; ruleReferences: RuleReferences; - pagination: PaginationType; + pagination: PaginationProps['pagination']; editActionLabel?: string; deleteActionLabel?: string; dataTestSubj?: string; diff --git a/packages/kbn-securitysolution-exception-list-components/src/types/index.ts b/packages/kbn-securitysolution-exception-list-components/src/types/index.ts index 377779332c869..070741687b0fd 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/types/index.ts +++ b/packages/kbn-securitysolution-exception-list-components/src/types/index.ts @@ -12,7 +12,7 @@ import type { Pagination } from '@elastic/eui'; import type { NamespaceType } from '@kbn/securitysolution-io-ts-list-types'; export interface GetExceptionItemProps { - pagination?: Pagination; + pagination?: PaginationProps['pagination']; search?: string; filters?: string; } @@ -20,7 +20,7 @@ export interface GetExceptionItemProps { export interface PaginationProps { dataTestSubj?: string; ariaLabel?: string; - pagination: Pagination; + pagination: Pagination & { pageSize: number }; onPaginationChange: (arg: GetExceptionItemProps) => void; }