williaster commented on a change in pull request #3581: Dashboard refactory
URL: 
https://github.com/apache/incubator-superset/pull/3581#discussion_r147906067
 
 

 ##########
 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}
+              formData={this.props.getFormDataExtra(slice)}
+              timeout={this.props.timeout}
+              widgetHeight={this.getWidgetHeight(slice)}
+              widgetWidth={this.getWidgetWidth(slice)}
+              
exploreChartUrl={getExploreUrl(this.props.getFormDataExtra(slice))}
+              exportCSVUrl={getExploreUrl(this.props.getFormDataExtra(slice), 
'csv')}
+              isExpanded={!!this.isExpanded(slice)}
+              isLoading={[undefined, 'loading']
+                .indexOf(this.props.charts['slice_' + 
slice.slice_id].chartStatus) !== -1}
+              toggleExpandSlice={this.props.toggleExpandSlice}
+              fetchSlice={this.props.fetchSlice.bind(this, 
this.props.charts['slice_' + slice.slice_id])}
 
 Review comment:
   shouldn't bind in a render

----------------------------------------------------------------
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

Reply via email to