You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2017/08/18 22:49:35 UTC
[incubator-superset] branch master updated: [dashboard] re-enabling
cascading filters (#3335)
This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 527572c [dashboard] re-enabling cascading filters (#3335)
527572c is described below
commit 527572c3ebee96e5f00f49edade60b3a5a6aa700
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Fri Aug 18 15:49:29 2017 -0700
[dashboard] re-enabling cascading filters (#3335)
* [dashboard] re-enabling cascading filters
https://github.com/apache/incubator-superset/pull/3183 disabled the
ability of a filterbox to get filtered by another filterbox
* linting
---
docs/faq.rst | 6 ++++++
superset/assets/javascripts/dashboard/Dashboard.jsx | 8 ++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/docs/faq.rst b/docs/faq.rst
index b6f2788..82280ed 100644
--- a/docs/faq.rst
+++ b/docs/faq.rst
@@ -190,3 +190,9 @@ How can i configure OAuth authentication and authorization?
You can take a look at this Flask-AppBuilder `configuration example
<https://github.com/dpgaspar/Flask-AppBuilder/blob/master/examples/oauth/config.py>`_.
+
+How can I set a default filter on my dashboard?
+-----------------------------------------------
+
+Easy. Simply apply the filter and save the dashboard while the filter
+is active.
diff --git a/superset/assets/javascripts/dashboard/Dashboard.jsx b/superset/assets/javascripts/dashboard/Dashboard.jsx
index 7cc7699..3c7b912 100644
--- a/superset/assets/javascripts/dashboard/Dashboard.jsx
+++ b/superset/assets/javascripts/dashboard/Dashboard.jsx
@@ -170,10 +170,6 @@ export function dashboardContainer(dashboard, datasources, userid) {
}
},
effectiveExtraFilters(sliceId) {
- // Don't filter the filter_box itself by preselect_filters
- if (this.getSlice(sliceId).formData.viz_type === 'filter_box') {
- return [];
- }
const f = [];
const immuneSlices = this.metadata.filter_immune_slices || [];
if (sliceId && immuneSlices.includes(sliceId)) {
@@ -190,6 +186,10 @@ export function dashboardContainer(dashboard, datasources, userid) {
immuneToFields = this.metadata.filter_immune_slice_fields[sliceId];
}
for (const filteringSliceId in this.filters) {
+ if (filteringSliceId === sliceId) {
+ // Filters applied by the slice don't apply to itself
+ continue;
+ }
for (const field in this.filters[filteringSliceId]) {
if (!immuneToFields.includes(field)) {
f.push({
--
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <co...@superset.apache.org>'].