Skip to content

Commit

Permalink
fix(explore): temporal column mixin (#28241)
Browse files Browse the repository at this point in the history
(cherry picked from commit 743c0bd)
  • Loading branch information
justinpark authored and michael-s-molina committed Apr 29, 2024
1 parent c250ad2 commit b738a75
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ import {
t,
validateNonEmpty,
} from '@superset-ui/core';
import { BaseControlConfig, ControlPanelState, ControlState } from '../types';
import {
BaseControlConfig,
ControlPanelState,
ControlState,
ExtraControlProps,
} from '../types';
import { getTemporalColumns } from '../utils';

const getAxisLabel = (
Expand Down Expand Up @@ -52,14 +57,15 @@ export const xAxisMixin = {
default: undefined,
};

export const temporalColumnMixin: Pick<BaseControlConfig, 'mapStateToProps'> = {
export const temporalColumnMixin: Pick<BaseControlConfig, 'mapStateToProps'> &
Partial<ExtraControlProps> = {
isTemporal: true,
mapStateToProps: ({ datasource }) => {
const payload = getTemporalColumns(datasource);

return {
options: payload.temporalColumns,
default: payload.defaultTemporalColumn,
isTemporal: true,
};
},
};
Expand Down

0 comments on commit b738a75

Please sign in to comment.