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:
Nikola Gigić
2020-12-16 15:35:12 +01:00
committed by GitHub
parent 2302adb61a
commit 48fb8c0b77
4 changed files with 30 additions and 2 deletions

View File

@@ -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({