This repository was archived by the owner on Jun 3, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 143
Renderer regression #496
Merged
Merged
Renderer regression #496
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
74816f1
rework
0731919
test against regression branches
49f452f
lint
efba7e1
add loading component tests
5ed7feb
update jest snapshot
e0f47a6
with lock instead of acquire/release
34fba2d
lint
eb7cf87
extra wait
8e71777
update loading component tests
40073d2
test loading state on initial & user action
b7b969c
Merge branch 'master' into renderer-regression
Marc-Andre-Rivet f6e99ad
Update loading component flag name
2093e1c
revert renderer's regression branch (been merged)
Marc-Andre-Rivet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,9 +37,7 @@ export default class Loading extends Component { | |
type, | ||
} = this.props; | ||
|
||
const isLoading = getLoadingState(this); | ||
|
||
if (isLoading) { | ||
if (loading_state && loading_state.is_loading) { | ||
const Spinner = getSpinner(type); | ||
return ( | ||
<Spinner | ||
|
@@ -52,6 +50,7 @@ export default class Loading extends Component { | |
/> | ||
); | ||
} | ||
|
||
if ( | ||
R.type(this.props.children) !== 'Object' || | ||
R.type(this.props.children) !== 'Function' | ||
|
@@ -62,6 +61,8 @@ export default class Loading extends Component { | |
} | ||
} | ||
|
||
Loading._dashprivate_isLoadingComponent = true; | ||
|
||
Loading.defaultProps = { | ||
type: 'default', | ||
color: '#119DFF', | ||
|
@@ -126,23 +127,3 @@ Loading.propTypes = { | |
component_name: PropTypes.string, | ||
}), | ||
}; | ||
|
||
function getLoadingState(element) { | ||
if ( | ||
element.props && | ||
element.props.loading_state && | ||
element.props.loading_state.is_loading | ||
) { | ||
return true; | ||
} | ||
|
||
const children = element.props && element.props.children; | ||
if (!children) { | ||
return false; | ||
} | ||
|
||
return R.any( | ||
child => child.type !== Loading && getLoadingState(child), | ||
Array.isArray(children) ? children : [children] | ||
); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is resolved by the renderer, no longer needed |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ const CircleSpinner = ({ | |
return ( | ||
<div style={style ? style : {}} className={spinnerClass}> | ||
{debugTitle} | ||
<div className="dash-sk-circle"> | ||
<div className="dash-spinner dash-sk-circle"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Extra class on the spinners, easier to target general spinner through css (and to automate tests) |
||
<div className="dash-sk-circle1 dash-sk-child" /> | ||
<div className="dash-sk-circle2 dash-sk-child" /> | ||
<div className="dash-sk-circle3 dash-sk-child" /> | ||
|
@@ -160,7 +160,7 @@ const CircleSpinner = ({ | |
.dash-spinner-container .sk-circle .sk-circle12:before { | ||
-webkit-animation-delay: -0.1s; | ||
animation-delay: -0.1s; } | ||
|
||
@-webkit-keyframes dash-sk-circleBounceDelay { | ||
0%, 80%, 100% { | ||
-webkit-transform: scale(0); | ||
|
@@ -170,7 +170,7 @@ const CircleSpinner = ({ | |
transform: scale(1); | ||
} | ||
} | ||
|
||
@keyframes dash-sk-circleBounceDelay { | ||
0%, 80%, 100% { | ||
-webkit-transform: scale(0); | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,18 +19,18 @@ const GraphSpinner = ({status, fullscreen, debug, className, style}) => { | |
<div style={style ? style : {}} className={spinnerClass}> | ||
<div> | ||
{debugTitle} | ||
<div className="dash-spinner"> | ||
<div className="dash-spinner__bottom"> | ||
<div className="dash-spinner dash-graph-spinner"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dash-spinner and variants become dash-graph-spinner |
||
<div className="dash-graph-spinner__bottom"> | ||
<div className="dash-bar dash-bar__one" /> | ||
<div className="dash-bar dash-bar__two" /> | ||
<div className="dash-bar dash-bar__three" /> | ||
</div> | ||
<div className="dash-spinner__background"> | ||
<div className="dash-graph-spinner__background"> | ||
<div className="dash-dot dash-dot__one" /> | ||
<div className="dash-dot dash-dot__two" /> | ||
<div className="dash-dot dash-dot__three" /> | ||
<div className="dash-dot dash-dot__four" /> | ||
<div className="dash-spinner__bottom"> | ||
<div className="dash-graph-spinner__bottom"> | ||
<div className="dash-vert dash-vert__one" /> | ||
<div className="dash-vert dash-vert__two" /> | ||
<div className="dash-vert dash-vert__three" /> | ||
|
@@ -56,7 +56,7 @@ const GraphSpinner = ({status, fullscreen, debug, className, style}) => { | |
.dash-loading-title { | ||
text-align: center; | ||
} | ||
.dash-spinner { | ||
.dash-graph-spinner { | ||
display: flex; | ||
margin: 0 auto; | ||
width: 200px; | ||
|
@@ -65,14 +65,14 @@ const GraphSpinner = ({status, fullscreen, debug, className, style}) => { | |
z-index: -2; | ||
border-radius: 4px; | ||
} | ||
.dash-spinner__bottom { | ||
.dash-graph-spinner__bottom { | ||
display: flex; | ||
margin-top: auto; | ||
flex-direction: column; | ||
height: 12px; | ||
width: 100%; | ||
} | ||
.dash-spinner__background { | ||
.dash-graph-spinner__background { | ||
width: 100%; | ||
height: 100%; | ||
display: block; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The nested loading state is already determined by the renderer. Only need to check the prop value