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

Avoid showing the message Page: 1 of 0 shown #1412

Closed
devdanzin opened this issue Nov 30, 2024 · 0 comments · Fixed by #1413
Closed

Avoid showing the message Page: 1 of 0 shown #1412

devdanzin opened this issue Nov 30, 2024 · 0 comments · Fixed by #1413

Comments

@devdanzin
Copy link
Member

In plone/Products.CMFPlone#3591, it's reported that the message Page: 1 of 0 shown is displayed when there are no pages. I think I've found the issue in mockup, here:

<div class="pagination-info">
<%- _t("Page:") %> <span class="current"><%- currentPage %></span>
<%- _t("of") %>
<span class="total"><%- totalPages %></span>
<%- _t("shown") %>
</div>

I think the fix should be here, checking that response.total is zero and setting this.state.totalPages to 1:

parseState: function (response, queryParams, state, options) { // eslint-disable-line
this.state.totalRecords = response.total;
this.state.totalPages = Math.ceil(response.total / state.pageSize);
},

Does this make sense? Should I send a PR?

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 a pull request may close this issue.

1 participant