This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Loading states api #93
Merged
Merged
Changes from 34 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
762b0ba
Pass loading prop down to components instead of rendering div
valentijnnieman 1fb8376
First pass at providing 'loading' prop to dash components
valentijnnieman 5940bb4
Add componentName and propName props to loading object, cleanup
valentijnnieman 5bf3d30
Cleanup
valentijnnieman a571882
Updated core components tarball
valentijnnieman 1777a94
Change prop names for loading state to be more Pythonic
valentijnnieman 1af20c9
Use latest dcc that fixes Input reliant tests
valentijnnieman 4ddc4b7
Left-over from rebasing
valentijnnieman 02e992a
Update everything to it's latest version expect html-components
valentijnnieman 6acc394
Add tarball back in
valentijnnieman 3264f4b
Change props.status to props.loading_state to be more specific
valentijnnieman a51dcf9
Pass loading prop down to components instead of rendering div
valentijnnieman d38fec9
First pass at providing 'loading' prop to dash components
valentijnnieman 96aebf4
Add componentName and propName props to loading object, cleanup
valentijnnieman 72b579d
Cleanup
valentijnnieman 8d5e4af
Updated core components tarball
valentijnnieman 95ed504
Change prop names for loading state to be more Pythonic
valentijnnieman e1917bf
Rebuild bundles
valentijnnieman cfe4c40
Fixed simple.py regression
valentijnnieman 6c34ac9
Replace dcc tarball with rc1 version
valentijnnieman 2153923
Try with new componentWillRecieveProps changes in dcc tarball
valentijnnieman e48348b
Revert everything in dev-requirements except dcc tarball
valentijnnieman 48e0dd4
Revert back to old dev-requirements.txt completely
valentijnnieman 4b43a54
Refactored requestQueue map into forEach
valentijnnieman 8f1cc81
Add tarball back in dev-requirements
valentijnnieman 05955ea
Revert back to old dev-requirements
valentijnnieman 807d6bc
Fix tests by checking if controllerId is null
valentijnnieman bf97e2b
Remove newlines from NotifyObservers parameters
valentijnnieman 99ef59a
Version bump to 0.16.0
valentijnnieman cd4a507
Merge branch 'master' of https://github.com/plotly/dash-renderer into…
valentijnnieman c9f28d2
Change const to let
valentijnnieman 08c4646
Update version to 0.16.0rc1
valentijnnieman 622e912
Revert dcc upgrade in deps
valentijnnieman 91e0a25
Merge branch 'master' of https://github.com/plotly/dash-renderer into…
valentijnnieman 75592f7
Calculate loading_state in TreeContainer so children have access to i…
valentijnnieman b7f3770
Merge branch 'master' of https://github.com/plotly/dash-renderer into…
valentijnnieman 8c0771b
Add confirm dialog test from DCC
valentijnnieman a2220fb
Remove dcc test again
valentijnnieman 461d515
Cleanup
valentijnnieman a0ed549
Only rerender TreeContainer if props are new
valentijnnieman f692a8d
Release 0.18.0rc3 with more dcc test fixes
valentijnnieman a1a4531
Remove loading prop from APIcontroller causing unneccesary re-renders
valentijnnieman e1fb848
Bump rc version
valentijnnieman 8fb0bda
Update package.json as well
valentijnnieman 8751dd4
Reset simple.py
valentijnnieman 94b9259
Refactored recursivelyRender call in TreeContainer
valentijnnieman 0850d4b
Merge branch 'master' of https://github.com/plotly/dash-renderer into…
valentijnnieman 763c5bd
Fix formatting
valentijnnieman 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 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains 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 |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.16.1' | ||
__version__ = '0.17.0rc1' | ||
valentijnnieman marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains 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 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 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 |
---|---|---|
|
@@ -12,21 +12,26 @@ export default class TreeContainer extends Component { | |
} | ||
|
||
render() { | ||
return render(this.props.layout); | ||
return recursivelyRender(this.props.layout, this.props.loading); | ||
} | ||
} | ||
|
||
TreeContainer.propTypes = { | ||
layout: PropTypes.object, | ||
loading: PropTypes.bool | ||
}; | ||
|
||
function render(component) { | ||
function recursivelyRender(component, loading = false) { | ||
if ( | ||
R.contains(R.type(component), ['String', 'Number', 'Null', 'Boolean']) | ||
) { | ||
return component; | ||
} | ||
|
||
if(R.isEmpty(component)) { | ||
return null; | ||
} | ||
|
||
valentijnnieman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Create list of child elements | ||
let children; | ||
|
||
|
@@ -55,7 +60,9 @@ function render(component) { | |
children = (Array.isArray(componentProps.children) | ||
? componentProps.children | ||
: [componentProps.children] | ||
).map(render); | ||
).map(child => { | ||
return recursivelyRender(child, loading); | ||
}); | ||
} | ||
|
||
if (!component.type) { | ||
|
@@ -78,9 +85,9 @@ function render(component) { | |
...children | ||
); | ||
|
||
return <NotifyObservers key={componentProps.id} id={componentProps.id}>{parent}</NotifyObservers>; | ||
return <NotifyObservers key={componentProps.id} id={componentProps.id} loading={loading}>{parent}</NotifyObservers>; | ||
} | ||
|
||
render.propTypes = { | ||
recursivelyRender.propTypes = { | ||
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. 🐱 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. What does 🐱 mean? 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. Ah never mind, I found this again 😸 |
||
children: PropTypes.object, | ||
}; |
This file contains 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
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.
For final merge, needs to be unreleased and version bump reverted in package.json