Skip to content

Commit

Permalink
fix: dashboard should not add extra_filters onto chart annotation (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace Guo committed Jun 21, 2020
1 parent 961b55c commit 6910053
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions superset-frontend/src/chart/chartAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export function runAnnotationQuery(
timeout = 60,
formData = null,
key,
isDashboardRequest = false,
) {
return function (dispatch, getState) {
const sliceKey = key || Object.keys(getState().charts)[0];
Expand Down Expand Up @@ -251,7 +252,7 @@ export function runAnnotationQuery(
{},
);

if (fd !== null) {
if (!isDashboardRequest && fd) {
const hasExtraFilters = fd.extra_filters && fd.extra_filters.length > 0;
sliceFormData.extra_filters = hasExtraFilters
? fd.extra_filters
Expand Down Expand Up @@ -410,13 +411,16 @@ export function exploreJSON(
});

const annotationLayers = formData.annotation_layers || [];
const isDashboardRequest = dashboardId > 0;

return Promise.all([
chartDataRequestCaught,
dispatch(triggerQuery(false, key)),
dispatch(updateQueryFormData(formData, key)),
...annotationLayers.map(x =>
dispatch(runAnnotationQuery(x, timeout, formData, key)),
dispatch(
runAnnotationQuery(x, timeout, formData, key, isDashboardRequest),
),
),
]);
};
Expand Down

0 comments on commit 6910053

Please sign in to comment.