Grids - DataController: Extract row type knowledge to extenders - #35031
Grids - DataController: Extract row type knowledge to extenders#35031Alyar666 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The refactor cleanly moves row-type-specific logic into extenders with updated/added Jest tests covering the new behavior paths.
Pull request overview
This PR refactors row-change/diffing logic in the Grid DataController so that row-type-specific behavior (group rows, group footers, edit form rows) is handled by the relevant module extenders (grouping/summary/editing) rather than centralized in shared utilities.
Changes:
- Moved group-row column-diff logic into the DataGrid grouping extender and its utils (
getGroupColumnIndices). - Introduced
adjustInsertRowIndexin the baseDataController, with grouping extending the index adjustment to account for group rows. - Added/updated Jest coverage to validate row repaint vs partial cell updates for grouping, summary group footers, and form edit rows.
File summaries
| File | Description |
|---|---|
| packages/devextreme/js/__internal/grids/grid_core/editing/extenders/tests/editing_data_controller.row_changes.test.ts | Adds coverage ensuring form edit rows repaint fully (no column diff). |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/utils/row_changes.ts | Removes group-specific helpers and replaces getDataRowIndex with generic countRowsBefore. |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/utils/tests/row_changes.test.ts | Updates unit tests for the new countRowsBefore behavior and removes tests for deleted helpers. |
| packages/devextreme/js/__internal/grids/grid_core/data_controller/data_controller.ts | Adds adjustInsertRowIndex and simplifies core column diffing, delegating special cases to extenders. |
| packages/devextreme/js/__internal/grids/grid_core/tests/mock/helpers/row_changes.ts | Extends test helper to pass gridOptions and isLiveUpdate through refresh changes. |
| packages/devextreme/js/__internal/grids/data_grid/summary/extenders/summary_data_controller.ts | Overrides column diffing to force full repaint for DataGrid group footer rows. |
| packages/devextreme/js/__internal/grids/data_grid/summary/extenders/tests/summary_data_controller.row_changes.test.ts | Updates expectations to assert full-row repaint semantics for group footers. |
| packages/devextreme/js/__internal/grids/data_grid/grouping/utils.ts | Adds getGroupColumnIndices utility for group-row partial updates (skipping expand cell). |
| packages/devextreme/js/__internal/grids/data_grid/grouping/extenders/grouping_data_controller.ts | Implements grouping-specific insert index adjustment and group-row column diffing. |
| packages/devextreme/js/__internal/grids/data_grid/grouping/extenders/tests/grouping_data_controller.row_changes.test.ts | Adds coverage for group-row partial updates vs full repaint when not rendered. |
| packages/devextreme/js/__internal/grids/data_grid/grouping/extenders/tests/grouping_data_controller.data_row_index.test.ts | Adds coverage for grouping-aware insert index mapping. |
| packages/devextreme/js/__internal/grids/data_grid/grouping/tests/utils.test.ts | Adds unit tests for getGroupColumnIndices. |
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟢 Approval recommended
The refactor cleanly relocates row-type-specific behavior into appropriate extenders and is backed by targeted Jest tests covering the new/changed repaint and indexing behavior.
Review details
- Files reviewed: 12/12 changed files
- Comments generated: 0 new
- Review effort level: Lite
No description provided.