Skip to content

Commit

Permalink
fix(chart-controls): expose datasource for some controls (apache-supe…
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud authored and NejcZdovc committed Apr 20, 2021
1 parent ba0941d commit 3bf47bd
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ const time_range: SharedControlConfig<'DateFilterControl'> = {
"using the engine's local timezone. Note one can explicitly set the timezone " +
'per the ISO 8601 format if specifying either the start and/or end time.',
),
mapStateToProps: ({ form_data }) => ({
mapStateToProps: ({ datasource, form_data }) => ({
datasource,
endpoints: form_data?.time_range_endpoints || null,
}),
};
Expand Down Expand Up @@ -443,12 +444,13 @@ const adhoc_filters: SharedControlConfig<'AdhocFilterControl'> = {
label: t('Filters'),
default: null,
description: '',
mapStateToProps: ({ datasource }) => ({
mapStateToProps: ({ datasource, form_data }) => ({
columns: datasource?.columns.filter(c => c.filterable) || [],
savedMetrics: datasource?.metrics || [],
// current active adhoc metrics
selectedMetrics: form_data.metrics || (form_data.metric ? [form_data.metric] : []),
datasource,
}),
provideFormDataToProps: true,
};

const color_scheme: SharedControlConfig<'ColorSchemeControl'> = {
Expand Down

0 comments on commit 3bf47bd

Please sign in to comment.