villebro commented on a change in pull request #11979:
URL:
https://github.com/apache/incubator-superset/pull/11979#discussion_r543551526
##########
File path: superset-frontend/src/explore/exploreUtils.js
##########
@@ -250,6 +250,14 @@ export function postForm(url, payload, target = '_blank') {
document.body.removeChild(hiddenForm);
}
+export function getSamplesPageSize(columnsLength) {
Review comment:
Nit: could this be `columnCount`?
##########
File path: superset-frontend/spec/javascripts/explore/utils_spec.jsx
##########
@@ -200,6 +201,13 @@ describe('exploreUtils', () => {
});
});
+ describe('getSamplesPageSize', () => {
+ it('generates samples table', () => {
+ const pageSize = getSamplesPageSize(500);
+ expect(pageSize).toEqual(20);
+ });
+ });
Review comment:
Could we add a few more typical and extreme cases, like 0, 1, 100 and
1000000?
##########
File path: superset-frontend/src/explore/components/DataTablesPane.tsx
##########
@@ -191,11 +196,13 @@ export const DataTablesPane = ({
if (data[type]?.length === 0) {
return <span>No data</span>;
}
+ const renderWithPagination = true;
return (
<TableView
columns={columns[type]}
data={filteredData[type]}
- withPagination={false}
+ withPagination={renderWithPagination}
Review comment:
Perhaps we don't need the `const` above for this, just do `true` here.
----------------------------------------------------------------
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]