You're aright, it will be easier with an example
To illustrate my problem, I created a custom metric that display a specific value.
This custom metric has two parameters. The first one is an string input to provide the value to display and the second one is a select containing some options.
To set up this example, I used a MetricAggType object as following :
new MetricAggType({
name: 'custom_metric',
expressionName: aggCustomFnName,
title: 'Custom metric',
type: 'metrics',
subtype: 'Customs',
hasNoDsl: true,
makeLabel(aggConfig) {
return 'Custom ' + aggConfig.id;
},
params: [
{
name: 'value',
displayName: 'Value',
type: 'string',
},
{
name: 'option',
displayName: 'Option',
type: 'optioned',
options: [
{
text: i18n.translate('option1', {
defaultMessage: 'Option1',
}),
isCompatible: true,
disabled: false,
value: 'option1',
},
{
text: i18n.translate('option2', {
defaultMessage: 'Option2',
}),
isCompatible: true,
disabled: false,
value: 'option2',
},
],
write: _.noop,
},
],
getSerializedFormat(agg) {
return fieldFormats.getDefaultInstance(KBN_FIELD_TYPES.NUMBER);
},
getValue(agg: any, bucket: any) {
return agg.params.value;
},
});
Unfortunately, the select is not displayed :
In previous version of Kibana, I can use the editorComponent property to render parameters but this property was removed.