You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by li...@apache.org on 2023/06/20 21:39:50 UTC

[superset] branch master updated: fix: creating a new chart with dashboard time filters but filter can't apply again (#24405)

This is an automated email from the ASF dual-hosted git repository.

lilykuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 6dba6e32f5 fix: creating a new chart with dashboard time filters but filter can't apply again (#24405)
6dba6e32f5 is described below

commit 6dba6e32f55d719ec49cb5e6dc2fdd07a0b694df
Author: Lily Kuang <li...@preset.io>
AuthorDate: Tue Jun 20 14:39:42 2023 -0700

    fix: creating a new chart with dashboard time filters but filter can't apply again (#24405)
---
 superset-frontend/src/explore/actions/saveModalActions.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/superset-frontend/src/explore/actions/saveModalActions.js b/superset-frontend/src/explore/actions/saveModalActions.js
index 9bd5161391..de4f7af84c 100644
--- a/superset-frontend/src/explore/actions/saveModalActions.js
+++ b/superset-frontend/src/explore/actions/saveModalActions.js
@@ -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,