maloun96 commented on a change in pull request #13625:
URL: https://github.com/apache/superset/pull/13625#discussion_r595774043



##########
File path: superset-frontend/src/dashboard/util/activeAllDashboardFilters.ts
##########
@@ -64,35 +64,36 @@ export const findAffectedCharts = ({
       child,
       layout,
       scope,
-      activeNativeFilters,
+      activeFilters,
       filterId,
       extraFormData,
     }),
   );
 };
 
-export const getActiveNativeFilters = ({
-  filters,
+export const getAllActiveFilters = ({
+  chartConfiguration,
+  nativeFilters,
   dataMask,
   layout,
 }: {
+  chartConfiguration: ChartConfiguration;
   dataMask: DataMaskStateWithId;
-  filters: Filters;
+  nativeFilters: Filters;
   layout: { [key: string]: LayoutItem };
 }): ActiveFilters => {
-  const activeNativeFilters = {};
-  if (!dataMask?.nativeFilters) {
-    return activeNativeFilters;
-  }
+  const activeFilters = {};
+
+  // Combine native filters with cross filters, because they have similar logic
   Object.values({
     ...dataMask.nativeFilters,
     ...dataMask.crossFilters,
   }).forEach(({ id: filterId, extraFormData }) => {
-    // TODO: for a case of a cross filters (should be updated will be added 
scope there)
-    const scope = filters?.[filterId]?.scope ?? {
-      rootPath: [DASHBOARD_ROOT_ID],
-      excluded: [],
-    };
+    const scope = nativeFilters?.[filterId]?.scope ??
+      chartConfiguration[filterId]?.crossFilters?.scope ?? {

Review comment:
       ```suggestion
         chartConfiguration?.[filterId]?.crossFilters?.scope ?? {
   ```




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

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