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

Refactor(Pagination): convert Pagination instances to PF4 #129

Merged
merged 4 commits into from
Aug 8, 2022

Conversation

jenny-s51
Copy link
Contributor

@jenny-s51 jenny-s51 commented Jul 27, 2022

What's included

...
Closes #128

Example

Before:
Screen Shot 2022-07-27 at 2 02 09 PM
Screen Shot 2022-07-27 at 2 02 15 PM
Screen Shot 2022-07-27 at 2 02 22 PM

After:
Screen Shot 2022-07-27 at 1 59 58 PM
Screen Shot 2022-07-27 at 2 00 12 PM
Screen Shot 2022-07-27 at 2 00 58 PM

Updates issue/story

DISCOVERY-154

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2022

Codecov Report

❗ No coverage uploaded for pull request base (dev@ceca4e3). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##             dev     #129   +/-   ##
======================================
  Coverage       ?   74.74%           
======================================
  Files          ?       98           
  Lines          ?     3093           
  Branches       ?      852           
======================================
  Hits           ?     2312           
  Misses         ?      691           
  Partials       ?       90           

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 ceca4e3...4bd65d9. Read the comment docs.

@cdcabrera cdcabrera added the pf4 Tracking for pf4 refactors label Jul 27, 2022
@cdcabrera cdcabrera requested review from bclarhk and ruda July 29, 2022 17:28
@jenny-s51 jenny-s51 force-pushed the pagination branch 11 times, most recently from 553f342 to ffbc184 Compare August 1, 2022 18:03
Copy link
Member

@cdcabrera cdcabrera left a comment

Choose a reason for hiding this comment

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

@jenny-s51
This looks like another Redux state piece we can simplify. I gave you enough to get started, there are a few pieces missing... like passing the values back to state, updating the constants file associated with viewPaginationConstants.js and the unit test viewOptionsReducer.test.js

We'll see how it goes, then move to the next set of tweaks

src/redux/reducers/viewOptionsReducer.js Show resolved Hide resolved
src/styles/app/_views.scss Outdated Show resolved Hide resolved
Copy link
Contributor Author

@jenny-s51 jenny-s51 left a comment

Choose a reason for hiding this comment

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

@cdcabrera Thank you for all your awesome and helpful suggestions on this!! I think I've addressed your comments and just wanted to confirm... is this what you had in mind for the bottom pagination?

Screen Shot 2022-08-02 at 2 04 01 PM

I had to make a couple more updates which included making the perPage menu open upwards, and removing the padding-bottom: 0 !important;
from the css class since visually we'd need to keep that bottom padding there! WDYT?

@cdcabrera
Copy link
Member

cdcabrera commented Aug 3, 2022

@jenny-s51 heh, close, but not quite... paging needed to stay where it was to account for the infinite page scroll. We're just using the styling from bottom paging, not the location... the top styling unfortunately removes some of the features on smaller screens, limiting accessibility and general use, blame PF for that one.

Once you move the paging back to the top, with the bottom styling, while doing the required updates, I'll review

@jenny-s51
Copy link
Contributor Author

jenny-s51 commented Aug 3, 2022

@cdcabrera found a bug while making the most recent updates -- I tested out a whole bunch of z-index changes on our css (and did a whole bunch of experimenting in the PF docs), but can't seem to get that options menu out in front of the list content on smaller viewports!

Screen Shot 2022-08-03 at 1 25 00 PM

This behavior currently exists in the PF docs too, so I opened an issue: patternfly/patternfly-react#7786

Definitely a weird one! Let me know what you think is the best course of action here. A potential workaround might be to have both top and bottom pagination for now?

Copy link
Member

@cdcabrera cdcabrera left a comment

Choose a reason for hiding this comment

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

@jenny-s51 I can not recreate the z-index issue that you're seeing, even after

  • multiple reinstalls,
  • a clean install of just your repo and branch
    -making sure the latest dev branch changes were there
  • making sure the NPM packages were updated
  • checking other browsers
  • and generally making sure my tests are coming back clean
  • time has now been burned...

I recommend you

Your unit snapshots are showing you exactly the z-index issue, HTML sequencing... there is a high probability this is an issue with your PR, not Patternfly.

If you continue to have issues, we can walk through what each of is seeing as a 1:1 after you've gone through the recommendations.

You've got more investigation to do

@jenny-s51 I was finally able to recreate this issue by doing another clean install, and dropping down to below 800pxish screen-width. That being said, this is a non-issue for this repository, specifically, because we're planning on updating the inventory list it is important to follow process.

We're still recommending you

  • make sure your tests are updated, snapshots and all
  • update your branch and commits
  • and still acknowledge that this may be a non-issue for this repository on the PF issue
  • Continue with doing the updates as is. Once that inventory update goes into place refactors will be happening based on UX-designs recommendations.

In the future, to avoid confusion and wasting time, it is recommended your branch and ALL unit tests be updated before calling out issues. It makes reviewing more difficult when things are partially updated.

@jenny-s51 jenny-s51 force-pushed the pagination branch 2 times, most recently from f47c3a6 to ad79797 Compare August 4, 2022 18:29
Copy link
Contributor Author

@jenny-s51 jenny-s51 left a comment

Choose a reason for hiding this comment

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

Thank you for your feedback and suggestions @cdcabrera - moving forward I will make sure to update tests/snapshots before raising an issue.

I've proceeded with the updates as-is, but this PR will include a buggy instance of the pagination dropdown on viewports < 800px, since we're using the bottom styling at the top. Based on your comments, it seems like that's fine for the time being?

We are going against design guidelines by implementing pagination this way, so I can close the PF issue, since this one specific use case probably doesn't need to be supported! As you said, it sounds like we will be doing some more refactoring to follow UX guidelines down the road!

this is a non-issue for this repository, specifically, because we're planning on updating the inventory list

Would you mind clarifying what you mean by this? Are you referring to #106 or something else?

@cdcabrera
Copy link
Member

@jenny-s51 We are headed towards release points, 3 of them to be exact, 1 we've already completed.

This is going to sound harsh, but as a general developer you do not need the full picture, that is the role.

Copy link
Member

@cdcabrera cdcabrera left a comment

Choose a reason for hiding this comment

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

Minor update

After that and the unit tests are updated, if any, and short of any other issues that pop up, we'll be good

src/styles/app/_views.scss Show resolved Hide resolved
Copy link

@bclarhk bclarhk left a comment

Choose a reason for hiding this comment

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

z-index issue to be addressed with table update.
Everything else is groovy

@cdcabrera cdcabrera merged commit cec3e45 into quipucords:dev Aug 8, 2022
cdcabrera pushed a commit that referenced this pull request Aug 12, 2022
* styling, temp adjustments
* viewPaginationRow, pf4 component
* viewPaginationConstants, updated types
* viewOptionsReducer, focus paging, clean up
cdcabrera pushed a commit that referenced this pull request Sep 7, 2022
* styling, temp adjustments
* viewPaginationRow, pf4 component
* viewPaginationConstants, updated types
* viewOptionsReducer, focus paging, clean up
cdcabrera pushed a commit that referenced this pull request Sep 8, 2022
* styling, temp adjustments
* viewPaginationRow, pf4 component
* viewPaginationConstants, updated types
* viewOptionsReducer, focus paging, clean up
cdcabrera pushed a commit that referenced this pull request Sep 20, 2022
* styling, temp adjustments
* viewPaginationRow, pf4 component
* viewPaginationConstants, updated types
* viewOptionsReducer, focus paging, clean up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pf4 Tracking for pf4 refactors
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants