GridCommands: implement column and summary commands#33520
Open
anna-shakhova wants to merge 3 commits intoDevExpress:26_1from
Open
GridCommands: implement column and summary commands#33520anna-shakhova wants to merge 3 commits intoDevExpress:26_1from
anna-shakhova wants to merge 3 commits intoDevExpress:26_1from
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the grid AI assistant command surface by adding column-manipulation commands at the grid-core level and summary-configuration commands for DataGrid, along with Jest coverage for the new behaviors.
Changes:
- Added GridCore AI assistant commands to show/hide, reorder, pin/unpin, and resize columns (+ Jest tests).
- Added DataGrid AI assistant commands to configure/clear
summary(+ Jest tests) and introduced a sharedColumnintersection type for DataGrid commands. - Extended
InternalGridOptionstyping to include thesummaryoption.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/js/__internal/grids/grid_core/m_types.ts | Adds summary to the internal option typing so option('summary', …) is type-safe. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/commands/filtering.ts | Removes explanatory comments (no functional change). |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/commands/columns.ts | Introduces column visibility/reorder/pinning/resize commands. |
| packages/devextreme/js/__internal/grids/grid_core/ai_assistant/commands/tests/columns.test.ts | Adds Jest coverage for the new column commands. |
| packages/devextreme/js/__internal/grids/data_grid/ai_assistant/commands/types.ts | Adds shared DataGrid command Column type alias. |
| packages/devextreme/js/__internal/grids/data_grid/ai_assistant/commands/summary.ts | Introduces summary and clearSummary commands. |
| packages/devextreme/js/__internal/grids/data_grid/ai_assistant/commands/grouping.ts | Refactors to reuse the shared Column type. |
| packages/devextreme/js/__internal/grids/data_grid/ai_assistant/commands/tests/summary.test.ts | Adds Jest coverage for summary commands. |
Comment on lines
+71
to
+75
| const columnsPinningCommandSchema = z.object({ | ||
| dataField: z.string(), | ||
| fixed: z.boolean(), | ||
| fixedPosition: z.enum(['left', 'right']).optional(), | ||
| }).strict(); |
Comment on lines
+8
to
+12
| const SUMMARY_TYPES = ['sum', 'min', 'max', 'avg', 'count'] as const satisfies readonly SummaryType[]; | ||
|
|
||
| const summaryItemSchema = z.object({ | ||
| column: z.string(), | ||
| summaryType: z.enum(SUMMARY_TYPES), |
|
|
||
| export const columnsPinningCommand = defineGridCommand({ | ||
| name: 'columnsPinning', | ||
| description: 'Pin a column to the left or right edge, or unpin it. fixedPosition is required when fixed=true and ignored when fixed=false.', |
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.