etr2460 commented on a change in pull request #8404: [WIP][feature]Dashboard
filter scope selector modal
URL:
https://github.com/apache/incubator-superset/pull/8404#discussion_r342186033
##########
File path: superset/assets/src/dashboard/util/activeDashboardFilters.js
##########
@@ -17,14 +17,31 @@
* under the License.
*/
let activeFilters = {};
+let allFilterBoxChartIds = [];
export function getActiveFilters() {
return activeFilters;
}
+// currently filterbox is a chart,
+// when define filter scopes, they have to be out pulled out in a few places.
+// after we make filterbox a dashboard build-in component,
+// will not need this check anymore
+export function isFilterBox(chartId) {
+ return allFilterBoxChartIds.includes(chartId);
+}
+
+export function getAllFilterBoxChartIds() {
+ return allFilterBoxChartIds;
+}
+
// non-empty filters from dashboardFilters,
// this function does not take into account: filter immune or filter scope
settings
export function buildActiveFilters(allDashboardFilters = {}) {
+ allFilterBoxChartIds = Object.values(allDashboardFilters).map(
Review comment:
Does this mean that we need to call `buildActiveFilters` before
`getAllFilterBoxChartIds` and `isFilterBox` works? This sort of mutability is
really error prone, is there a better way to do this?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]