Skip to content

Commit

Permalink
fix: creating a new chart with dashboard time filters, time filter do…
Browse files Browse the repository at this point in the history
…esn't to the new chart
  • Loading branch information
Lily Kuang committed Jun 14, 2023
1 parent 19a9400 commit 901a73d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions superset-frontend/src/explore/actions/saveModalActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ export const getSlicePayload = (
adhocFilters = extractAddHocFiltersFromFormData(formDataFromSlice);
}

if (
isEmpty(adhocFilters?.adhoc_filters) &&
isEmpty(formDataFromSlice) &&
formDataWithNativeFilters.adhoc_filters.length > 0
) {
adhocFilters.adhoc_filters = [
{
...formDataWithNativeFilters.adhoc_filters[0],
comparator: 'No filter',
},
];
}

const formData = {
...formDataWithNativeFilters,
...adhocFilters,
Expand Down

0 comments on commit 901a73d

Please sign in to comment.