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

Adding server-side pagination support #1243

Merged
merged 13 commits into from
Nov 16, 2023
Merged

Adding server-side pagination support #1243

merged 13 commits into from
Nov 16, 2023

Conversation

jabrah
Copy link
Contributor

@jabrah jabrah commented Nov 9, 2023

(Will) Close eclipse-pass/main#547

Changes

  • Grants list pagination largely working, global filter not hooked up

Description

Adding support for server-side pagination, where previously we grabbed all records and did client side paging. For now, I've added some URL query params:

  • page [integer] : current page to show
  • pageSize [integer] : number of items per page
  • filter [string] : global search string to narrow items shown on the page
    • Currently only over grant.projectName

These query params will be automatically added to the URL and updated as the user uses the pagination controls, but the user can also manually update these parameters in their address bar, if desired

TODO

  • Connect global search/filter on grants list
    • Should investigate using an index for this in a separate PR
  • Add pagination on submissions page
  • Add pagination to the grant details page
  • [ ] Add pagination to the grant selector in the submission workflow
    • Look into in a separate ticket, since the UI is different here
  • [ ] Debounce requests as needed for the above implementations
  • Try to refactor queries to reduce code duplication?
  • Need to handle global search strings better (e.g. spaces currently break the query)

Questions

  • How does the UI respond to invalid or out-of-bounds query params? E.g. setting page=20 when there's only 1 page of results from the backend?
  • What properties do we search over for the given pagination situations?
    • Related: We should probably setup indexes in the backend to support these filters/searches

Testing

Manual

You can check any of the above sections. Using pagination controls will update URL query parameters on the page.
Since we don't have a huge amount of test data, you can manually set page size to something small, like pageSize=2 to force the results to render across multiple pages

@jabrah jabrah marked this pull request as ready for review November 15, 2023 18:33
@jabrah jabrah requested a review from jaredgalanis November 15, 2023 18:33
@jabrah
Copy link
Contributor Author

jabrah commented Nov 15, 2023

We could introduce an RSQL library if we wanted to abstract the RSQL query generation better

Copy link
Contributor

@jaredgalanis jaredgalanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@jabrah jabrah merged commit b41ff17 into main Nov 16, 2023
3 checks passed
@jabrah jabrah deleted the 547-server-side-pagination branch November 16, 2023 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add client side pagination
2 participants