ramiroaquinoromero commented on code in PR #37012:
URL: https://github.com/apache/superset/pull/37012#discussion_r2680836086
##########
superset-frontend/src/dashboard/components/nativeFilters/state.ts:
##########
@@ -144,20 +144,38 @@ export function useSelectFiltersInScope(filters: (Filter
| Divider)[]) {
let filtersInScope: (Filter | Divider)[] = [];
const filtersOutOfScope: (Filter | Divider)[] = [];
- // we check native filters scopes only on dashboards with tabs
- if (!dashboardHasTabs) {
- filtersInScope = filters;
- } else {
- filters.forEach(filter => {
+ filters.forEach(filter => {
+ // Dividers are always in scope
+ if (isFilterDivider(filter)) {
+ filtersInScope.push(filter);
+ return;
+ }
+
+ // If dashboard has tabs, check scope based on visibility
+ if (dashboardHasTabs) {
const filterInScope = isFilterInScope(filter);
-
if (filterInScope) {
filtersInScope.push(filter);
} else {
filtersOutOfScope.push(filter);
}
- });
- }
+ } else {
+ // If no tabs, check if filter has any charts in scope
+ // Only mark as out of scope if chartsInScope is explicitly defined
AND empty
+ const hasExplicitChartsInScope = Array.isArray(filter.chartsInScope);
+ const hasChartsInScope =
+ hasExplicitChartsInScope && filter.chartsInScope!.length > 0;
Review Comment:
Updated
--
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]