mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 09:28:31 +00:00
Enforce boolean values on clientSidePagination and serverSidePagination (#2398)
This commit is contained in:
parent
d3670a1b0e
commit
42058bd088
1 changed files with 6 additions and 2 deletions
|
|
@ -49,10 +49,12 @@ export function Table({
|
|||
|
||||
const actions = component.definition.properties.actions || { value: [] };
|
||||
const serverSidePaginationProperty = component.definition.properties.serverSidePagination;
|
||||
const serverSidePagination = serverSidePaginationProperty
|
||||
let serverSidePagination = serverSidePaginationProperty
|
||||
? resolveWidgetFieldValue(serverSidePaginationProperty.value, currentState)
|
||||
: false;
|
||||
|
||||
if (typeof serverSidePagination !== 'boolean') serverSidePagination = false;
|
||||
|
||||
const serverSideSearchProperty = component.definition.properties.serverSideSearch;
|
||||
const serverSideSearch = serverSideSearchProperty
|
||||
? resolveWidgetFieldValue(serverSideSearchProperty.value, currentState)
|
||||
|
|
@ -79,9 +81,11 @@ export function Table({
|
|||
const highlightSelectedRow = resolveWidgetFieldValue(highlightSelectedRowProperty, currentState) ?? false; // default is false for backward compatibility
|
||||
|
||||
const clientSidePaginationProperty = component.definition.properties.clientSidePagination?.value;
|
||||
const clientSidePagination =
|
||||
let clientSidePagination =
|
||||
resolveWidgetFieldValue(clientSidePaginationProperty, currentState) ?? !serverSidePagination; // default is true for backward compatibility
|
||||
|
||||
if (typeof clientSidePagination !== 'boolean') clientSidePagination = true;
|
||||
|
||||
const tableTypeProperty = component.definition.styles.tableType;
|
||||
let tableType = tableTypeProperty ? tableTypeProperty.value : 'table-bordered';
|
||||
tableType = tableType === '' ? 'table-bordered' : tableType;
|
||||
|
|
|
|||
Loading…
Reference in a new issue