diegomedina248 opened a new pull request #19071: URL: https://github.com/apache/superset/pull/19071
### SUMMARY The Pivot Table conditional formatting was not updating the metric list when changes where made. The problem is that the conditional formatting only executed the `mapStateToProps` function once, on startup, and thus, changing the information on the metrics without triggering a rerender in any other way caused the panel to have obsolete data. This pointed to a brittle way the panel were recomputing their properties: It was only done if the number of arguments of the `mapStateToProps` equals to three. Instead, this PR adds a function `shouldMapStateToProps` to the panel config interface to allow controls to request updates if they need to. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF https://user-images.githubusercontent.com/17252075/157319984-ea4168bd-ee11-41eb-9f28-ecf98f97da84.mov ### TESTING INSTRUCTIONS 1. Create a pivot table 2. Add one metric 3. In Customize, select that metric for conditional formatting 4. Add a second metric 5. Try to select the metric in conditional formatting Ensure the second added metric displays in the conditional formatting panel. ### ADDITIONAL INFORMATION - [ ] 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 - [X] Introduces new feature or API - [X] 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]
