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

LWS-313: Yet another pagination bugfix #1057

Merged
merged 11 commits into from
Jun 12, 2024

Conversation

jesperengstrom
Copy link
Contributor

@jesperengstrom jesperengstrom commented May 29, 2024

Description

Tickets involved

LWS-131

Solves

Paginating the relation search does not work in some cases.

Because: simply appending _offset to the link causes a new double-fetch (introduced with the predicate tabs) that ultimately uses the predicate view to get the data. That link excludes any applied _offset, fetching the first 10 hits again.

By using a backend-made link as template for all pagination links, we avoid the problem (and double fetch) since they include the _p param.

Summary of changes

  • Fix pagination links
  • Tweak pagination template
  • Mobile look tweaks

@jesperengstrom jesperengstrom marked this pull request as ready for review May 30, 2024 07:26
Copy link
Contributor

@olovy olovy left a comment

Choose a reason for hiding this comment

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

LGTM!

@johanbissemattsson
Copy link
Contributor

johanbissemattsson commented May 30, 2024

There is still some reactivity issues regarding the number of pagination items.

To reproduce:

  1. Go to for example http://localhost:5173/find?_i=astrid&_q=astrid+hasInstanceType:Tactile&_limit=10
  2. Add filters so there is few pages (but still more than one) in the pagination list (e.g. try adding the subject Vardagsliv).
  3. Do a new search in the site header. The old number of visible pagination sequences are still visible (try refreshing and the number of visible sequences will change).

@jesperengstrom
Copy link
Contributor Author

There is still some reactivity issues regarding the number of pagination items.

Good call. sequenceSize being limited due to fewer hits was reactive, but not the reverse; when number of pages increased again.

Extended the sequence to 8, let's see what happens when moving on to the styling issues...

@jesperengstrom
Copy link
Contributor Author

jesperengstrom commented Jun 5, 2024

Added:

  • previous from api that somehow got lost
  • Fixed remaining reactivity issues, should really be ok now ;)
  • Center pageSequence around currentPage

Suggest we save mobile improvements for later

@jesperengstrom jesperengstrom force-pushed the bugfix/LWS-313-pagination-predicate-bug branch 2 times, most recently from e56a4cd to 5520008 Compare June 12, 2024 09:44
@jesperengstrom jesperengstrom force-pushed the bugfix/LWS-313-pagination-predicate-bug branch from 1bd8698 to 9abe2eb Compare June 12, 2024 10:55
@jesperengstrom jesperengstrom merged commit 7bd6e80 into develop Jun 12, 2024
1 check passed
@jesperengstrom jesperengstrom deleted the bugfix/LWS-313-pagination-predicate-bug branch June 12, 2024 11:01
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.

3 participants