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

WCMS-19554: Fix pagination Bugs #244

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions src/components/DataDictionaryTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ const DataDictionaryTable = ({tableColumns, tableData, pageSize, columnFilters}
evt.preventDefault();
table.setPageIndex(page - 1)
}}
renderHref={(page) => {
return '';
}}
renderHref={(page) => `/page=${page}`}
/>
): ''}
</div>
Expand Down
6 changes: 2 additions & 4 deletions src/components/DatasetTableTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ const DatasetTable = ({isModal = false, closeFullScreenModal} : {isModal?: boole
<div className="ds-u-display--flex ds-u-flex-wrap--wrap ds-u-justify-content--end ds-u-md-justify-content--between ds-u-margin-top--2 ds-u-align-items--center">
<Pagination
totalPages={Math.ceil(resource.count ? resource.count / pageSize : 1)}
currentPage={page}
currentPage={Number(page)}
onPageChange={(evt, page) => {
evt.preventDefault();
setOffset((page - 1) * limit);
setPage(page);
}}
renderHref={(page) => {
return '';
}}
renderHref={(p) => `?page=${p}`}
className="ds-l-col--12 ds-u-padding-x--0"
/>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/templates/DatasetSearch/DatasetSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ const DatasetSearch = (props: DatasetSearchPageProps) => {
}, [totalItems, pageSize, page]);

useEffect(() => {
setPage(1)
if (page !== 1 && (transformedParams.fulltext !== fulltext || transformedParams.selectedFacets !== selectedFacets))
setPage(1)
}, [fulltext, selectedFacets]);

useEffect(() => {
Expand Down