Skip to content

Commit

Permalink
Fixes issue where type query datasource had incorrect time controls w…
Browse files Browse the repository at this point in the history
…hen datasource type was 'query' (#20923)
  • Loading branch information
eric-briscoe authored Jul 29, 2022
1 parent 0d8889d commit 1a8c28d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 1a8c28d

Please sign in to comment.