Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Fix anomaly results pagination (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
ohltyler committed May 26, 2020
1 parent c956793 commit 40458c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ export const ListControls = (props: ListControlsProps) => (
alignItems="center"
justifyContent="flexEnd"
>
<EuiFlexItem grow={false}>
<EuiPagination
pageCount={props.pageCount}
activePage={props.activePage}
onPageClick={props.onPageClick}
data-test-subj="anomaliesPageControls"
/>
</EuiFlexItem>
{props.pageCount > 1 ? (
<EuiFlexItem grow={false} style={{ justifyContent: 'center' }}>
<EuiPagination
pageCount={props.pageCount}
activePage={props.activePage}
onPageClick={props.onPageClick}
data-test-subj="anomaliesPageControls"
/>
</EuiFlexItem>
) : null}
</EuiFlexGroup>
);
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function AnomalyResultsTable(props: AnomalyResultsTableProps) {
<ListControls
activePage={state.page}
pageCount={
Math.ceil(targetAnomalies.length / state.queryParams.size) || 1
Math.ceil(totalAnomalies.length / state.queryParams.size) || 1
}
onPageClick={handlePageChange}
/>
Expand Down

0 comments on commit 40458c6

Please sign in to comment.