fix(grid): fixed advancedFilteringExpressionsTree rehydration #15500#15506
fix(grid): fixed advancedFilteringExpressionsTree rehydration #15500#15506damyanpetev merged 13 commits intomasterfrom
Conversation
gedinakova
left a comment
There was a problem hiding this comment.
We need a test for this.
projects/igniteui-angular/src/lib/grids/grid/grid-filtering-advanced.spec.ts
Show resolved
Hide resolved
|
Is this PR still in progress? Because it has the verified badge, but commits are made which are not related to some comment requesting changes. For the last changes, maybe they are OK but I dont see why such change is required: Obviously it does not bring along any change in how the code works with those interfaces, so it made me question if this is neccesary. |
Yes, they are necessary and should cover the scenario where the expression tree is set as follows (this is coming from a sample provided by PwnJS): advancedFilteringExpressionsTree2: IExpressionTree = {
"filteringOperands": [
{
"fieldName": "productID",
"condition": {
"name": "equals",
"isUnary": false,
"iconName": "filter_equal"
},
"conditionName": "equals",
"ignoreCase": true,
"searchVal": 33,
"searchTree": null
}
],
"operator": 0,
"returnFields": []
};I will add a test now, so to stop any further confusion. |
|
Thanks Gale for the explanation. |
There was a problem hiding this comment.
Eh, sure - I suppose the props on the filtering expression/tree technically accept nullish and some odd scenario in an app could evaluate to a null type, but generally shouldn't happen. Don't mind them typed as such regardless.
The change request mostly for the type on return fields, the rest of the comments are merely small improvements.
projects/igniteui-angular/src/lib/data-operations/filtering-expressions-tree.ts
Outdated
Show resolved
Hide resolved
projects/igniteui-angular/src/lib/data-operations/filtering-expression.interface.ts
Outdated
Show resolved
Hide resolved
| if (this._columns && this._filteringExpressionsTree) { | ||
| this._filteringExpressionsTree = recreateTreeFromFields(this._filteringExpressionsTree, this._columns) as IFilteringExpressionsTree; | ||
| } | ||
| if (this._columns && this._advancedFilteringExpressionsTree) { | ||
| this._advancedFilteringExpressionsTree = recreateTreeFromFields(this._advancedFilteringExpressionsTree, this._columns) as IFilteringExpressionsTree; |
There was a problem hiding this comment.
At some point we might want to dedupe this into a private function we can call in all places :)


Closes #15500
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)