Grids: split dataController _setPagingOptions into paging utils - #34669
Open
anna-shakhova wants to merge 3 commits into
Open
Grids: split dataController _setPagingOptions into paging utils#34669anna-shakhova wants to merge 3 commits into
anna-shakhova wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors GridCore’s DataController paging option application by extracting the paging reconciliation logic into dedicated utilities, improving testability and type-safety around scrolling-mode-derived paging behavior.
Changes:
- Extracted paging reconciliation into
resolvePaginate/syncPagingutilities and replaced_setPagingOptionswithapplyPagingOptions. - Improved grid option typing so
scrolling.modecan be accessed without suppressions in the pager view. - Migrated/added Jest coverage for paging option application, including the T677650 regression scenario.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/testing/tests/DevExpress.ui.widgets.dataGrid/dataGrid.tests.js | Removes a QUnit regression test that is now covered via Jest in the internal grid tests. |
| packages/devextreme/js/__internal/grids/grid_core/pager/m_pager.ts | Drops a TS suppression now that scrolling.mode is properly typed. |
| packages/devextreme/js/__internal/grids/grid_core/m_types.ts | Extends internal grid option typing to include scrolling with a typed mode. |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/utils/paging.ts | Introduces reusable paging utilities (resolvePaginate, syncPaging). |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/utils/tests/paging.test.ts | Adds focused unit tests for paging utility behavior and ordering guarantees. |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/types.ts | Adds shared paging-related types used by the controller and utilities. |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/data_controller.ts | Replaces inline paging option sync with applyPagingOptions + utilities; keeps behavior around reload/pageChanged. |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/tests/data_controller.paging.test.ts | Adds controller-level paging behavior tests, including no-op option updates and scrolling-derived behavior. |
Comment on lines
+14
to
+16
| /** | ||
| * Brings `dataSource` to `target` and reports what changed. | ||
| */ |
| return dataController.dataSource() as PagingAdapter; | ||
| }; | ||
|
|
||
| describe('_applyPagingOptions', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.