From d394a9d7e0b51cd1a2093b78de82d07a963f12d2 Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Fri, 24 Mar 2023 17:06:23 +0100 Subject: [PATCH] use basic table --- .../components/notifications_list.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/ml/public/application/notifications/components/notifications_list.tsx b/x-pack/plugins/ml/public/application/notifications/components/notifications_list.tsx index a2a677670e2ea..7b08bcec0331f 100644 --- a/x-pack/plugins/ml/public/application/notifications/components/notifications_list.tsx +++ b/x-pack/plugins/ml/public/application/notifications/components/notifications_list.tsx @@ -12,7 +12,7 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { EuiBadge, EuiCallOut, - EuiInMemoryTable, + EuiBasicTable, EuiSearchBar, EuiSpacer, IconColor, @@ -294,6 +294,12 @@ export const NotificationsList: FC = () => { const newNotificationsCount = Object.values(notificationsCounts).reduce((a, b) => a + b); + const itemsPerPage = useMemo(() => { + const fromIndex = pagination.pageIndex * pagination.pageSize; + const toIndex = fromIndex + pagination.pageSize; + return items.slice(fromIndex, toIndex); + }, [items, pagination]); + return ( <> @@ -382,12 +388,12 @@ export const NotificationsList: FC = () => { ) : null} - + columns={columns} hasActions={false} isExpandable={false} isSelectable={false} - items={items} + items={itemsPerPage} itemId={'id'} loading={isLoading} rowProps={(item) => ({ @@ -397,7 +403,7 @@ export const NotificationsList: FC = () => { onChange={onTableChange} sorting={sorting} data-test-subj={isLoading ? 'mlNotificationsTable loading' : 'mlNotificationsTable loaded'} - message={ + noItemsMessage={