mirror of
https://github.com/apache/superset.git
synced 2024-09-06 22:07:34 -04:00
chore: pass datasource to metrics control (#1438)
* Update controlPanel.tsx * Update index.tsx * Update dndControls.tsx
This commit is contained in:
parent
2029b37f2e
commit
a5d5f95d38
@ -90,6 +90,7 @@ export const dnd_adhoc_metrics: SharedControlConfig<'DndMetricSelect'> = {
|
||||
mapStateToProps: ({ datasource }) => ({
|
||||
columns: datasource ? datasource.columns : [],
|
||||
savedMetrics: datasource ? datasource.metrics : [],
|
||||
datasource,
|
||||
datasourceType: datasource?.type,
|
||||
}),
|
||||
description: t('One or many metrics to display'),
|
||||
@ -116,6 +117,7 @@ export const dnd_sort_by: SharedControlConfig<'DndMetricSelect'> = {
|
||||
mapStateToProps: ({ datasource }) => ({
|
||||
columns: datasource?.columns || [],
|
||||
savedMetrics: datasource?.metrics || [],
|
||||
datasource,
|
||||
datasourceType: datasource?.type,
|
||||
}),
|
||||
};
|
||||
|
@ -134,6 +134,7 @@ const metrics: SharedControlConfig<'MetricsControl'> = {
|
||||
mapStateToProps: ({ datasource }) => ({
|
||||
columns: datasource ? datasource.columns : [],
|
||||
savedMetrics: datasource ? datasource.metrics : [],
|
||||
datasource,
|
||||
datasourceType: datasource?.type,
|
||||
}),
|
||||
description: t('One or many metrics to display'),
|
||||
@ -362,6 +363,7 @@ const sort_by: SharedControlConfig<'MetricsControl'> = {
|
||||
mapStateToProps: ({ datasource }) => ({
|
||||
columns: datasource?.columns || [],
|
||||
savedMetrics: datasource?.metrics || [],
|
||||
datasource,
|
||||
datasourceType: datasource?.type,
|
||||
}),
|
||||
};
|
||||
|
@ -146,6 +146,7 @@ const percent_metrics: typeof sharedControls.metrics = {
|
||||
mapStateToProps: ({ datasource, controls }, controlState) => ({
|
||||
columns: datasource?.columns || [],
|
||||
savedMetrics: datasource?.metrics || [],
|
||||
datasource,
|
||||
datasourceType: datasource?.type,
|
||||
queryMode: getQueryMode(controls),
|
||||
externalValidationErrors: validateAggControlValues(controls, [
|
||||
|
Loading…
Reference in New Issue
Block a user