V1Wizard: Add full bottom pagination to Repositories

This adds a full pagination to the bottom of the Repositories step. This allows the user to get to the very end of the repositories list easily.
This commit is contained in:
regexowl 2024-04-02 11:03:04 +02:00 committed by Lucas Garfield
parent d97a401a53
commit 18e0dc0cd7
2 changed files with 11 additions and 3 deletions

View file

@ -23,6 +23,7 @@ import {
EmptyStateFooter,
ToggleGroup,
ToggleGroupItem,
PaginationVariant,
} from '@patternfly/react-core';
import {
Dropdown,
@ -427,7 +428,6 @@ const Repositories = (props) => {
perPage={perPage}
page={page}
onSetPage={handleSetPage}
widgetId="compact-example"
onPerPageSelect={handlePerPageSelect}
isCompact
/>
@ -522,6 +522,14 @@ const Repositories = (props) => {
</Table>
</PanelMain>
</Panel>
<Pagination
itemCount={filteredRepositoryURLs.length}
perPage={perPage}
page={page}
onSetPage={handleSetPage}
onPerPageSelect={handlePerPageSelect}
variant={PaginationVariant.bottom}
/>
</>
)}
</>

View file

@ -1016,7 +1016,7 @@ describe('Step Custom repositories', () => {
const firstRepoCheckbox = await getFirstRepoCheckbox();
const getNextPageButton = async () =>
await screen.findByRole('button', {
await screen.findAllByRole('button', {
name: /go to next page/i,
});
@ -1026,7 +1026,7 @@ describe('Step Custom repositories', () => {
await user.click(firstRepoCheckbox);
expect(firstRepoCheckbox.checked).toEqual(true);
await user.click(nextPageButton);
await user.click(nextPageButton[0]);
const getSelectedButton = async () =>
await screen.findByRole('button', {