mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
feat :: changed naming from disable -> enabledSort , serverside sort only active when sort enabled (#4477)
This commit is contained in:
parent
8ea07a317a
commit
361f3c164b
4 changed files with 12 additions and 8 deletions
|
|
@ -89,7 +89,7 @@ export function Table({
|
|||
enablePrevButton,
|
||||
totalRecords,
|
||||
rowsPerPage,
|
||||
disabledSort,
|
||||
enabledSort,
|
||||
} = loadPropertiesAndStyles(properties, styles, darkMode, component);
|
||||
|
||||
const getItemStyle = ({ isDragging, isDropAnimating }, draggableStyle) => ({
|
||||
|
|
@ -388,7 +388,7 @@ export function Table({
|
|||
pageCount: -1,
|
||||
manualPagination: false,
|
||||
getExportFileBlob,
|
||||
disableSortBy: disabledSort,
|
||||
disableSortBy: !enabledSort,
|
||||
manualSortBy: serverSideSort,
|
||||
},
|
||||
useColumnOrder,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export default function loadPropertiesAndStyles(properties, styles, darkMode, co
|
|||
const enablePrevButton = properties.enablePrevButton ?? true;
|
||||
|
||||
const totalRecords = properties.totalRecords ?? '';
|
||||
const disabledSort = properties?.disabledSort ?? false;
|
||||
const enabledSort = properties?.enabledSort ?? true;
|
||||
|
||||
const serverSideSort = properties.serverSideSort ?? false;
|
||||
|
||||
|
|
@ -79,6 +79,6 @@ export default function loadPropertiesAndStyles(properties, styles, darkMode, co
|
|||
enablePrevButton,
|
||||
totalRecords,
|
||||
rowsPerPage,
|
||||
disabledSort,
|
||||
enabledSort,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -789,6 +789,9 @@ class TableComponent extends React.Component {
|
|||
const clientSidePagination = component.component.definition.properties.clientSidePagination?.value
|
||||
? resolveReferences(component.component.definition.properties.clientSidePagination?.value, currentState)
|
||||
: false;
|
||||
const enabledSort = component.component.definition.properties.enabledSort?.value
|
||||
? resolveReferences(component.component.definition.properties.enabledSort?.value, currentState)
|
||||
: true;
|
||||
|
||||
const renderCustomElement = (param, paramType = 'properties') => {
|
||||
return renderElement(component, componentMeta, paramUpdated, dataQueries, param, paramType, currentState);
|
||||
|
|
@ -928,14 +931,14 @@ class TableComponent extends React.Component {
|
|||
...(serverSidePagination ? ['enableNextButton'] : []),
|
||||
...(serverSidePagination ? ['totalRecords'] : []),
|
||||
...(clientSidePagination && !serverSidePagination ? ['rowsPerPage'] : []),
|
||||
...(enabledSort ? ['serverSideSort'] : []),
|
||||
'serverSideSearch',
|
||||
'showDownloadButton',
|
||||
'showFilterButton',
|
||||
'showBulkUpdateActions',
|
||||
'showBulkSelector',
|
||||
'highlightSelectedRow',
|
||||
'disabledSort',
|
||||
'serverSideSort',
|
||||
'enabledSort',
|
||||
'serverSideFilter',
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -155,9 +155,9 @@ export const widgets = [
|
|||
schema: { type: 'boolean' },
|
||||
},
|
||||
},
|
||||
disabledSort: {
|
||||
enabledSort: {
|
||||
type: 'toggle',
|
||||
displayName: 'Disable sorting',
|
||||
displayName: 'Enable sorting',
|
||||
validation: {
|
||||
schema: { type: 'boolean' },
|
||||
},
|
||||
|
|
@ -412,6 +412,7 @@ export const widgets = [
|
|||
highlightSelectedRow: { value: '{{false}}' },
|
||||
columnSizes: { value: '{{({})}}' },
|
||||
actions: { value: [] },
|
||||
enabledSort: { value: '{{true}}' },
|
||||
},
|
||||
events: [],
|
||||
styles: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue