Skip to content

Commit

Permalink
Resolved a bug (ToolJet#2414)
Browse files Browse the repository at this point in the history
  • Loading branch information
shah21 authored Mar 10, 2022
1 parent 44bbbc8 commit 633a318
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/src/Editor/Inspector/Components/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import Accordion from '@/_ui/Accordion';

import { renderElement } from '../Utils';
import { computeActionName } from '@/_helpers/utils';
import { computeActionName, resolveReferences } from '@/_helpers/utils';
// eslint-disable-next-line import/no-unresolved
import SortableList, { SortableItem } from 'react-easy-sort';
import arrayMove from 'array-move';
Expand Down Expand Up @@ -600,7 +600,9 @@ class Table extends React.Component {
if (!component.component.definition.properties.displaySearchBox)
paramUpdated({ name: 'displaySearchBox' }, 'value', true, 'properties');
const displaySearchBox = component.component.definition.properties.displaySearchBox.value;
const serverSidePagination = component.component.definition.properties.serverSidePagination?.value ?? false;
const serverSidePagination = component.component.definition.properties.serverSidePagination?.value
? resolveReferences(component.component.definition.properties.serverSidePagination?.value, currentState)
: false;

const renderCustomElement = (param, paramType = 'properties') => {
return renderElement(component, componentMeta, paramUpdated, dataQueries, param, paramType, currentState);
Expand Down Expand Up @@ -744,10 +746,11 @@ class Table extends React.Component {

let renderOptions = [];

!serverSidePagination && options.splice(1, 0, 'clientSidePagination');

options.map((option) => renderOptions.push(renderCustomElement(option)));

const conditionalOptions = [
{ name: 'clientSidePagination', condition: !serverSidePagination },
{ name: 'displaySearchBox', condition: displaySearchBox },
{ name: 'loadingState', condition: true },
];
Expand Down

0 comments on commit 633a318

Please sign in to comment.