Skip to content

Commit

Permalink
Small fixes for Server-side filter button (ToolJet#4571) (ToolJet#4580)
Browse files Browse the repository at this point in the history
* Small fixes for Server-side filter button (ToolJet#4571)

* fixes: show/hide server side filter toggle button when with resp to show filter button toggle

Co-authored-by: arpitnath <[email protected]>
Co-authored-by: Sherfin Shamsudeen <[email protected]>
  • Loading branch information
3 people authored Nov 3, 2022
1 parent 2583674 commit e848316
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend/src/Editor/Inspector/Components/Table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,9 @@ class TableComponent extends React.Component {
if (!component.component.definition.properties.displaySearchBox)
paramUpdated({ name: 'displaySearchBox' }, 'value', true, 'properties');
const displaySearchBox = component.component.definition.properties.displaySearchBox.value;
const displayServerSideFilter = component.component.definition.properties.showFilterButton?.value
? resolveReferences(component.component.definition.properties.showFilterButton?.value, currentState)
: false;
const serverSidePagination = component.component.definition.properties.serverSidePagination?.value
? resolveReferences(component.component.definition.properties.serverSidePagination?.value, currentState)
: false;
Expand Down Expand Up @@ -931,15 +934,15 @@ class TableComponent extends React.Component {
...(serverSidePagination ? ['enableNextButton'] : []),
...(serverSidePagination ? ['totalRecords'] : []),
...(clientSidePagination && !serverSidePagination ? ['rowsPerPage'] : []),
'enabledSort',
...(enabledSort ? ['serverSideSort'] : []),
'serverSideSearch',
'showDownloadButton',
'showFilterButton',
...(displayServerSideFilter ? ['serverSideFilter'] : []),
'showBulkUpdateActions',
'showBulkSelector',
'highlightSelectedRow',
'enabledSort',
'serverSideFilter',
];

let renderOptions = [];
Expand Down
1 change: 1 addition & 0 deletions frontend/src/Editor/WidgetManager/widgetConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ export const widgets = [
totalRecords: { value: '' },
clientSidePagination: { value: '{{true}}' },
serverSideSort: { value: '{{false}}' },
serverSideFilter: { value: '{{false}}' },
displaySearchBox: { value: '{{true}}' },
showDownloadButton: { value: '{{true}}' },
showFilterButton: { value: '{{true}}' },
Expand Down

0 comments on commit e848316

Please sign in to comment.