sadpandajoe opened a new pull request, #42402: URL: https://github.com/apache/superset/pull/42402
### SUMMARY The deck.GL Polygon legend could not be hidden: setting **Legend Position** to **None** left the legend on screen (reported as PPR-1207 / sc-101237). Root cause is in the shared `Legend` component. The hide gate was a strict `position === null` check, but the "None" choice no longer round-trips as `null` through the modernized antd `Select` (it comes back `undefined`), so the gate never matched and the legend always rendered. A `position = 'tr'` destructuring default made this worse by clobbering an incoming `undefined` back to `'tr'`, defeating any plain falsy check. ### CHANGES - `Legend.tsx`: remove the `position = 'tr'` destructuring default and broaden the hide gate from `position === null` to `!position`, so None/undefined/empty all hide the legend. All three `<Legend>` consumers pass `position` explicitly, so the `legendPosition` control default is unaffected. - `Legend.test.tsx`: add `test.each([null, undefined, ''])` regression coverage for the hide path plus valid-corner assertions. - `Polygon.test.tsx`: fix the mock so it honors the hide contract (also repaired a pre-existing vacuous `data-test` vs `data-testid` assertion). ### TESTING INSTRUCTIONS 1. Create a deck.GL Polygon chart with a metric set so the legend renders. 2. Set **Customize → Legend Position** to **None** and apply. 3. The legend should disappear. Setting it back to Top Right / Top Left / etc. restores it in the correct corner. Before/after QA video attached below. sc-101237 -- 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]
