Skip to content

Conversation

@ibolton336
Copy link
Member

What:
#1016

Additional issues:

@patternfly-build
Copy link
Collaborator

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

@codecov-io
Copy link

codecov-io commented Mar 1, 2019

Codecov Report

Merging #1479 into master will not change coverage.
The diff coverage is 20%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1479   +/-   ##
=======================================
  Coverage   83.41%   83.41%           
=======================================
  Files         543      543           
  Lines        5619     5619           
  Branches       12       12           
=======================================
  Hits         4687     4687           
  Misses        930      930           
  Partials        2        2
Flag Coverage Δ
#patternfly3 84.94% <ø> (ø) ⬆️
#patternfly4 80.6% <20%> (ø) ⬆️
Impacted Files Coverage Δ
.../patternfly-4/react-core/src/components/Nav/Nav.js 80% <ø> (ø) ⬆️
...rnfly-4/react-core/src/components/Nav/NavToggle.js 41.66% <0%> (ø) ⬆️
...y-4/react-core/src/components/Nav/NavExpandable.js 81.81% <100%> (ø) ⬆️

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 61df512...f92a086. Read the comment docs.

componentWillReceiveProps(nextProps) {
if (nextProps.defaultValue !== this.state.value) {
this.setState({ value: nextProps.defaultValue });
componentDidUpdate(prevProps) {
Copy link
Member

Choose a reason for hiding this comment

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

👍

@priley86
Copy link
Member

priley86 commented Mar 1, 2019

LGTM - 🐛 🔨

after

priley86
priley86 previously approved these changes Mar 1, 2019
priley86
priley86 previously approved these changes Mar 1, 2019
Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

LGTM

@tlabaj tlabaj merged commit f0863a0 into patternfly:master Mar 4, 2019
@rhamilto
Copy link
Member

rhamilto commented Mar 4, 2019

This fix introduces some new bugs:

  1. Upon app load, active sections are not expanded.

yhnpvoa2v6

  1. Previously expanded items that have been collapsed items are (once again) not re-expanded.

ixkroplivy

cc: @spadgett, @janwright73, @priley86

@spadgett
Copy link

spadgett commented Mar 4, 2019

It seems like the underlying problem is that we're tracking the same value using both props and state, which is generally considered an anti-pattern. Would it be simpler just to let the outer component control expanded state and add a callback for when the nav section is activated? Then the expanded prop is the single source of truth.

It puts more work on the outer component, but I don't see a good way around that as long as the expanded state can change based on things that happen outside the nav (such as the user clicking on a link on a details page).

@priley86
Copy link
Member

priley86 commented Mar 5, 2019

this should mostly be resolved now. One step closer here...
openshift/console#1238 (comment)

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.

9 participants