From eb540dcf71368086c0e41f389fab3e6432221cf6 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 1 Apr 2020 17:44:52 -0700 Subject: [PATCH 1/2] Set default value for scaled float to 1. --- .../mappings_editor/constants/parameters_definition.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx index 732449f382f93..86a04763b2a3a 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx @@ -502,7 +502,7 @@ export const PARAMETERS_DEFINITION: { [key in ParameterName]: ParameterDefinitio } ), fieldConfig: { - defaultValue: '', + defaultValue: 1, type: FIELD_TYPES.NUMBER, deserializer: (value: string | number) => +value, formatters: [toInt], From a2f91e6cd976246e750a7d01b342b0ff18da03b0 Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Fri, 3 Apr 2020 16:38:45 -0700 Subject: [PATCH 2/2] Set default value for scaled float to an empty space and fix bug that coerced this to 0. --- .../mappings_editor/constants/parameters_definition.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx index 86a04763b2a3a..1b9372e4b50c4 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/constants/parameters_definition.tsx @@ -502,9 +502,9 @@ export const PARAMETERS_DEFINITION: { [key in ParameterName]: ParameterDefinitio } ), fieldConfig: { - defaultValue: 1, + defaultValue: '', type: FIELD_TYPES.NUMBER, - deserializer: (value: string | number) => +value, + deserializer: (value: string | number) => (value === '' ? value : +value), formatters: [toInt], label: i18n.translate('xpack.idxMgmt.mappingsEditor.parameters.scalingFactorLabel', { defaultMessage: 'Scaling factor',