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

feat(chipGroup): add heading level prop to toolbar chip group label by boaz0 · Pull Request #2278 · patternfly/patternfly-react · GitHub

feat(chipGroup): add heading level prop to toolbar chip group label - #2278

Merged
tlabaj merged 1 commit into
patternfly:masterfrom
boaz0:closes_2167
Jun 27, 2019
Merged

feat(chipGroup): add heading level prop to toolbar chip group label#2278
tlabaj merged 1 commit into
patternfly:masterfrom
boaz0:closes_2167

Conversation

boaz0 commented Jun 17, 2019
edited
Loading

Copy link
Copy Markdown
Member

What:

closes #2167

  • add heading level prop to ChipGroup
  • pass heading level to Chip Group Toolbar item through Context API
  • update tests
  • HeadingLevel type was moved from Title to helpers
  • Chip Group Toolbar Item is using HeadingLevel type in its own heading level prop

Copy link
Copy Markdown
Collaborator

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

codecov-io commented Jun 17, 2019
edited
Loading

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@a5d571e). Click here to learn what that means.
The diff coverage is 0%.

@@           Coverage Diff            @@
##             master   #2278   +/-   ##
========================================
  Coverage          ?   80.6%           
========================================
  Files             ?     666           
  Lines             ?    8441           
  Branches          ?     720           
========================================
  Hits              ?    6804           
  Misses            ?    1274           
  Partials          ?     363
Flag Coverage Δ
#patternfly3 85.23% <ø> (?)
#patternfly4 76.18% <0%> (?)
#patternflymisc 95.79% <ø> (?)
Impacted Files Coverage Δ
...ernfly-4/react-core/src/components/Title/Title.tsx 94.11% <ø> (ø)
.../src/components/ChipGroup/ChipGroupToolbarItem.tsx 50% <0%> (ø)

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 a5d571e...65e2fde. Read the comment docs.

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Contributor

The prop works as expected! 🎉

The only question I have is whether the prop should move to the parent <ChipGroup> component?

With the Accordion component, we discussed this and ended up supporting the prop on the parent <Accordion> component, because in that component, it would be really odd to have different heading levels for different toggles (because there would then be a disconnect between the visual presentation and the semantic structure).

I would think that same reason is true in this case, but am curious if anyone has some reason for supporting this prop on the <ChipGroupToolbarItem> component instead.

I'm pulling in @mturley because he had provided suggestions on how to implement this for Accordion, and might have relevant info that would be helpful to share for this case as well.

mturley commented Jun 25, 2019

Copy link
Copy Markdown
Contributor

@boaz0, I agree with @jgiardino that we should probably have the consumer pass one headingLevel prop to the parent <ChipGroup> instead of having to pass it to each <ChipGroupToolbarItem>, since it reduces duplication in the consumer's code and prevents them from using different heading levels in the same chip group.

@jenny-s51 implemented this for Accordion using React's Context API in this PR: https://github.com/patternfly/patternfly-react/pull/2290/files. Basically in the ChipGroup component you'd accept headingLevel as a prop and pass it to a ChipGroupContext.Provider, and then in ChipGroupToolbarItem you'd render a ChipGroupContext.Consumer that takes a function for a child, and this function can pull the headingLevel out of its arguments and return the children rendered with that headingLevel.

If you need any help, feel free to let me know!

boaz0 commented Jun 25, 2019

Copy link
Copy Markdown
Member Author

@mturley no problem I will be working on this.
Thanks for your feedback!

boaz0 commented Jun 25, 2019

Copy link
Copy Markdown
Member Author

@mturley updated PR feel free to review and give some feedback.

mturley 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

Thanks for your quick update @boaz0 ! Your actual changes look great, I'm just a little obsessed with code style today.

Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>

boaz0 commented Jun 26, 2019

Copy link
Copy Markdown
Member Author

@mturley thanks a lot! Would you mind reviewing this again?

jessiehuff 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! :)

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

LGTM

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

I have the same question as Joachim

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

LGTM

tlabaj merged commit d87ce91 into patternfly:master Jun 27, 2019

boaz0 commented Jun 28, 2019

Copy link
Copy Markdown
Member Author

Thank you all
@jgiardino @mturley @jessiehuff @jschuler @tlabaj

boaz0 deleted the closes_2167 branch June 28, 2019 14:43
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.

ChipGroup - prop for heading level

10 participants


Back | FazBrowse Home | New Git URL