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

Fix to Pagination position is retained between searches #2159 #2463

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

hugo-escire
Copy link
Contributor

References

Add references/links to any related issues or PRs. These may include:

Description

I made a little fix, now when search submit is trigger, it must return to first page. I think this is the correct behaviour for search components.

Instructions for Reviewers

  1. Open https://demo7.dspace.org/search (in this case, the /search route)
  2. Go to the last results page
  3. Change the query to test → bound to have fewer results than everything
  4. "Your search returned no results"
  5. The pagination UI is not shown, the only way to find out you're on a page that doesn't exist is through the URL: it will still have e.g. spc.page=170

List of changes in this PR:

  • First, I added firstPage Query Param to force navigating to first Page after submit
  • Second, I changed test's of Search-Component-Form in order to expect the correct behaviour of the search.

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • 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 yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn 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.
  • 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.

@alanorth
Copy link
Contributor

Thanks @hugo-escire. I can reproduce the bug as described and this patch fixes it.

@alanorth alanorth self-requested a review August 28, 2023 11:46
@tdonohue tdonohue added bug 1 APPROVAL pull request only requires a single approval to merge port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Aug 28, 2023
@tdonohue tdonohue added this to the 7.6.1 milestone Aug 28, 2023
@alanorth alanorth merged commit eaeda31 into DSpace:main Aug 28, 2023
10 checks passed
@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-7_x:

@tdonohue tdonohue modified the milestones: 7.6.1, 8.0 Aug 28, 2023
@tdonohue tdonohue removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Aug 28, 2023
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 bug
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Pagination position is retained between searches
4 participants