mirror of https://github.com/apache/superset.git
[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
This commit is contained in:
parent
a7ba6e4a5d
commit
527572c3eb
|
@ -190,3 +190,9 @@ How can i configure OAuth authentication and authorization?
|
||||||
|
|
||||||
You can take a look at this Flask-AppBuilder `configuration example
|
You can take a look at this Flask-AppBuilder `configuration example
|
||||||
<https://github.com/dpgaspar/Flask-AppBuilder/blob/master/examples/oauth/config.py>`_.
|
<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.
|
||||||
|
|
|
@ -170,10 +170,6 @@ export function dashboardContainer(dashboard, datasources, userid) {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
effectiveExtraFilters(sliceId) {
|
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 f = [];
|
||||||
const immuneSlices = this.metadata.filter_immune_slices || [];
|
const immuneSlices = this.metadata.filter_immune_slices || [];
|
||||||
if (sliceId && immuneSlices.includes(sliceId)) {
|
if (sliceId && immuneSlices.includes(sliceId)) {
|
||||||
|
@ -190,6 +186,10 @@ export function dashboardContainer(dashboard, datasources, userid) {
|
||||||
immuneToFields = this.metadata.filter_immune_slice_fields[sliceId];
|
immuneToFields = this.metadata.filter_immune_slice_fields[sliceId];
|
||||||
}
|
}
|
||||||
for (const filteringSliceId in this.filters) {
|
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]) {
|
for (const field in this.filters[filteringSliceId]) {
|
||||||
if (!immuneToFields.includes(field)) {
|
if (!immuneToFields.includes(field)) {
|
||||||
f.push({
|
f.push({
|
||||||
|
|
Loading…
Reference in New Issue