-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(grid): fixed advancedFilteringExpressionsTree rehydration #15500 #15506
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.MD
updates for the feature docsREADME.MD
CHANGELOG.MD
updates for newly added functionalityng update
migrations for the breaking changes (migrations guidelines)