FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(Pagination): automate pagination and overflow logic by evwilkin · Pull Request #3182 · patternfly/patternfly-react · GitHub

feat(Pagination): automate pagination and overflow logic - #3182

Merged
evwilkin merged 19 commits into
patternfly:masterfrom
evwilkin:feat_3136
Dec 5, 2019
Merged

feat(Pagination): automate pagination and overflow logic#3182
evwilkin merged 19 commits into
patternfly:masterfrom
evwilkin:feat_3136

Conversation

evwilkin commented Oct 22, 2019
edited
Loading

Copy link
Copy Markdown
Member

What:
fixes #3136

This feature allows the component to automatically paginate the users's data for them, and provides a "defaultToFullPage" flag that will automatically move the user back to the last full page of results when they change the number of rows to view per page.

Additional issues:

tlabaj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Hi. Can you update the title of the PR to be more descriptive please. Thanks!

Copy link
Copy Markdown
Collaborator

PatternFly-React preview: https://patternfly-react-pr-3182.surge.sh

codecov-io commented Oct 22, 2019
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #3182 into master will decrease coverage by <.01%.
The diff coverage is 79.31%.

@@            Coverage Diff             @@
##           master    #3182      +/-   ##
==========================================
- Coverage   67.52%   67.52%   -0.01%     
==========================================
  Files         896      896              
  Lines       25112    25133      +21     
  Branches     2173     2178       +5     
==========================================
+ Hits        16958    16971      +13     
- Misses       7141     7147       +6     
- Partials     1013     1015       +2
Flag Coverage Δ
#misc 95.45% <ø> (ø) ⬆️
#patternfly3 69.28% <ø> (ø) ⬆️
#patternfly4 65.01% <79.31%> (-0.01%) ⬇️
Impacted Files Coverage Δ
...eact-core/src/components/Pagination/Navigation.tsx 86.81% <100%> (+0.93%) ⬆️
...eact-core/src/components/Pagination/Pagination.tsx 81.25% <50%> (-1.29%) ⬇️
...rc/components/Pagination/PaginationOptionsMenu.tsx 87.03% <64.28%> (-8.21%) ⬇️
...nfly-react/src/components/Pagination/Pagination.js 27.27% <0%> (-0.57%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b110a3f...9e2a445. Read the comment docs.

evwilkin changed the title Feat 3136 Feat(Pagination): automate pagination and overflow logic Oct 22, 2019
evwilkin changed the title Feat(Pagination): automate pagination and overflow logic feat(Pagination): automate pagination and overflow logic Oct 22, 2019

dlabrecq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

How are these utils used with the pagination component?

I'm also curious how does this solve #1567 (e.g., using an offset). There is no example showing usage?

Ideally, the pagination component would be able to figure out what page you're on based on the total available rows and number of items per page.

seanforyou23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I left a few questions/comments, looking good. On first pass, it seems to improve the intro-table tutorial quite a bit - excited to get this in!

seanforyou23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is looking really great! Left a couple of questions, beyond that the only thing I think we wanted to mention is that I'm seeing the following error in the console:

Even with that error, the demo works fine so probably something simple. Nice work!

const inputPage = Navigation.parseInteger(this.state.userInputPage, lastPage) as number;
onPageInput(event, Number.isNaN(inputPage) ? (page as number) : inputPage);
onSetPage(event, Number.isNaN(inputPage) ? (page as number) : inputPage);
this.handleNewPage(event, Number.isNaN(inputPage) ? (page as number) : inputPage);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I wonder if there's a better way of handling that page here could be a string or a number. Could we instead cast it to a number in the place where it returns a string so we can avoid having to use as number type assertion in so many places? No worries if not, just curious in case it's an easy improvement.

dlabrecq previously approved these changes Nov 29, 2019

dlabrecq left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM. Nice job

/** Select from options to number of items per page. */
perPageOptions?: PerPageOptions[];
/** Indicate whether to show last full page of results when user selects perPage value greater than remaining rows */
defaultToFullPage?: boolean;

dlabrecq Nov 29, 2019
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Curious if defaultToFullPage is a PatternFly pattern in core? If not, lets double check this behavior with a designer.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for calling this out @dlabrecq , doing this now

seanforyou23 previously approved these changes Dec 2, 2019

seanforyou23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM, nice work!

…tch new last page of results when page number is automatically updated
evwilkin dismissed stale reviews from seanforyou23 and dlabrecq via f312fe8 December 2, 2019 16:23
mcoker previously approved these changes Dec 3, 2019

mcoker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

😁👍

mcarrano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks great @evwilkin Thanks for adding the documentation.

seanforyou23 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Love it! Nice work @evwilkin!

evwilkin merged commit af19ff8 into patternfly:master Dec 5, 2019
evwilkin deleted the feat_3136 branch December 5, 2019 14:09

Copy link
Copy Markdown
Collaborator

Your changes have been released in:

  • @patternfly/react-catalog-view-extension@1.1.44
  • @patternfly/react-core@3.126.0
  • @patternfly/react-docs@4.16.51
  • @patternfly/react-inline-edit-extension@2.14.2
  • demo-app-ts@3.14.0
  • @patternfly/react-integration@3.14.0
  • @patternfly/react-table@2.24.46
  • @patternfly/react-topology@2.11.32
  • @patternfly/react-virtualized-extension@1.3.45

Thanks for your contribution! 🎉

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 this pull request may close these issues.

Pagination and pagination overflow OOB logic

8 participants


Back | FazBrowse Home | New Git URL