Mayankaggarwal8055 commented on code in PR #38762:
URL: https://github.com/apache/superset/pull/38762#discussion_r2966384437


##########
superset-frontend/src/dashboard/util/getRelatedCharts.ts:
##########
@@ -55,31 +55,10 @@ function getRelatedChartsForCrossFilter(
   slices: Record<string, Slice>,
   scope: number[],
 ): number[] {
-  const sourceSlice = slices[filterKey];
-
-  if (!sourceSlice) return [];
-
-  const fullScope = [
-    ...scope.filter(s => String(s) !== filterKey),
-    Number(filterKey),
-  ];
-  const scopeSet = new Set(scope);
-
-  return Object.values(slices).reduce((result: number[], slice) => {
-    if (slice.slice_id === Number(filterKey)) {
-      return result;
-    }
-    // Check if it's in the global scope
-    if (isGlobalScope(fullScope, slices)) {
-      result.push(slice.slice_id);
-      return result;
-    }
-    // Check if it's hand-picked in scope
-    if (scopeSet.has(slice.slice_id)) {
-      result.push(slice.slice_id);
-    }
-    return result;
-  }, []);
+  // Always return all charts except source chart
+  return Object.values(slices)
+    .map(slice => slice.slice_id)
+    .filter(id => id !== Number(filterKey));

Review Comment:
   - Restored scope-aware filtering
   - Now only returns charts within the provided scope (excluding the source 
chart)



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