feat: paginate user proposal table#1598
Open
William-Edwards-STFC wants to merge 13 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In this PR I have paginated user proposals table. I added first, offset and total count to the query. I created a new paginated proposals resolver and object for it to resolve to.
Motivation and Context
STFC super users with 300+ proposals are unable to load the homepage table. This solves that by loading only a page at a time.
How Has This Been Tested
I have tested this by impersonating a user with over 100 claims. I then went into the network tab and could see that it was requesting every time I changed the page of the table.
Fixes
UserOfficeProject/issue-tracker#1609
Changes
Added a new resolver in user.
Added offset, limit and total count to query.
Updated proposal table and proposal user table to use pagination.
I used raw sql for total count but I checked through the code base and that seems to be the way its being done elsewhere.
Tests included/Docs Updated?