Skip to content

Conversation

@AllenBW
Copy link
Contributor

@AllenBW AllenBW commented Feb 26, 2018

closes #217

Given discussion in #217, gonna rescope this to just be the pager component, the rest isn't desired for implementation

https://AllenBW.github.io/patternfly-react/

☝️ 📚

@coveralls
Copy link

Pull Request Test Coverage Report for Build 815

  • 3 of 11 (27.27%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.5%) to 69.909%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/Pagination/Pager.js 3 11 27.27%
Totals Coverage Status
Change from base Build 804: -0.5%
Covered Lines: 1087
Relevant Lines: 1400

💛 - Coveralls

@coveralls
Copy link

coveralls commented Feb 26, 2018

Pull Request Test Coverage Report for Build 977

  • 11 of 11 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 71.577%

Totals Coverage Status
Change from base Build 964: 0.2%
Covered Lines: 1255
Relevant Lines: 1585

💛 - Coveralls

@AllenBW AllenBW force-pushed the #217-adds-pager-pagination branch from ac130e3 to 8ae0182 Compare February 27, 2018 14:48
@AllenBW AllenBW changed the title [WIP]feat(Pagination): adds pager and simple pagination feat(Pagination): adds pager and simple pagination Mar 2, 2018
@AllenBW AllenBW changed the title feat(Pagination): adds pager and simple pagination feat(Pagination): adds pager Mar 2, 2018
@AllenBW AllenBW force-pushed the #217-adds-pager-pagination branch from 8ae0182 to 49d7fb7 Compare March 3, 2018 12:53
return (
<ul className={classes}>
<li className={disablePrevious ? 'previous disabled' : 'previous'}>
<a
Copy link
Member

Choose a reason for hiding this comment

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

I know Patternfly uses anchors but I think we should use buttons. Using <Button bsStyle="link" > provides accessibility and putting disabled on the button uses the disabled cursor and doesn't show the clicks.

We may need to add scss/less to do this but I think it's the right thing to do. Thoughts? I think we should open an issue against Patternfly to support the use of buttons in this context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whether its buttons or anchors, the issue (of disabled buttons not showing appropriate cursor type) will persist so long as this thinggah lurks about https://github.com/patternfly/patternfly/blob/master/src/less/pager.less#L35

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SO we can open an issue to fixup the cursor type on disabled.. buttttt doesn't necessarily require the change from anchors to buttons 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Putting disabled on a button shows the disabled cursor.

Putting disabled on the anchor rather than just on the li actually disables the anchor (no click action). Adding an href would also address the accessibility. At a minimum, we should do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've updated the storybook so yah can see, putting the disabled on the anchor does not remedy the situation as the aforementioned class overrides with cursor: default;

Copy link
Member

Choose a reason for hiding this comment

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

correct, no cursor change but it at least it doesn't handle the click (same should be done in pagination row for #253)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

? I'm confused, it didn't handle the click before because of line 27, the presence or absence of disabled has no bearings on the triggering of an event 😕

Copy link
Member

Choose a reason for hiding this comment

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

OK, you're right. I was being mislead by my eyes and the fact that selecting the Previous button disabled knob is not disabling the previous button.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OH THE KNOB ISN'T WORKING great catch, on it.

@AllenBW AllenBW force-pushed the #217-adds-pager-pagination branch 3 times, most recently from 9555bbc to 51d89a6 Compare March 5, 2018 19:56
@AllenBW
Copy link
Contributor Author

AllenBW commented Mar 7, 2018

Or maybe this doesn't need ux review cuz its a preexisting pattern ? 🤷‍♀️ Storybook has been restored to include pager.

priley86
priley86 previously approved these changes Mar 12, 2018
<li className={disablePrevious ? 'previous disabled' : 'previous'}>
<a
href="#"
className={disablePrevious ? 'disabled' : ''}
Copy link
Member

Choose a reason for hiding this comment

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

we've been using className={classNames({'disabled': disablePrevious})} for this sort of thing

@AllenBW AllenBW force-pushed the #217-adds-pager-pagination branch from 67c3850 to 21c0baa Compare March 14, 2018 15:14
@AllenBW
Copy link
Contributor Author

AllenBW commented Mar 14, 2018

@jeff-phillips-18 @priley86 ok ok ok updated the snapshot, nowwwwwwww this is really g2g

@AllenBW AllenBW force-pushed the #217-adds-pager-pagination branch 3 times, most recently from e144743 to 429e47f Compare March 15, 2018 14:42
}
}}
>
<span className="i fa fa-angle-left" />
Copy link
Member

Choose a reason for hiding this comment

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

oooo forgot one other thing... can we use <Icon name="angle-left"> or something like that?

Copy link
Member

Choose a reason for hiding this comment

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

otherwise i am totes mcgoates happy 👍

@jeff-phillips-18
Copy link
Member

@patternfly/patternfly-react-ux

@AllenBW AllenBW force-pushed the #217-adds-pager-pagination branch from 429e47f to 0f4a381 Compare March 15, 2018 15:32
@maryclarke
Copy link
Member

Are both sets of buttons suppose to be affected by the checkboxes below for disabling? Only the mini ones seem to respond.

@AllenBW
Copy link
Contributor Author

AllenBW commented Mar 15, 2018

Nope only the mini ones @maryclarke

@priley86
Copy link
Member

priley86 commented Mar 19, 2018

@AllenBW to @maryclarke 's question... WDYT about making additional knobs for disabling the default buttons too (or using the same knobs)? Should be easy enough ;)

@AllenBW AllenBW force-pushed the #217-adds-pager-pagination branch from 0f4a381 to 8d85cd6 Compare March 19, 2018 12:20
@AllenBW
Copy link
Contributor Author

AllenBW commented Mar 19, 2018

Oh oh apologies @maryclarke @priley86 didn't realize this was a request for change, updated storybook, both buttons now behave exactly the same 🙇‍♀️

@priley86
Copy link
Member

@AllenBW thanks!! 👍 this looks great to me...

@maryclarke anything else here?

@@ -0,0 +1,86 @@
import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
Copy link
Member

Choose a reason for hiding this comment

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

ugh one more thing now... we are rebasing everything to classNames soon in #274 ... do you mind updating this one last thing? I am so sorry 😆

@maryclarke
Copy link
Member

Nothing else, LGTM!

@AllenBW AllenBW force-pushed the #217-adds-pager-pagination branch from 8d85cd6 to ab0dd2f Compare March 19, 2018 15:12
@AllenBW
Copy link
Contributor Author

AllenBW commented Mar 19, 2018

@priley86 updated!

@priley86
Copy link
Member

awesome! you are the 💣 @AllenBW

@priley86 priley86 merged commit 4fd67b4 into patternfly:master Mar 19, 2018
@jgiardino jgiardino removed the review label Mar 19, 2018
@AllenBW AllenBW deleted the #217-adds-pager-pagination branch March 19, 2018 20:22
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.

Enhancement - Pagination previous/next paging

6 participants