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

feat(accordion): Add accordion to pf by ibolton336 · Pull Request #1511 · patternfly/patternfly-react · GitHub

feat(accordion): Add accordion to pf - #1511

Merged
redallen merged 8 commits into
patternfly:masterfrom
ibolton336:new-accordion
Apr 23, 2019
Merged

feat(accordion): Add accordion to pf#1511
redallen merged 8 commits into
patternfly:masterfrom
ibolton336:new-accordion

Conversation

Copy link
Copy Markdown
Member

What: closes #1387

Additional issues:

ibolton336 added the PF4 label Mar 6, 2019
ibolton336 requested a review from tlabaj March 6, 2019 15:33
ibolton336 force-pushed the new-accordion branch 3 times, most recently from 3f7d31c to b108c4a Compare March 6, 2019 15:39
tlabaj requested review from kmcfaul and removed request for rebeccaalpert and tlabaj March 6, 2019 15:51
ibolton336 force-pushed the new-accordion branch 2 times, most recently from bc0e1e6 to 3eaad26 Compare March 6, 2019 20:02

redallen commented Mar 7, 2019

Copy link
Copy Markdown
Contributor

Rebase on latest master to fix CircleCI errors and get a deploy preview.

codecov-io commented Mar 7, 2019
edited
Loading

Copy link
Copy Markdown

Codecov Report

Merging #1511 into master will increase coverage by 0.03%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1511      +/-   ##
==========================================
+ Coverage   82.74%   82.78%   +0.03%     
==========================================
  Files         601      608       +7     
  Lines        6647     6696      +49     
  Branches       72       76       +4     
==========================================
+ Hits         5500     5543      +43     
- Misses       1120     1123       +3     
- Partials       27       30       +3
Flag Coverage Δ
#patternfly3 84.87% <ø> (ø) ⬆️
#patternfly4 79.55% <100%> (+0.14%) ⬆️
#patternflymisc 95.68% <ø> (ø) ⬆️
Impacted Files Coverage Δ
...4/react-core/src/components/Accordion/Accordion.js 100% <100%> (ø)
...t-core/src/components/Accordion/AccordionToggle.js 100% <100%> (ø)
...4/react-core/src/components/ChipGroup/ChipGroup.js 90.9% <0%> (-9.1%) ⬇️
...nfly-4/react-core/src/components/ChipGroup/Chip.js 75% <0%> (ø) ⬆️
...e/src/components/AboutModal/AboutModalBoxHeader.js 100% <0%> (ø) ⬆️
...atternfly-4/react-core/src/components/Card/Card.js 100% <0%> (ø) ⬆️
...y-4/react-table/src/components/Table/HeaderCell.js 100% <0%> (ø) ⬆️
...ly-4/react-core/src/components/Page/PageSection.js 100% <0%> (ø) ⬆️
...fly-4/react-table/src/components/Table/BodyCell.js 100% <0%> (ø) ⬆️
...react-core/src/components/AboutModal/AboutModal.js 70.83% <0%> (ø) ⬆️
... and 11 more

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 ced2b66...596b54c. Read the comment docs.

tlabaj requested a review from christiemolloy March 8, 2019 13:41
kmcfaul previously approved these changes Mar 27, 2019

redallen commented Mar 29, 2019
edited
Loading

Copy link
Copy Markdown
Contributor

CircleCI times out before it shows this, but there is this error that needs to be fixed that happens when building the docs locally @ibolton336 :

@patternfly/react-docs: > 1 | export var matches = Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
@patternfly/react-docs:     |                      ^
@patternfly/react-docs:   2 | 
@patternfly/react-docs:   3 | if (!Element.prototype.matches) {
@patternfly/react-docs:   4 |   Element.prototype.matches = matches;
@patternfly/react-docs: 
@patternfly/react-docs:   WebpackError: ReferenceError: Element is not defined
@patternfly/react-docs:   
@patternfly/react-docs:   - closestPolyfill.js:1 Module.../../patternfly-3/patternfly-react/dist/esm/com    mon/closestPolyfill.js
@patternfly/react-docs:     lib/Users/zallen/src/patternfly-react-master/packages/patternfly-3/patternfl    y-react/dist/esm/common/closestPolyfill.js:1:22

Run yarn build:docs locally to reproduce. Let me know if everything's fine on your end and I'll take another look!

tlabaj left a comment
edited
Loading

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

@ibolton336 can you add the accordian wrapper to your PR? you will need to wait until master has updated to a later version of core.
.pf-c-accordion__expanded-content-body (child of .pf-c-accordion__expanded-content)

This is a change from core referenced in issue #1682

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

@ibolton336 The way the docs are being generated was recently changed, can you please rebase and move the examples into the MD file.

ibolton336 force-pushed the new-accordion branch 2 times, most recently from b3028ff to 9751033 Compare April 18, 2019 16:55

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Member

I don't think that the behavior is quite right here. In a classic accordion control, only one panel is ever opened at a time. See the behavior of the PF3 Accordion component, for example: https://www.patternfly.org/pattern-library/widgets/#accordion Note here that opening a new panel closes the current one. That said, it could be useful to have both variations - one with simple collapsible panels as you have now and another withe the accordion behavior as described above.

The other thing I questioned was the difference between the Simple and the Fixed accordion. My understanding is that the intent of the fixed accordion is that the height is constrained. So if the contents will not fit within the max height, a scrollbar will be exposed within the open panel to scroll the content. Is that also what you intended @mcoker ?

mcoker commented Apr 22, 2019

Copy link
Copy Markdown
Contributor

@mcarrano Agreed re: having the option for both types of behavior.

Re: the fixed examples, yep - looking at the pf3 fixed height accordion, this accordion is the same where the max height is defined on the expandable panel for an accordion item. In the PF3 examples, that max-height is 69px. In the PF4 component, looks like we went with 150px.

Also the .pf-c-accordion__toggle button shouldn't be a PF4 <Button> component (currently .pf-c-button.pf-m-plain), it should just use a regular <button> html element.

And when an item is expanded, we also need to add .pf-m-expanded to the expanded dd.

tlabaj commented Apr 23, 2019

Copy link
Copy Markdown
Contributor

@mcarrano @mcoker We are going to merge this and make the updates in a new PR.

Copy link
Copy Markdown
Contributor

Some initial comments after a quick review...

aria-label shouldn't be a required prop. Also, it makes sense that it's included on the <dl> so I will add an issue to track that.

The section headings that are expand/collapse buttons have aria-label="Details" and also aria-labelledby="..." defined. These attributes should not be there. This overrides the actual heading text that's specified, preventing that text from being announced.

Core does not include aria-controls. This attribute is noted as optional in the WAI-ARIA practices for disclosure (show/hide). I would suggest leaving it out, since the controlled contents are immediately after the button.

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

redallen merged commit c02e683 into patternfly:master Apr 23, 2019
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.

Introduce the Accordion Component

Back | FazBrowse Home | New Git URL