sadpandajoe opened a new issue, #44919:
URL: https://github.com/apache/superset/issues/44919
### Bug description
`ExtentTag` uses truthiness checks for `fixedZoom`, `fixedLatitude` and
`fixedLongitude`, so `0` (equator, prime meridian, zoom level 0) is rendered as
"unset" even though the value is set.
Steps to reproduce: Map View control -> Custom -> set extent with latitude 0
(or longitude 0 / zoom 0) via "Use current extent" or the popover. The tag
reads e.g. "Zoom: 5 | Lat: unset | Lon: 12.000000".
Expected: "Lat: 0.000000".
### Where
`superset-frontend/src/explore/components/controls/MapViewControl/ExtentTag.tsx`
L37-L43
```
{value.fixedZoom ? Math.round(value.fixedZoom) : unsetName}
{value.fixedLatitude ? value.fixedLatitude.toFixed(6) : unsetName}
{value.fixedLongitude ? value.fixedLongitude.toFixed(6) : unsetName}
```
### Suggested fix
Compare with `!= null` (or `typeof === 'number'`) instead of truthiness.
### Found by
Found while adding React Testing Library coverage for Explore controls (all
line numbers are against `master` at `bc3698b5d6`).
--
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]