diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap index c7f5106fce5bed..dc549a5b4f2d24 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/__snapshots__/index.test.tsx.snap @@ -3,19 +3,25 @@ exports[`TrustedAppsGrid renders correctly initially 1`] = `
+
No items found
+
@@ -25,7 +31,7 @@ exports[`TrustedAppsGrid renders correctly initially 1`] = ` exports[`TrustedAppsGrid renders correctly when failed loading data for the first time 1`] = `
+
Intenal Server Error +
@@ -48,7 +60,7 @@ exports[`TrustedAppsGrid renders correctly when failed loading data for the firs exports[`TrustedAppsGrid renders correctly when failed loading data for the second time 1`] = `
+
Intenal Server Error +
@@ -88,11 +106,14 @@ exports[`TrustedAppsGrid renders correctly when loaded data 1`] = `
+
@@ -2741,6 +2762,9 @@ exports[`TrustedAppsGrid renders correctly when loaded data 1`] = `
+
+
No items found
+
@@ -2999,7 +3029,7 @@ exports[`TrustedAppsGrid renders correctly when loading data for the second time
+
@@ -5659,6 +5692,9 @@ exports[`TrustedAppsGrid renders correctly when loading data for the second time
+
+
@@ -8541,6 +8580,9 @@ exports[`TrustedAppsGrid renders correctly when new page and page size set (not
+
) => 'MMM D, YYYY @ HH:mm:ss.SSS' } }}> ({ eui: euiLightVars, darkMode: false })}> + + + + diff --git a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.tsx b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.tsx index 4664727dd848c5..d6827ba24c238e 100644 --- a/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/trusted_apps/view/components/trusted_apps_grid/index.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { memo, useCallback, useEffect } from 'react'; +import React, { FC, memo, useCallback, useEffect } from 'react'; import { EuiTablePagination, EuiFlexGroup, @@ -12,6 +12,7 @@ import { EuiProgress, EuiIcon, EuiText, + EuiSpacer, } from '@elastic/eui'; import { Pagination } from '../../../state'; @@ -64,6 +65,14 @@ const PaginationBar = ({ pagination, onChange }: PaginationBarProps) => { ); }; +const GridMessage: FC = ({ children }) => ( +
+ + {children} + +
+); + export const TrustedAppsGrid = memo(() => { const pagination = useTrustedAppsSelector(getListPagination); const listItems = useTrustedAppsSelector(getListItems); @@ -80,7 +89,7 @@ export const TrustedAppsGrid = memo(() => { })); return ( - + {isLoading && ( @@ -88,27 +97,33 @@ export const TrustedAppsGrid = memo(() => { )} {error && ( -
+ {error} -
+ + )} + {!error && listItems.length === 0 && ( + + {NO_RESULTS_MESSAGE} + )} - {!error && ( - - {listItems.map((item) => ( - - - - ))} - {listItems.length === 0 && ( - - {NO_RESULTS_MESSAGE} - - )} - + {!error && listItems.length > 0 && ( + <> + + + + {listItems.map((item) => ( + + + + ))} + + )}
{!error && pagination.totalItemCount > 0 && ( + + )}