diegomedina248 opened a new pull request, #19889: URL: https://github.com/apache/superset/pull/19889
### SUMMARY When editing a metric in the Explore, the title label that's automatically set when using the Custom SQL mode gets reset if you hover over it/change tabs/interact with the popover. The reason is because the component is always being rerender, and in that case, the metric get's a new id and the label state is lost. This PR caches the metric component so that it only rerenders when needed. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF Before: https://user-images.githubusercontent.com/17252075/165856997-4b41bc4b-271e-45d9-9f1c-0b255aad68fc.mov After: https://user-images.githubusercontent.com/17252075/165857046-6dfae7b9-25bc-4393-bb75-6e0e1d478a4e.mov ### TESTING INSTRUCTIONS 1. Select any chart to Explore 2. Drag a new metric/edit an existing one 3. Go to Custom SQL mode 4. Enter any custom SQL Ensure the title changes to match the sql entered. Ensure hovering the title doesn't reset it. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] 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 -- 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]
