rusackas commented on code in PR #35919:
URL: https://github.com/apache/superset/pull/35919#discussion_r2492444811


##########
superset-frontend/plugins/legacy-plugin-chart-world-map/src/WorldMap.js:
##########
@@ -115,8 +120,17 @@ function WorldMap(element, props) {
   const getCrossFilterDataMask = source => {
     const selected = Object.values(filterState.selectedValues || {});
     const key = source.id || source.country;
-    const country =
-      countryFieldtype === 'name' ? mapData[key]?.name : mapData[key]?.country;
+
+    let country;
+    if (countryFieldtype === 'name') {
+      country = mapData[key]?.name;
+    } else if (countryFieldtype === 'cca2') {
+      country = mapData[key]?.codes?.cca2;
+    } else if (countryFieldtype === 'cioc') {
+      country = mapData[key]?.codes?.cioc;
+    } else {
+      country = mapData[key]?.country;
+    }

Review Comment:
   Agree with the bot on this one, it'd be nice to adhere to the "DRY" 
principle here. 



-- 
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]

Reply via email to