-
Notifications
You must be signed in to change notification settings - Fork 166
[Terra-Paginator] Added hidePageCount
prop to hide default page count provided by Paginator
#3924
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing that I want to call out is that, with this change, when the consumer sets a static pageLabel string on the ProgressivePaginator https://github.com/cerner/terra-core/pull/3924/files#diff-5e4d0230ddc94d1702b4ce988ef0f63246ba4a209192779171626a877ee85097R19, this displayed text would not change by any page navigation. For example, if they have the pageLabel as "Page 1", it will be still "Page 1" after they click the Next button because this pageLabel won't change. Just want to confirm that it's expected from the Fusion usage perspective.
That's the expectation of custom page label. user will see value exactly how he provides without any intervention of terra-paginator. ( There might be other use cases where user may require page count in different format than the one that terra-provides. This changes will help user to make those customization ) |
Looks like there are a few wdio test failures, could we fix them? |
fixed the screenshot failures |
* When specified allows user to set custom page count. User should provide custom page count as part `pageLabel` for best accessibility practices. | ||
* _(usage note: when `pageLabel` is not provided page count will not be hidden and default page count is displayed for best accessibility practices)_. | ||
*/ | ||
hidePageCount: PropTypes.bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a doc example for how and in what scenario this prop is used? I am having trouble understanding the purpose of this prop based on the test example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
Added
hidePageCount
prop to hide default page count provided by Paginator. so that user can set custom page count.What was changed:
Progressive Paginator and Controlled Progressive Paginator has been updated to hide the default page count ( highlighted on below screenshot )
Why it was changed:
To support passivity for fusion pass through of paginator and To allow user to pass in the count in desired format along with customPageLabel when required.
Testing
This change was tested using:
Updated
terra-core --> tests ---> Paginator ---> Progressive Paginator With Custom Label
to hide default Page count when hidePageCount is set to trueReviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
UXPLATFORM-9662
Thank you for contributing to Terra.
@cerner/terra