Skip to content

Commit

Permalink
increase export feature page size (#7341)
Browse files Browse the repository at this point in the history
## Context
Now that we have improved performances, we can increase the export
feature page size from 30 to 200 (and probably above if results are
good). This should be ok since we are only querying the first level of
an object and omit relations.
I've moved this value to a constant.
  • Loading branch information
Weiko committed Sep 30, 2024
1 parent 3ca31f9 commit 5f1d361
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const EXPORT_TABLE_DATA_DEFAULT_PAGE_SIZE = 200;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { json2csv } from 'json-2-csv';
import { useMemo } from 'react';

import { FieldMetadata } from '@/object-record/record-field/types/FieldMetadata';
import { EXPORT_TABLE_DATA_DEFAULT_PAGE_SIZE } from '@/object-record/record-index/options/constants/ExportTableDataDefaultPageSize';
import { useProcessRecordsForCSVExport } from '@/object-record/record-index/options/hooks/useProcessRecordsForCSVExport';
import {
useTableData,
Expand Down Expand Up @@ -142,7 +143,7 @@ export const useExportTableData = ({
filename,
maximumRequests = 100,
objectNameSingular,
pageSize = 30,
pageSize = EXPORT_TABLE_DATA_DEFAULT_PAGE_SIZE,
recordIndexId,
viewType,
}: UseExportTableDataOptions) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ObjectRecord } from '@/object-record/types/ObjectRecord';
import { isDefined } from '~/utils/isDefined';

import { useRecordBoardStates } from '@/object-record/record-board/hooks/internal/useRecordBoardStates';
import { EXPORT_TABLE_DATA_DEFAULT_PAGE_SIZE } from '@/object-record/record-index/options/constants/ExportTableDataDefaultPageSize';
import { useRecordIndexOptionsForBoard } from '@/object-record/record-index/options/hooks/useRecordIndexOptionsForBoard';
import { ViewType } from '@/views/types/ViewType';
import { useFindManyParams } from '../../hooks/useLoadRecordIndexTable';
Expand Down Expand Up @@ -43,7 +44,7 @@ export const useTableData = ({
delayMs,
maximumRequests = 100,
objectNameSingular,
pageSize = 30,
pageSize = EXPORT_TABLE_DATA_DEFAULT_PAGE_SIZE,
recordIndexId,
callback,
viewType = ViewType.Table,
Expand Down

0 comments on commit 5f1d361

Please sign in to comment.