mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix(dashboard): Incorrect scopes of cross filters (#20927)
This commit is contained in:
parent
bc435e08d0
commit
90e2d82a38
@ -337,6 +337,25 @@ export const hydrateDashboard =
|
|||||||
if (!metadata.chart_configuration) {
|
if (!metadata.chart_configuration) {
|
||||||
metadata.chart_configuration = {};
|
metadata.chart_configuration = {};
|
||||||
}
|
}
|
||||||
|
if (behaviors.includes(Behavior.INTERACTIVE_CHART)) {
|
||||||
|
if (!metadata.chart_configuration[chartId]) {
|
||||||
|
metadata.chart_configuration[chartId] = {
|
||||||
|
id: chartId,
|
||||||
|
crossFilters: {
|
||||||
|
scope: {
|
||||||
|
rootPath: [DASHBOARD_ROOT_ID],
|
||||||
|
excluded: [chartId], // By default it doesn't affects itself
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
metadata.chart_configuration[chartId].crossFilters.chartsInScope =
|
||||||
|
getChartIdsInFilterScope(
|
||||||
|
metadata.chart_configuration[chartId].crossFilters.scope,
|
||||||
|
chartQueries,
|
||||||
|
dashboardLayout.present,
|
||||||
|
);
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
behaviors.includes(Behavior.INTERACTIVE_CHART) &&
|
behaviors.includes(Behavior.INTERACTIVE_CHART) &&
|
||||||
!metadata.chart_configuration[chartId]
|
!metadata.chart_configuration[chartId]
|
||||||
@ -348,21 +367,9 @@ export const hydrateDashboard =
|
|||||||
rootPath: [DASHBOARD_ROOT_ID],
|
rootPath: [DASHBOARD_ROOT_ID],
|
||||||
excluded: [chartId], // By default it doesn't affects itself
|
excluded: [chartId], // By default it doesn't affects itself
|
||||||
},
|
},
|
||||||
chartsInScope: Array.from(sliceIds),
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (
|
|
||||||
behaviors.includes(Behavior.INTERACTIVE_CHART) &&
|
|
||||||
!metadata.chart_configuration[chartId].crossFilters?.chartsInScope
|
|
||||||
) {
|
|
||||||
metadata.chart_configuration[chartId].crossFilters.chartsInScope =
|
|
||||||
getChartIdsInFilterScope(
|
|
||||||
metadata.chart_configuration[chartId].crossFilters.scope,
|
|
||||||
charts,
|
|
||||||
dashboardLayout.present,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user