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(plugin-search-react): improve SearchPagination page limit change handling #17700

Merged
merged 5 commits into from
May 11, 2023

Conversation

gtestault
Copy link
Contributor

Hey, I just made a Pull Request!

Currently the SearchPagination component:

image

does not reset the page cursor when page limit changes.
This can cause some weird situations, for example:

  1. User clicks 4 times on 'next page' with page limit 10
  2. user now sees search result 40-50
  3. now the user switches page limit to 100
  4. he now sees search results 400-500 => this is way past what results the user went through

This PR fixes this behavior by resetting the page cursor when the page limit is changed.
Also, this PR fixes typescript typings by replacing the inexistent props omission onPageLimitChange prop with the correct onLimitChange.

✔️ Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)
  • All your commits have a Signed-off-by line in the message. (more info)

…seProps

Signed-off-by: Gabriel Testault <gabriel.testault@goto.com>
Signed-off-by: Gabriel Testault <gabriel.testault@goto.com>
Signed-off-by: Gabriel Testault <gabriel.testault@goto.com>
Signed-off-by: Gabriel Testault <gabriel.testault@goto.com>
@gtestault gtestault requested a review from a team as a code owner May 8, 2023 14:46
@github-actions github-actions bot added the search Things related to Search label May 8, 2023
@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented May 8, 2023

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage/plugin-search-react plugins/search-react patch v1.6.0-next.2

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

Uffizzi Preview deployment-24600 was deleted.

Signed-off-by: Gabriel Testault <gabriel.testault@goto.com>
@aitherios
Copy link
Contributor

Hi @gtestault, thanks for the fix! 🎉

@aitherios aitherios merged commit 2dc75f3 into backstage:master May 11, 2023
28 checks passed
@github-actions
Copy link
Contributor

Thank you for contributing to Backstage! The changes in this pull request will be part of the 1.14.0 release, scheduled for Tue, 16 May 2023.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
search Things related to Search
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants