Skip to content

Commit

Permalink
Refactor TableChart to set default value for cross_filtering_on_click…
Browse files Browse the repository at this point in the history
… prop and ensure it is passed through transformProps
  • Loading branch information
saghatelian committed Jan 17, 2025
1 parent 6b50bff commit 7677780
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export default function TableChart<D extends DataRecord = DataRecord>(
isUsingTimeComparison,
basicColorFormatters,
basicColorColumnFormatters,
cross_filtering_on_click,
cross_filtering_on_click = false,
} = props;
const comparisonColumns = [
{ key: 'all', label: t('Display all') },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ const transformProps = (
comparison_color_enabled: comparisonColorEnabled = false,
comparison_color_scheme: comparisonColorScheme = ColorSchemeEnum.Green,
comparison_type,
cross_filtering_on_click,
} = formData;
const isUsingTimeComparison =
!isEmpty(time_compare) &&
Expand Down Expand Up @@ -643,6 +644,7 @@ const transformProps = (
basicColorFormatters,
startDateOffset,
basicColorColumnFormatters,
cross_filtering_on_click,
};
};

Expand Down
1 change: 1 addition & 0 deletions superset-frontend/plugins/plugin-chart-table/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export interface TableChartTransformedProps<D extends DataRecord = DataRecord> {
basicColorFormatters?: { [Key: string]: BasicColorFormatterType }[];
basicColorColumnFormatters?: { [Key: string]: BasicColorFormatterType }[];
startDateOffset?: string;
cross_filtering_on_click?: boolean;
}

export enum ColorSchemeEnum {
Expand Down

0 comments on commit 7677780

Please sign in to comment.