diff --git a/packages/dx-grid-core/src/plugins/sorting-state/helpers.test.ts b/packages/dx-grid-core/src/plugins/sorting-state/helpers.test.ts index 9977cf0662..124efc7d3d 100644 --- a/packages/dx-grid-core/src/plugins/sorting-state/helpers.test.ts +++ b/packages/dx-grid-core/src/plugins/sorting-state/helpers.test.ts @@ -38,6 +38,20 @@ describe('SortingState helpers', () => { const result = getPersistentSortedColumns(sorting, columnExtensions); expect(result).toEqual(['b']); }); + it('should honor the default sortingEnabled state', () => { + const sorting = [ + { columnName: 'a', ...defaultDirection }, + { columnName: 'b', ...defaultDirection }, + { columnName: 'c', ...defaultDirection }, + ]; + const columnExtensions = [ + { columnName: 'a', sortingEnabled: true }, + { columnName: 'b', sortingEnabled: false }, + { columnName: 'c' }, + ]; + const result = getPersistentSortedColumns(sorting, columnExtensions); + expect(result).toEqual(['b']); + }); }); describe('#calculateKeepOther', () => { diff --git a/packages/dx-grid-core/src/plugins/sorting-state/helpers.ts b/packages/dx-grid-core/src/plugins/sorting-state/helpers.ts index 3a53d4acc5..1289f0b3c5 100644 --- a/packages/dx-grid-core/src/plugins/sorting-state/helpers.ts +++ b/packages/dx-grid-core/src/plugins/sorting-state/helpers.ts @@ -15,7 +15,7 @@ export const getColumnSortingDirection: GetColumnSortingDirectionFn = ( export const getPersistentSortedColumns: GetPersistentSortedColumnsFn = ( sorting, columnExtensions = [], ) => columnExtensions.reduce((acc, { columnName, sortingEnabled }) => { - if (!sortingEnabled) { + if (sortingEnabled === false) { if (sorting.findIndex(sortItem => sortItem.columnName === columnName) > -1) { acc.push(columnName); } diff --git a/packages/dx-grid-core/tslint.json b/packages/dx-grid-core/tslint.json new file mode 100644 index 0000000000..45f860a597 --- /dev/null +++ b/packages/dx-grid-core/tslint.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tslint.json", + "linterOptions": { + "exclude": [ + "config/**/*.js", + "node_modules/**/*.ts", + "**/*.g.test.tsx" + ] + }, + "rules": { + "no-boolean-literal-compare": false + } +} diff --git a/packages/dx-scheduler-core/tslint.json b/packages/dx-scheduler-core/tslint.json new file mode 100644 index 0000000000..45f860a597 --- /dev/null +++ b/packages/dx-scheduler-core/tslint.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tslint.json", + "linterOptions": { + "exclude": [ + "config/**/*.js", + "node_modules/**/*.ts", + "**/*.g.test.tsx" + ] + }, + "rules": { + "no-boolean-literal-compare": false + } +}