feat :: changed naming from disable -> enabledSort , serverside sort only active when sort enabled (#4477)

This commit is contained in:
Kiran Ashok 2022-11-03 16:53:09 +05:30 committed by GitHub
parent 8ea07a317a
commit 361f3c164b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View file

@ -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,

View file

@ -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,
};
}

View file

@ -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',
];

View file

@ -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: {