Skip to content

fix #5494: enable rotate to show surrounding pages on navigation#5505

Merged
alanorth merged 6 commits intoDSpace:mainfrom
guillermo-escire:feature/5494
Apr 22, 2026
Merged

fix #5494: enable rotate to show surrounding pages on navigation#5505
alanorth merged 6 commits intoDSpace:mainfrom
guillermo-escire:feature/5494

Conversation

@guillermo-escire
Copy link
Copy Markdown
Contributor

References

Fixes #5494

Description

Pagination control was not showing surrounding page numbers when navigating to later pages. Fixed by enabling rotate on the ngb-pagination component so it centers the active page within the visible range.

Instructions for Reviewers

List of changes in this PR:

  • Set [rotate]="true" on ngb-pagination in pagination.component.html
  • Added rotate = true as default value in PaginationComponentOptions for consistency
  • Added unit test in pagination.component.spec.ts to verify surrounding pages are shown when navigating to a later page

How to test:

  1. Open a paginated list with many pages (e.g. Search results)
  2. Navigate to page 10
  3. Verify the pagination control now shows surrounding pages: « 1 ... 8 9 [10] 11 12 ... N »

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using npm run lint
  • My PR doesn't introduce circular dependencies (verified via npm run check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@guillermo-escire
Copy link
Copy Markdown
Contributor Author

guillermo-escire commented Apr 17, 2026

Hi @lgeggleston ,

Frontend tests pass successfully (5821/5821).

CI is failing when starting the DSpace REST backend via Docker:

"no matching manifest for linux/amd64" (dspacesolr image)

This appears to be unrelated to this PR and likely an upstream CI/Docker issue.

@lgeggleston lgeggleston added improvement usability component: Discovery related to discovery search or browse system 1 APPROVAL pull request only requires a single approval to merge testathon Reported by a tester during Community Testathon labels Apr 17, 2026
@lgeggleston lgeggleston moved this to 🙋 Needs Reviewers Assigned in DSpace 10.0 Release Apr 17, 2026
@lgeggleston
Copy link
Copy Markdown

@guillermo-escire thanks! Yes, looks like there was just an unrelated failure on the last backend Docker image build, so I'll re-run the tests when that's fixed.

Copy link
Copy Markdown

@lgeggleston lgeggleston left a comment

Choose a reason for hiding this comment

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

Overall, tested and looks good for resolving the usability issue! Seems to work fine no matter the amount of results per page set and page navigated to. Just one comment about the component.html.

Comment thread src/app/shared/pagination/pagination.component.html
@lgeggleston lgeggleston moved this from 🙋 Needs Reviewers Assigned to 👀 Under Review in DSpace 10.0 Release Apr 20, 2026
@alanorth alanorth self-requested a review April 22, 2026 07:16
@github-project-automation github-project-automation Bot moved this from 👀 Under Review to 👍 Reviewer Approved in DSpace 10.0 Release Apr 22, 2026
@alanorth
Copy link
Copy Markdown
Contributor

Thanks @guillermo-escire. I tested this locally and found the search results experience better. +1 from me.

I'm wondering if this should be ported to other active branches since the changes are simple. It would have to be manually ported since src/app/core/pagination/pagination-component-options.model.ts is only present on main (DSpace 10-SNAPSHOT).

Note: I will squash your six commits into one to keep the git history clean.

@alanorth alanorth merged commit ae1ce17 into DSpace:main Apr 22, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this from 👍 Reviewer Approved to ✅ Done in DSpace 10.0 Release Apr 22, 2026
@alanorth alanorth added port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release labels Apr 22, 2026
@alanorth alanorth added this to the 10.0 milestone Apr 22, 2026
@guillermo-escire
Copy link
Copy Markdown
Contributor Author

Thanks @alanorth for the feedback! Regarding rollbacks to other active branches, I agree that it would be a good improvement, as the solution is simple. Also, there's no problem with merging branches; thanks for keeping the history clean!

@tdonohue
Copy link
Copy Markdown
Member

@guillermo-escire : Just a note here. It looks like any backports would need to be made manually by creating a new PR against the dspace-9_x and dspace-8_x branches. I also agree that this might be useful to backport, minimally to 9.x (but backporting to 8.x and 7.x is also welcome).

If you (or anyone else reading this) wants to create backport PRs, I'd gladly quickly review and merge them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge component: Discovery related to discovery search or browse system improvement port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release port to dspace-9_x This PR needs to be ported to `dspace-9_x` branch for next bug-fix release testathon Reported by a tester during Community Testathon usability

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Pagination is not user-friendly when navigating to later pages

4 participants