-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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(explore): clean data when hidding control #19039
Conversation
Codecov Report
@@ Coverage Diff @@
## master #19039 +/- ##
=======================================
Coverage 66.59% 66.59%
=======================================
Files 1682 1682
Lines 64291 64299 +8
Branches 6554 6558 +4
=======================================
+ Hits 42815 42823 +8
+ Misses 19775 19774 -1
- Partials 1701 1702 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
|
||
const NUM_COLUMNS = 12; | ||
|
||
type Control = React.ReactElement | null; | ||
|
||
export default function ControlRow({ controls }: { controls: Control[] }) { | ||
// ColorMapControl renders null and should not be counted |
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.
Currently we don't have ColorMapControl
, so clean it here.
Hi @stephenLYZ , I tested this PR in my local, but the order direction checkbox is gone when I put an ad-hoc metric. order.direction.gone.mov |
Fixed. |
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.
LGTM!
SUMMARY
This PR solves the problem that form data will not be cleared when hiding a control via dynamic controls (e.g. orderBy). These are what I did:
false
doesn't return null in parent component rendering, but returns null in child component and resets the control value in child componentuseEffect
.HiddenControl
(don't be counted and don't display)BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
before
before.mov
after
after.mov
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION