korbit-ai[bot] commented on code in PR #34137:
URL: https://github.com/apache/superset/pull/34137#discussion_r2204110745
##########
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:
Thank you for clarifying. You're right - with only one possible time range
filter, the current counting approach is correct.
--
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]