kgabryje commented on a change in pull request #10999:
URL: 
https://github.com/apache/incubator-superset/pull/10999#discussion_r498372653



##########
File path: superset-frontend/src/components/TableLoader.jsx
##########
@@ -71,40 +99,26 @@ class TableLoader extends React.PureComponent {
       ...tableProps
     } = this.props;
 
-    let { columns } = this.props;
-    if (!columns && this.state.data.length > 0) {
+    let { columns = [] } = this.props;
+    if (columns.length === 0 && this.state.data.length > 0) {
       columns = Object.keys(this.state.data[0]).filter(col => col[0] !== '_');
     }
     delete tableProps.dataEndpoint;
     delete tableProps.mutator;
     delete tableProps.columns;
 
     return (
-      <Table
-        {...tableProps}
-        className="table"
-        itemsPerPage={50}
-        style={{ textTransform: 'capitalize' }}
-      >
-        {this.state.data.map((row, i) => (
-          <Tr key={i}>
-            {columns.map(col => {
-              if (row.hasOwnProperty(`_${col}`)) {
-                return (
-                  <Td key={col} column={col} value={row[`_${col}`]}>
-                    {row[col]}
-                  </Td>
-                );
-              }
-              return (
-                <Td key={col} column={col}>
-                  {row[col]}
-                </Td>
-              );
-            })}
-          </Tr>
-        ))}
-      </Table>
+      <ListView
+        columns={columns.map(column => ({
+          accessor: column,
+          Header: column,
+        }))}
+        data={this.state.data}
+        count={this.state.data.length}

Review comment:
       This component is used with endpoints 
`/superset/recent_activity/{userId}`, `/superset/fave_dashboards/{userId}`, 
`/superset/fave_slices/{userId}`, `/superset/created_dashboards/{userId}` and 
`/superset/created_slices/{userId}` and they don't use server side pagination 
(and don't return total count explicitly as it's equal to length of data array).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to