fix(dashboard): ensure world map chart uses correct country code format in crossfilter (#35919)

This commit is contained in:
Yong Le He
2025-11-17 12:14:04 -05:00
committed by GitHub
parent 962faa2196
commit fb8eb2a5c3
2 changed files with 4 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ const propTypes = {
data: PropTypes.arrayOf(
PropTypes.shape({
country: PropTypes.string,
code: PropTypes.string,
latitude: PropTypes.number,
longitude: PropTypes.number,
name: PropTypes.string,
@@ -116,7 +117,7 @@ function WorldMap(element, props) {
const selected = Object.values(filterState.selectedValues || {});
const key = source.id || source.country;
const country =
countryFieldtype === 'name' ? mapData[key]?.name : mapData[key]?.country;
countryFieldtype === 'name' ? mapData[key]?.name : mapData[key]?.code;
if (!country) {
return undefined;
@@ -170,7 +171,7 @@ function WorldMap(element, props) {
pointerEvent.preventDefault();
const key = source.id || source.country;
const val =
countryFieldtype === 'name' ? mapData[key]?.name : mapData[key]?.country;
countryFieldtype === 'name' ? mapData[key]?.name : mapData[key]?.code;
let drillToDetailFilters;
let drillByFilters;
if (val) {