From d0c850436f5762fd00560c6413e85e3fecf273ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Mon, 4 Mar 2024 15:39:51 +0100 Subject: [PATCH] [Profiling] Allow paginating all Topn functions (#177926) This PR fixes a bug where the pagination only shows 2 pages (up to 100 items) in the TopN Functions view. Additionally, the number of items per page are raised from 50 to 100. --- .../components/differential_topn_functions_grid/index.tsx | 4 ++-- .../profiling/public/components/topn_functions/index.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/observability_solution/profiling/public/components/differential_topn_functions_grid/index.tsx b/x-pack/plugins/observability_solution/profiling/public/components/differential_topn_functions_grid/index.tsx index d31090f9c8c82..4255bc9dd3ee5 100644 --- a/x-pack/plugins/observability_solution/profiling/public/components/differential_topn_functions_grid/index.tsx +++ b/x-pack/plugins/observability_solution/profiling/public/components/differential_topn_functions_grid/index.tsx @@ -231,7 +231,7 @@ export function DifferentialTopNFunctionsGrid({ ); } - const rowCount = Math.min(Math.max(sortedBaseRows.length, sortedComparisonRows.length), 100); + const rowCount = Math.max(sortedBaseRows.length, sortedComparisonRows.length); return ( <> @@ -303,7 +303,7 @@ export function DifferentialTopNFunctionsGrid({ }} pagination={{ pageIndex, - pageSize: 50, + pageSize: 100, // Left it empty on purpose as it is a required property on the pagination onChangeItemsPerPage: () => {}, onChangePage, diff --git a/x-pack/plugins/observability_solution/profiling/public/components/topn_functions/index.tsx b/x-pack/plugins/observability_solution/profiling/public/components/topn_functions/index.tsx index 6c754d61dac64..4f56865d54a84 100644 --- a/x-pack/plugins/observability_solution/profiling/public/components/topn_functions/index.tsx +++ b/x-pack/plugins/observability_solution/profiling/public/components/topn_functions/index.tsx @@ -299,13 +299,13 @@ export const TopNFunctionsGrid = ({ )} columns={columns} columnVisibility={{ visibleColumns, setVisibleColumns }} - rowCount={sortedRows.length > 100 ? 100 : sortedRows.length} + rowCount={sortedRows.length} renderCellValue={RenderCellValue} sorting={{ columns: [{ id: sortField, direction: sortDirection }], onSort }} leadingControlColumns={leadingControlColumns} pagination={{ pageIndex, - pageSize: 50, + pageSize: 100, // Left it empty on purpose as it is a required property on the pagination onChangeItemsPerPage: () => {}, onChangePage,