Skip to content
Snippets Groups Projects
Commit 9c3cf4fa authored by Domonkos Gulyas's avatar Domonkos Gulyas
Browse files

Merge branch 'CE-2151_Fix-Record-table-links-clickable' into 'develop'

CE-2151: Make Record table links clickable

See merge request !386
parents 8e5a4950 444b9daa
No related branches found
No related tags found
2 merge requests!407CE-2141: 3.0.0,!386CE-2151: Make Record table links clickable
Pipeline #162488 passed
...@@ -52,6 +52,7 @@ export const usePagination = ({ ...@@ -52,6 +52,7 @@ export const usePagination = ({
return { return {
pagination, pagination,
setPagination setPagination,
setTotalCount
}; };
}; };
...@@ -98,7 +98,7 @@ export function RecordListView() { ...@@ -98,7 +98,7 @@ export function RecordListView() {
const rowsPerPage = [20, 50]; const rowsPerPage = [20, 50];
const { pagination, setPagination } = usePagination({ const { pagination, setPagination, setTotalCount } = usePagination({
rowsPerPageOptions: rowsPerPage, rowsPerPageOptions: rowsPerPage,
initLimit: urlPagination.rows ?? rowsPerPage[0], initLimit: urlPagination.rows ?? rowsPerPage[0],
initPage: urlPagination.page ?? 0 initPage: urlPagination.page ?? 0
...@@ -106,8 +106,14 @@ export function RecordListView() { ...@@ -106,8 +106,14 @@ export function RecordListView() {
// update pagination whenever search result total pages change // update pagination whenever search result total pages change
useEffect(() => { useEffect(() => {
setPagination({ totalCount: records?.totalCount ?? 0 }); setTotalCount((prev) => {
}, [setPagination, records?.totalCount]); if (prev === pagination.totalCount && prev > 0) {
return prev;
} else {
return records?.totalCount ?? 0;
}
});
}, [pagination, records?.totalCount, setTotalCount]);
// whenever url state changes, update pagination // whenever url state changes, update pagination
useEffect(() => { useEffect(() => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment