Skip to content
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

Merged
merged 13 commits into from
Mar 18, 2025

Conversation

Otixa
Copy link
Contributor

@Otixa Otixa commented Mar 12, 2025

Closes #15500

Additional information (check all that apply):

  • Bug fix
  • New functionality
  • Documentation
  • Demos
  • CI/CD

Checklist:

  • All relevant tags have been applied to this PR
  • This PR includes unit tests covering all the new code (test guidelines)
  • This PR includes API docs for newly added methods/properties (api docs guidelines)
  • This PR includes feature/README.MD updates for the feature docs
  • This PR includes general feature table updates in the root README.MD
  • This PR includes CHANGELOG.MD updates for newly added functionality
  • This PR contains breaking changes
  • This PR includes ng update migrations for the breaking changes (migrations guidelines)
  • This PR includes behavioral changes and the feature specification has been updated with them

@Otixa Otixa added the ❌ status: awaiting-test PRs awaiting manual verification label Mar 12, 2025
@gedinakova gedinakova added 💥 status: in-test PRs currently being tested ✅ status: verified Applies to PRs that have passed manual verification and removed ❌ status: awaiting-test PRs awaiting manual verification 💥 status: in-test PRs currently being tested labels Mar 12, 2025
Copy link
Contributor

@gedinakova gedinakova left a 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.

@hanastasov
Copy link
Contributor

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:

image

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.

@gedinakova
Copy link
Contributor

gedinakova commented Mar 14, 2025

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:

image

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.

@hanastasov
Copy link
Contributor

Thanks Gale for the explanation.

gedinakova
gedinakova previously approved these changes Mar 17, 2025
Copy link
Member

@damyanpetev damyanpetev left a 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.

Comment on lines +6679 to +6683
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;
Copy link
Member

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 :)

@gedinakova gedinakova self-requested a review March 17, 2025 14:26
gedinakova
gedinakova previously approved these changes Mar 17, 2025
gedinakova
gedinakova previously approved these changes Mar 17, 2025
@damyanpetev damyanpetev added the squash-merge Merge PR with "Squash and Merge" option label Mar 18, 2025
@damyanpetev damyanpetev merged commit 93ff065 into master Mar 18, 2025
5 checks passed
@damyanpetev damyanpetev deleted the filtering-15500 branch March 18, 2025 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filtering grid: advanced-filtering squash-merge Merge PR with "Squash and Merge" option ✅ status: verified Applies to PRs that have passed manual verification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assigning a filteringExpressionsTree created by parsing a JSON string crashes
5 participants