Skip to content

pagination: fix negative page numbers on empty query #276

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

Closed
wants to merge 1 commit into from

Conversation

Samk13
Copy link
Member

@Samk13 Samk13 commented Jun 26, 2024

❤️ Thank you for your contribution!

Description

the original symptom is that the initial value in the Redux store starts at -1. Changing it resolves the problem, but I am concerned that other logic might rely on the init value, potentially causing other issues. Therefore, I limited my change to this component.

Before:

Screencast.from.2024-05-28.16.07.46.webm

After

test-pagination-4

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@Samk13 Samk13 changed the title pagination: fix negative pagination pagination: fix negative page numbers on empty query Jun 26, 2024
@fenekku
Copy link

fenekku commented Sep 16, 2024

What I was wondering here was why this behavior is not observed for empty searches over records or empty searches over communities (searching for communities). It's strange that only empty searches over members are affected. Doing the 1 / 25 check assumes static default values (i.e., what about size of 10 and so on) and masks reason for discrepancy.

After investigating, I figured it's because Members search doesn't reuse the initial page and size querystring arguments when making search queries like is the case for other searches (e.g., https://github.com/inveniosoftware/invenio-communities/blob/master/invenio_communities/assets/semantic-ui/js/invenio_communities/community/searchComponents/CommunitiesSearchBarElement.js#L17). Fixing that, fixes the issue and puts Members search on par with other searches. This PR: inveniosoftware/invenio-communities#1207 can supersede this one.

@Samk13
Copy link
Member Author

Samk13 commented Sep 16, 2024

Closing in favor of inveniosoftware/invenio-communities#1207

@Samk13 Samk13 closed this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released | Done 🚀
Development

Successfully merging this pull request may close these issues.

Pagination Error When Using Search Function in Community Members Tab
2 participants