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

hugh 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 1a8c28db3d Fixes issue where type query datasource had incorrect time 
controls when datasource type was 'query' (#20923)
1a8c28db3d is described below

commit 1a8c28db3dd8eef386db82b1f502fd049e6f82f2
Author: Eric Briscoe <[email protected]>
AuthorDate: Fri Jul 29 15:14:03 2022 -0700

    Fixes issue where type query datasource had incorrect time controls when 
datasource type was 'query' (#20923)
---
 .../src/explore/controlUtils/getSectionsToRender.ts            | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/superset-frontend/src/explore/controlUtils/getSectionsToRender.ts 
b/superset-frontend/src/explore/controlUtils/getSectionsToRender.ts
index e53d7b921d..5bfefb8ec6 100644
--- a/superset-frontend/src/explore/controlUtils/getSectionsToRender.ts
+++ b/superset-frontend/src/explore/controlUtils/getSectionsToRender.ts
@@ -54,11 +54,11 @@ const getMemoizedSectionsToRender = memoizeOne(
 
     const { datasourceAndVizType } = sections;
 
-    // list of datasource-specific controls that should be removed
-    const invalidControls =
-      datasourceType === 'table'
-        ? ['granularity']
-        : ['granularity_sqla', 'time_grain_sqla'];
+    // list of datasource-specific controls that should be removed if the 
datasource is a specific type
+    const filterControlsForTypes = [DatasourceType.Query, 
DatasourceType.Table];
+    const invalidControls = filterControlsForTypes.includes(datasourceType)
+      ? ['granularity']
+      : ['granularity_sqla', 'time_grain_sqla'];
 
     return [datasourceAndVizType]
       .concat(controlPanelSections.filter(isControlPanelSectionConfig))

Reply via email to