react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

Support 'labelRowsPerPage' prop on Pagination

Open afilp opened this issue 1 year ago • 1 comments

I have a use case where I do not want to use the translated text but a conditionally different one.

Problem

I have a calendar and want to restrict the number of events per month on each call, so I need pagination on that "List" (that just uses a calendar). So, I do not want the pagination label to be called "Rows per page" there but rather "Events Shown on Calendar".

I cannot do this as the code is now.

image

Solution

Support the 'labelRowsPerPage' as a prop that we can use it.

How To Test

Describe the steps required to test the changes

Additional Checks

  • [ ] The PR targets master for a bugfix, or next for a feature
  • [ ] The PR includes unit tests (if not possible, describe why)
  • [ ] The PR includes one or several stories (if not possible, describe why)
  • [ ] The documentation is up to date

Also, please make sure to read the contributing guidelines.

afilp avatar Oct 04 '24 15:10 afilp

Thanks for you PR.

There are more labels in this component than just the "rows per page". Providing a way to override one and not the others leads to a half-baked functionality. So I'm reluctant to merge your contribution as is. Also, it lacks documentation.

Besides, what you ask is achievable in user land without too much hassle, so I wonder if we should move forward with this PR or not.

fzaninotto avatar Oct 07 '24 08:10 fzaninotto

I agree with @fzaninotto. Thanks for the PR anyway :)

djhi avatar Feb 11 '25 13:02 djhi