ObservabilityTeam commented on code in PR #34137:
URL: https://github.com/apache/superset/pull/34137#discussion_r2204109365


##########
superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterValue.tsx:
##########
@@ -155,6 +157,37 @@
       dashboardId,
     });
     const filterOwnState = filter.dataMask?.ownState || {};
+    if (filter?.cascadeParentIds?.length) {
+      // check if it is a child filter
+
+      let selectedParentFilterValueCounts = 0;
+
+      filter?.cascadeParentIds?.forEach(pId => {
+        if (
+          allFilters[pId]?.controlValues?.defaultToFirstItem ||
+          allFilters[pId]?.defaultDataMask?.extraFormData?.filters ||
+          allFilters[pId]?.defaultDataMask?.extraFormData?.time_range
+        ) {
+          selectedParentFilterValueCounts +=
+            allFilters[pId]?.defaultDataMask?.extraFormData?.filters?.length 
?? 1;
+        }
+      });
+
+      // check if all parent filters with defaults have a value selected
+
+      let depsCount = dependencies.filters?.length ?? 0;
+
+      if (dependencies?.time_range) {
+        depsCount += 1;
+      }

Review Comment:
   There can only one time range filter as far as I know at a time on a 
dashboard.



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