fix(grid): keep conditionName in sync on condition changed callback [20.1.x]#16924
fix(grid): keep conditionName in sync on condition changed callback [20.1.x]#16924hanastasov wants to merge 1 commit into20.1.xfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where the conditionName property in filtering expressions was not being synchronized when users changed the filter condition through the UI. The fix ensures that whenever the condition is updated via the condition dropdown, both condition (the operation object) and conditionName (the string identifier) are updated together.
Changes:
- Updated
onConditionsChangedcallbacks in two filtering components to syncconditionNamewithcondition - Enhanced test helper function to verify both
condition.nameandconditionNameare in sync - Added test assertions to verify the fix works correctly when changing conditions in the filtering row UI
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-row.component.ts |
Added conditionName sync in onConditionsChanged for the filtering row component |
projects/igniteui-angular/src/lib/grids/filtering/excel-style/excel-style-default-expression.component.ts |
Added conditionName sync in onConditionsChanged for the Excel-style filtering component |
projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts |
Updated test helper to verify conditionName and added assertions to test condition changes |
| public onConditionsChanged(eventArgs: any) { | ||
| const value = (eventArgs.newSelection as IgxSelectComponent).value; | ||
| this.expressionUI.expression.condition = this.getCondition(value); | ||
| this.expressionUI.expression.conditionName = value; |
There was a problem hiding this comment.
Consider adding a test case that verifies the conditionName is correctly synced when changing conditions in the Excel-style custom filter dialog, similar to the test coverage added for the filtering row component at lines 150-153 and 163-166. This would ensure the fix in excel-style-default-expression.component.ts is properly tested.
There was a problem hiding this comment.
@copilot open a new pull request to apply changes based on this feedback
|
@hanastasov I've opened a new pull request, #16933, to work on those changes. Once the pull request is ready, I'll request review from you. |
Closes #16841
Additional information (check all that apply):
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)