Skip to content

fix(ListView): Fixed issue with hideCloseIcon not being respected - #298

Merged
priley86 merged 3 commits into
patternfly:masterfrom
chalettu:listview-hide_close_icon
Apr 13, 2018
Merged

priley86 merged 3 commits into
patternfly:masterfrom
chalettu:listview-hide_close_icon

Conversation

@chalettu

@chalettu chalettu commented Apr 6, 2018

Copy link
Copy Markdown
Contributor

Fix for issue #277 where the hideCloseIcon property did not have an effect on expanded content.

@chalettu

chalettu commented Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

Screenshot of expanded content if you add hideCloseIcon=true to listviewitem.
closeicon

@chalettu
chalettu requested a review from priley86 April 6, 2018 17:32
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 1111

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

Totals Coverage Status
Change from base Build 1105: 0.01%
Covered Lines: 1260
Relevant Lines: 1585

💛 - Coveralls

@coveralls

coveralls commented Apr 6, 2018 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 1159

  • 0 of 0 (NaN%) changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 72.499%

Totals Coverage Status
Change from base Build 1158: 0.0%
Covered Lines: 1259
Relevant Lines: 1579

💛 - Coveralls

return (
<div className={classes}>
{onClose && (
{!hideCloseIcon && onClose && (

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.

The idea was that onClose would be undefined if hideCloseIcon was passed to the ListViewItem. The problem is that onClose is being defaulted 😞

We could check onClose !== noop rather than passing along the hideCloseIcon property

heading={title}
description={description}
stacked={boolean('Stacked', false)}
hideCloseIcon={false}

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.

Can we make this a knob?

Changed logic to use onclose instead of passing in hideCloseIcon to determine whether to show close icon
@chalettu

chalettu commented Apr 6, 2018

Copy link
Copy Markdown
Contributor Author

@jeff-phillips-18 thank you for the review and feedback. I implemented your suggestions and now have an updated screenshot. Thank you.
updatedhideicon

Comment thread src/components/ListView/ListViewItem.js Outdated
<ListViewGroupItemContainer
expanded={compoundExpanded}
onClose={hideCloseIcon ? undefined : onCloseCompoundExpand}
hideCloseIcon={hideCloseIcon}

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.

No need to pass this now.

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.

@chalettu This one is still there but can be removed.

Comment thread src/components/ListView/ListViewItem.js Outdated
<ListViewGroupItemContainer
expanded={expanded}
onClose={hideCloseIcon ? undefined : this.toggleExpanded}
hideCloseIcon={hideCloseIcon}

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.

No need to pass this now.

@chalettu

Copy link
Copy Markdown
Contributor Author

@jeff-phillips-18 , I removed the parameter. Let me know if you have any more feedback. Thanks in advance

@jeff-phillips-18

Copy link
Copy Markdown
Member

@chalettu Still one left 😉

@chalettu
chalettu force-pushed the listview-hide_close_icon branch from 3400d27 to cd076f5 Compare April 12, 2018 18:18
@chalettu

Copy link
Copy Markdown
Contributor Author

@jeff-phillips-18 , got it. Removed the last one. Good catch.

@priley86

Copy link
Copy Markdown
Member

LGTM. thanks!

@priley86
priley86 merged commit 0b5fc10 into patternfly:master Apr 13, 2018
@chalettu
chalettu deleted the listview-hide_close_icon branch April 23, 2018 16:37
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.

4 participants