mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(dataset): Page blanks on large data load (#11979)
* Implement pagination in <TableView> for Samples preview * Increase page size * Fix lint * Render cells based on width * Fix lint errors * Additional tests and changes * Search bar fix * Additional fixes * Suggested changes
This commit is contained in:
@@ -23,6 +23,7 @@ import {
|
||||
buildV1ChartDataPayload,
|
||||
getExploreUrl,
|
||||
getExploreLongUrl,
|
||||
getDataTablePageSize,
|
||||
shouldUseLegacyApi,
|
||||
} from 'src/explore/exploreUtils';
|
||||
import {
|
||||
@@ -200,6 +201,20 @@ describe('exploreUtils', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('getDataTablePageSize', () => {
|
||||
it('divides samples data into pages dynamically', () => {
|
||||
let pageSize;
|
||||
pageSize = getDataTablePageSize(500);
|
||||
expect(pageSize).toEqual(20);
|
||||
pageSize = getDataTablePageSize(0);
|
||||
expect(pageSize).toEqual(50);
|
||||
pageSize = getDataTablePageSize(1);
|
||||
expect(pageSize).toEqual(10000);
|
||||
pageSize = getDataTablePageSize(1000000);
|
||||
expect(pageSize).toEqual(5);
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildV1ChartDataPayload', () => {
|
||||
it('generate valid request payload despite no registered buildQuery', () => {
|
||||
const v1RequestPayload = buildV1ChartDataPayload({
|
||||
|
||||
Reference in New Issue
Block a user