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 #9575 Avoid full rerender in filterRenderer #9577

Merged
merged 5 commits into from
Oct 12, 2023

Conversation

offtherailz
Copy link
Member

Description

The issue happens when fields is not defined. In selector the "[]" was regenerated everytime.
I fixed the selector and added an additional security in featureEditor to avoid regeneration of filterRenderers (and so loss of focus) when the values are equal.
This guarantees that if the feature grid receives them dynamically for some reason, the filter renderers are not re-computed.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?

#9575

What is the new behavior?

Fix #9575

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Other useful information

@offtherailz offtherailz added this to the 2023.02.01 milestone Oct 10, 2023
@offtherailz offtherailz self-assigned this Oct 10, 2023
@tdipisa tdipisa requested a review from dsuren1 October 11, 2023 08:51
Copy link
Contributor

@dsuren1 dsuren1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@offtherailz
The fix works fine. But it introduces a new issue where the filter row is hidden on first load of feature grid. Kindly check if this is happening. Thanks!

Screen.Recording.2023-10-11.at.4.47.23.PM.mov

@offtherailz
Copy link
Member Author

Thank you @dsuren1 , I didn't noticed it.
This is because I used wrongly useMemo API. Actually there is no way to pass a custom comare function to it. So I removed it and the test for it.

@dsuren1 dsuren1 merged commit 6fa49cf into geosolutions-it:master Oct 12, 2023
6 checks passed
offtherailz added a commit to offtherailz/MapStore2 that referenced this pull request Oct 12, 2023
…lutions-it#9577)

* Fix geosolutions-it#9575 Avoid full rerender in filterRenderer

* Fixed wrong usage of usememo

* Update web/client/plugins/featuregrid/__tests__/FeatureEditor-test.jsx

* Update web/client/plugins/featuregrid/FeatureEditor.jsx

* Update FeatureEditor.jsx
dsuren1 pushed a commit that referenced this pull request Oct 12, 2023
* Fix #9575 Avoid full rerender in filterRenderer

* Fixed wrong usage of usememo

* Update web/client/plugins/featuregrid/__tests__/FeatureEditor-test.jsx

* Update web/client/plugins/featuregrid/FeatureEditor.jsx

* Update FeatureEditor.jsx
@tdipisa
Copy link
Member

tdipisa commented Oct 12, 2023

@ElenaGallo please test in DEV and QA

@ElenaGallo
Copy link
Contributor

Test passed on DEV, @offtherailz please backport to the stable branch. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue to write a word on attribute table quick filter
4 participants