kgabryje opened a new pull request #16196: URL: https://github.com/apache/superset/pull/16196
### SUMMARY When user opened "Add new metric" popover and selected a column and/or aggregate, metric title is automatically set to "column(aggregate)". However, when user hovers with their mouse outside of the popover before saving, the title gets reset. Then, after saving, the label appears to be correct, but an empty string gets passed to executed query as a label, causing seemingly unrelated errors. This PR converts `MetricsControl` component from class to functional and uses memoization to prevent resetting the title. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Before: see linked issue and video in the comments After: https://user-images.githubusercontent.com/15073128/129045681-e33f2ab4-4aac-4d95-b928-6f5c3705e13f.mov ### TESTING INSTRUCTIONS 1. Open a chart 2. Open new metric popover 3. Add a column and aggregate 4. Hover with your mouse outside of the popover - nothing should happen 5. Save the metric and run query 6. Chart should render as expected ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [x] Has associated issue: fixes #16067 - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API CC @graceguo-supercat @junlincc -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
