williaster commented on a change in pull request #3581: Dashboard refactory
URL:
https://github.com/apache/incubator-superset/pull/3581#discussion_r147905957
##########
File path: superset/assets/javascripts/dashboard/components/GridLayout.jsx
##########
@@ -134,27 +109,43 @@ class GridLayout extends React.Component {
useCSSTransforms
draggableHandle=".drag"
>
- {this.state.slices.map(slice => (
+ {this.props.dashboard.slices.map(slice => (
<div
id={'slice_' + slice.slice_id}
key={slice.slice_id}
data-slice-id={slice.slice_id}
className={`widget ${slice.form_data.viz_type}`}
+ ref={this.getWidgetId(slice)}
>
- <SliceCell
+ <GridCell
slice={slice}
- removeSlice={this.removeSlice.bind(this, slice.slice_id)}
- expandedSlices={this.props.dashboard.metadata.expanded_slices}
+ chartKey={'slice_' + slice.slice_id}
+ datasource={this.props.datasources[slice.form_data.datasource]}
+ filters={this.props.filters}
Review comment:
you could destructure a lot of vars from `this.props` to reduce the number
of `this.props.xxx` calls
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services