-
Notifications
You must be signed in to change notification settings - Fork 377
fix(navExpand): remove defaultExpand in favor of just using isExpanded #1490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
PatternFly-React preview: https://1490-pr-patternfly-react-patternfly.surge.sh |
Codecov Report
@@ Coverage Diff @@
## master #1490 +/- ##
========================================
Coverage ? 83.4%
========================================
Files ? 545
Lines ? 5653
Branches ? 12
========================================
Hits ? 4715
Misses ? 936
Partials ? 2
Continue to review full report at Codecov.
|
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #1490 +/- ##
========================================
Coverage ? 83.4%
========================================
Files ? 545
Lines ? 5653
Branches ? 12
========================================
Hits ? 4715
Misses ? 936
Partials ? 2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #1490 +/- ##
==========================================
- Coverage 83.4% 83.39% -0.02%
==========================================
Files 545 545
Lines 5653 5660 +7
Branches 12 12
==========================================
+ Hits 4715 4720 +5
- Misses 936 938 +2
Partials 2 2
Continue to review full report at Codecov.
|
tlabaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
this seems to have the desired effect since OpenShift is currently only using the Opening a link with "Home" nav section expanded will correctly now open the "Workloads" section on route change: Opening a link with the "Home" section subsequently closed will correctly maintain its state after route change: Does this resolve @rhamilto ? |
kmcfaul
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
we are still resolving one other edge case... the |
| this.setState({ expandedState: this.props.isExpanded }); | ||
| } | ||
| componentDidUpdate(prevProps) { | ||
| if (this.props.isExpanded !== prevProps.isExpanded) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be:
componentDidUpdate() {
if (this.props.isExpanded !== this.state.isExpanded) {
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry:
if (this.props.isExpanded !== prevProps.isExpanded || this.props.isExpanded !== this.state.expandedState)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, made a few changes to address this. If the consumer is setting expandState externally, we should allow them to hook into this, otherwise they could be become out of sync. My changes here would allow the consumer to override the expand/collapse state at either the top level (Nav and the onToggle), or at a more granular level, the NavExpandable and the onExpand callback). They would then be able to hook into either (or neither if desired). See if this works on your side...
priley86@ee30e20
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
downstream explanation/relevant changes...
openshift/console#1238 (comment)
497ef42 to
5e3fb34
Compare
tlabaj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
So close. Console warning needs fixing (which @priley86 is doing). |



What:
#1016
Additional issues: