Skip to content

Commit

Permalink
fix(RB-454): Can't remove Day opt from time grain
Browse files Browse the repository at this point in the history
Linked to apache#21268
  • Loading branch information
frassinier authored Aug 31, 2022
1 parent c40bf69 commit dc23c7f
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,17 +325,20 @@ const granularity_sqla: SharedControlConfig<'SelectControl', ColumnMeta> = {
const time_grain_sqla: SharedControlConfig<'SelectControl'> = {
type: 'SelectControl',
label: TIME_FILTER_LABELS.time_grain_sqla,
default: 'P1D',
description: t(
'The time granularity for the visualization. This ' +
'applies a date transformation to alter ' +
'your time column and defines a new time granularity. ' +
'The options here are defined on a per database ' +
'engine basis in the Superset source code.',
),
mapStateToProps: ({ datasource }) => ({
choices: (datasource as Dataset)?.time_grain_sqla || null,
}),
mapStateToProps: ({ datasource }) => {
const choices = (datasource as Dataset)?.time_grain_sqla || null;
return {
default: choices && choices[0][0],
choices,
};
},
};

const time_range: SharedControlConfig<'DateFilterControl'> = {
Expand Down

0 comments on commit dc23c7f

Please sign in to comment.