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

Library Pagination #2892

Closed
RafaPolit opened this issue Apr 28, 2020 · 2 comments · Fixed by #2918
Closed

Library Pagination #2892

RafaPolit opened this issue Apr 28, 2020 · 2 comments · Fixed by #2918
Assignees
Labels

Comments

@RafaPolit
Copy link
Member

We need to have pagination on the library to avoid reloading and rerendering the previous cards that are already loaded.

This is also need for: #2708 and #958

@konzz konzz assigned konzz and unassigned mfacar and fnocetti May 12, 2020
@RafaPolit
Copy link
Member Author

For the purposes of sever side rendering, and also for copy-pasting the URL, we need to 'split' the page URL with the internal requests because:

  • The url needs to read limit=600
  • But the internal request needs to ask for limit=300, offset=300 (or whatever the exact wording is for the elastic pagination)

@konzz
Copy link
Member

konzz commented May 13, 2020

The library search works by updating the URL whenever you do a change in the filters, update the limit, or introduce a search term, then the Library route detects this change in the URL, processes it, and requests the new documents.

If you have a 300 limit, and 100 documents, there is no way to tell if the new request is happening because you updated the limit, or changed a filter, in the former you have to send an offset of 100 but in the later you have to send an offset of 0.

The solution will be to:

  • Include the offset in the URL
  • Whenever a filter is changed reset the offset to 0
  • If you don't have documents in the state (rendering from server) the request should be made with offset 0

@konzz konzz mentioned this issue May 14, 2020
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants