Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add client-side pagination to Archetypes table #1370

Merged
merged 3 commits into from
Sep 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions client/src/app/pages/archetypes/archetypes-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import { ConfirmDialog } from "@app/components/ConfirmDialog";
import { formatPath, getAxiosErrorMessage } from "@app/utils/utils";
import { AxiosError } from "axios";
import { Paths } from "@app/Paths";
import { SimplePagination } from "@app/components/SimplePagination";

const Archetypes: React.FC = () => {
const { t } = useTranslation();
Expand Down Expand Up @@ -130,7 +131,7 @@ const Archetypes: React.FC = () => {
}),
initialSort: { columnKey: "name", direction: "asc" },

hasPagination: false, // TODO: Add pagination
hasPagination: true,
});
const {
currentPageItems,
Expand Down Expand Up @@ -219,7 +220,13 @@ const Archetypes: React.FC = () => {
<CreateButton />
</ToolbarItem>
</ToolbarGroup>
{/* TODO: Add pagination */}
<ToolbarItem {...paginationToolbarItemProps}>
<SimplePagination
idPrefix="archetypes-table"
isTop
paginationProps={paginationProps}
/>
</ToolbarItem>
</ToolbarContent>
</Toolbar>

Expand Down Expand Up @@ -315,8 +322,11 @@ const Archetypes: React.FC = () => {
))}
</ConditionalTableBody>
</Table>

{/* TODO: Add pagination */}
<SimplePagination
idPrefix="archetypes-table"
isTop={false}
paginationProps={paginationProps}
/>
</div>
</ConditionalRender>
</PageSection>
Expand Down
Loading