Skip to content

Commit

Permalink
Implement infinite scrolling for the Sample views (#166)
Browse files Browse the repository at this point in the history
* Enable infinite scrolling for samples page
* Increase infinite scroll's cache block size from 20 to 100
* Re-configure samples sorting and filtering to be server-side
* Remove max row alert
* Simplify React states around alerts and sample count
* Various minor refactors
  • Loading branch information
qu8n authored Oct 24, 2024
1 parent 3e90b6f commit 28f766f
Show file tree
Hide file tree
Showing 13 changed files with 716 additions and 334 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/AlertModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Modal from "react-bootstrap/Modal";
export const AlertModal: FunctionComponent<{
show: boolean;
title: string;
content: string;
content: string | null;
onHide: () => void;
}> = ({ show, title, content, onHide }) => {
return (
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/components/RecordsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import { AgGridReact as AgGridReactType } from "ag-grid-react/lib/agGridReact";
import { BreadCrumb } from "../shared/components/BreadCrumb";
import { Title } from "../shared/components/Title";

const CACHE_BLOCK_SIZE = 100;

interface IRecordsListProps {
colDefs: ColDef[];
dataName: DataName;
Expand Down Expand Up @@ -101,7 +103,7 @@ export default function RecordsList({
lazyRecordsQuery({
variables: {
options: {
limit: 20,
limit: CACHE_BLOCK_SIZE,
offset: 0,
sort: defaultSort,
},
Expand Down Expand Up @@ -314,7 +316,7 @@ export default function RecordsList({
columnDefs={colDefs}
serverSideDatasource={datasource}
serverSideInfiniteScroll={enableInfiniteScroll}
cacheBlockSize={20}
cacheBlockSize={CACHE_BLOCK_SIZE}
debug={false}
context={{
navigateFunction: navigate,
Expand Down
Loading

0 comments on commit 28f766f

Please sign in to comment.