Skip to content

Fix configurable pagination#370

Open
jazairi wants to merge 1 commit intomainfrom
use-442
Open

Fix configurable pagination#370
jazairi wants to merge 1 commit intomainfrom
use-442

Conversation

@jazairi
Copy link
Contributor

@jazairi jazairi commented Mar 10, 2026

Why these changes are being introduced:

Configuring the results per page to a non-default number yielded
unexpected numbers of results. This was because the per-page value is
set at multiple points in the query processing chain, and not always
consistently.

Relevant ticket(s):

How this addresses that need:

This updates how results per page is defined for TIMDEX queries.
SearchController#fetch_timdex_data, now ensures that per_page is
always set by checking env and falling back to the default value of
'20'. This mirrors how the value is set for the corresponding Primo
method.

The query param name is also updated from size to perPage. That
change had been made in TIMDEX API, but we forgot to make it here.

Side effects of this change:

  • Some cassettes were regenerated.
  • We should, at some point, evaluate whether it's possible to simplify
    the query processing chain.

Developer

Accessibility
  • ANDI or WAVE has been run in accordance to our guide.
  • This PR contains no changes to the view layer.
  • New issues flagged by ANDI or WAVE have been resolved.
  • New issues flagged by ANDI or WAVE have been ticketed (link in the Pull Request details above).
  • No new accessibility issues have been flagged.
New ENV
  • All new ENV is documented in README.
  • All new ENV has been added to Heroku Pipeline, Staging and Prod.
  • ENV has not changed.
Approval beyond code review
  • UXWS/stakeholder approval has been confirmed.
  • UXWS/stakeholder review will be completed retroactively.
  • UXWS/stakeholder review is not needed.
Additional context needed to review

RESULTS_PER_PAGE has been set to 50 for this PR build. Each tab should list 50 results (or as many as possible).

Code Reviewer

Code
  • I have confirmed that the code works as intended.
  • Any CodeClimate issues have been fixed or confirmed as
    added technical debt.
Documentation
  • The commit message is clear and follows our guidelines
    (not just this pull request message).
  • The documentation has been updated or is unnecessary.
  • New dependencies are appropriate or there were no changes.
Testing
  • There are appropriate tests covering any new functionality.
  • No additional test coverage is required.

Why these changes are being introduced:

Configuring the results per page to a non-default number yielded
unexpected numbers of results. This was because the per-page value is
set at multiple points in the query processing chain, and not always
consistently.

Relevant ticket(s):

- [USE-442](https://mitlibraries.atlassian.net/browse/USE-442)

How this addresses that need:

This updates how results per page is defined for TIMDEX queries.
`SearchController#fetch_timdex_data`, now ensures that `per_page` is
always set by checking env and falling back to the default value of
'20'. This mirrors how the value is set for the corresponding Primo
method.

The query param name is also updated from `size` to `perPage`. That
change had been made in TIMDEX API, but we forgot to make it here.

Side effects of this change:

- Some cassettes were regenerated.
- We should, at some point, evaluate whether it's possible to simplify
the query processing chain.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 22926501069

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.188%

Totals Coverage Status
Change from base Build 22870113534: 0.0%
Covered Lines: 1355
Relevant Lines: 1380

💛 - Coveralls

@qltysh
Copy link

qltysh bot commented Mar 10, 2026

❌ 3 blocking issues (3 total)

Tool Category Rule Count
rubocop Lint Class has too many lines. [289/100] 1
rubocop Lint Assignment Branch Condition size for fetch\_timdex\_data is too high. [<10, 19, 6> 22.29/17] 1
rubocop Lint Method has too many lines. [15/10] 1

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