[Transform] Fix aggregation name override for the top_metrics
aggs (#104446)
* [Transform] Fix aggName for the top_metrics agg * [Transform] update comment
This commit is contained in:
parent
763ba305d4
commit
901ad6391a
|
@ -43,7 +43,11 @@ export function getDefaultAggregationConfig(
|
|||
case PIVOT_SUPPORTED_AGGS.FILTER:
|
||||
return getFilterAggConfig(commonConfig);
|
||||
case PIVOT_SUPPORTED_AGGS.TOP_METRICS:
|
||||
return getTopMetricsAggConfig(commonConfig);
|
||||
return getTopMetricsAggConfig({
|
||||
...commonConfig,
|
||||
// top_metrics agg has different naming convention by default
|
||||
aggName: PIVOT_SUPPORTED_AGGS.TOP_METRICS,
|
||||
});
|
||||
default:
|
||||
return commonConfig;
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ import {
|
|||
import { PivotAggsConfigTopMetrics } from './types';
|
||||
import { TopMetricsAggForm } from './components/top_metrics_agg_form';
|
||||
import { isPopulatedObject } from '../../../../../../../../common/shared_imports';
|
||||
import { PIVOT_SUPPORTED_AGGS } from '../../../../../../../../common/types/pivot_aggs';
|
||||
|
||||
/**
|
||||
* Gets initial basic configuration of the top_metrics aggregation.
|
||||
|
@ -31,8 +30,6 @@ export function getTopMetricsAggConfig(
|
|||
isMultiField: true,
|
||||
field: isPivotAggsConfigWithUiSupport(commonConfig) ? commonConfig.field : '',
|
||||
AggFormComponent: TopMetricsAggForm,
|
||||
/** Default name */
|
||||
aggName: PIVOT_SUPPORTED_AGGS.TOP_METRICS,
|
||||
aggConfig: {},
|
||||
getEsAggConfig() {
|
||||
// ensure the configuration has been completed
|
||||
|
|
Loading…
Reference in a new issue