Skip to content

Add custom input for page number in pagination - #4567

Draft
AndreaBarbasso wants to merge 5 commits into
DSpace:mainfrom
4Science:task/main/DURACOM-386_aligned
Draft

Add custom input for page number in pagination#4567
AndreaBarbasso wants to merge 5 commits into
DSpace:mainfrom
4Science:task/main/DURACOM-386_aligned

Conversation

@AndreaBarbasso

Copy link
Copy Markdown
Contributor

References

Description

Created a new property in order to show an input field on the pagination component. The input accepts a number to go to the related page, falling back to the first or last page if the given input is out of boundaries.

Instructions for Reviewers

There is no configuration setting to enable this behavior right now (discussion is ongoing in #4566), so the only way to test it is either by setting true as the default value for enablePaginationInput or by passing a true value as a component input.
Then, the input should be visible and work as expected.

image

List of changes in this PR:

  • Created the new input
  • Added tests

Checklist

  • 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.

@tschammnut

Copy link
Copy Markdown

Hello! I tried out your patch and I noticed a few things:

  • The on-click binding seems to be unreachable, because the blur-event will probably always trigger before the on-click-event, at least on a desktop. But I don't know how it is for other devices like mobile or screen reader.
  • Personally, I find it a little annoying that the element moves around with the page number currently selected.
  • Triggering the blur-event seems to work fine, but when I hit enter after typing a number in the box, the page never refreshes but keeps displaying the „loading“ spinner.
  • Contrary to the description, a number too high will not default to the last page, but results in an „empty search results“ page.

I hope this helps. Thank you!

@github-actions

Copy link
Copy Markdown

Hi @AndreaBarbasso,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

# Conflicts:
#	src/app/shared/pagination/pagination.component.spec.ts
@github-actions

Copy link
Copy Markdown

Hi @AndreaBarbasso,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

4science-it pushed a commit to 4Science/dspace-angular that referenced this pull request Jun 19, 2026
Revert "[DSC-2618] hide downloads and view badges in collection"

Approved-by: Andrea Barbasso
Andrea Barbasso added 2 commits August 12, 2026 13:09
…URACOM-386_aligned

# Conflicts:
#	src/app/shared/pagination/pagination.component.ts
@AndreaBarbasso

Copy link
Copy Markdown
Contributor Author

I aligned this branch to the main branch and addressed @tschammnut's feedbacks!

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.

Add a page input to the paginator

2 participants