aminghadersohi commented on code in PR #44148:
URL: https://github.com/apache/superset/pull/44148#discussion_r4155149335


##########
superset-frontend/plugins/plugin-chart-world-map/src/WorldMap.ts:
##########
@@ -191,7 +193,8 @@ function WorldMap(element: HTMLElement, props: 
WorldMapProps): void {
     const selected = Object.values(filterState.selectedValues || {});
     const key = source.id || source.country;
     const country =
-      countryFieldtype === 'name' ? mapData[key]?.name : mapData[key]?.code;
+      mapData[key]?.sourceValue ??
+      (countryFieldtype === 'name' ? mapData[key]?.name : mapData[key]?.code);

Review Comment:
   Confirmed and addressed in a0f962f1d5ad2c8865fb7f83dde1853a0ca84ec8. Both 
cross-filter and context-menu handlers now call getCountryValue(key), sharing 
the sourceValue preference and name/code fallback unchanged. Plugin Jest suite: 
13 suites, 127 tests passed. Frontend formatting, lint, custom rules, stylelint 
and type-checking hooks all passed.



##########
superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts:
##########
@@ -178,6 +182,13 @@ function CountryMap(element: HTMLElement, props: 
CountryMapProps) {
   // Track mouse position to distinguish clicks from drags
   let mousedownPos: { x: number; y: number } | null = null;
 
+  const sourceValue = (code: string) => {
+    if (!sourceValues) return code;
+    return Object.prototype.hasOwnProperty.call(sourceValues, code)
+      ? sourceValues[code]
+      : undefined;
+  };

Review Comment:
   Confirmed and addressed in a0f962f1d5ad2c8865fb7f83dde1853a0ca84ec8. Added 
four component cases passing sourceValues: mapped and unmapped regions for both 
click and context-menu interactions. Mapped cases verify the original dataset 
value in filters and drills; unmapped cases verify no data mask or context menu 
is emitted. Fail-before evidence: removing the cross-filter undefined guard 
fails the unmapped click case; removing the drill undefined guard fails the 
unmapped context-menu case; reverting to the old code fallback fails both. 
Restored production guards: 13 plugin suites, 127 tests passed. Frontend 
formatting, lint, custom rules, stylelint and type-checking hooks all passed.



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