Fixes issue where type query datasource had incorrect time controls when datasource type was 'query' (#20923)

This commit is contained in:
Eric Briscoe 2022-07-29 15:14:03 -07:00 committed by GitHub
parent 0d8889dc9c
commit 1a8c28db3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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))