-
Notifications
You must be signed in to change notification settings - Fork 33
Loading states api #93
Changes from 30 commits
762b0ba
1fb8376
5940bb4
5bf3d30
a571882
1777a94
1af20c9
4ddc4b7
02e992a
6acc394
3264f4b
a51dcf9
d38fec9
96aebf4
72b579d
8d5e4af
95ed504
e1917bf
cfe4c40
6c34ac9
2153923
e48348b
48e0dd4
4b43a54
8f1cc81
05955ea
807d6bc
bf97e2b
99ef59a
cd4a507
c9f28d2
08c4646
622e912
91e0a25
75592f7
b7f3770
8c0771b
a2220fb
461d515
a0ed549
f692a8d
a1a4531
e1fb848
8fb0bda
8751dd4
94b9259
0850d4b
763c5bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.15.1' | ||
__version__ = '0.16.0' |
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 id={componentProps.id}>{parent}</NotifyObservers>; | ||
return <NotifyObservers 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, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ class Reloader extends React.Component { | |
) { | ||
// Look if it was a css file. | ||
let was_css = false; | ||
for (let a of reloadRequest.content.files) { | ||
for (const a of reloadRequest.content.files) { | ||
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. I think that is an error, make sure it works because I kinda remember putting const and it failed when there was multiple files. There can be multiple files if multiple assets files are saved at the same time. 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 must be some artifact from a merge with master, I haven't touched any of the reloading code as far as I remember. 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. I haven't had a chance to rebase yet, because I'm still working on fixing the tests 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. I think it's prettier that changes it, I remember it changed it also when I ran it, maybe add an exclude here. 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. Still need to change this back. |
||
if (a.is_css) { | ||
was_css = true; | ||
const nodesToDisable = []; | ||
|
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