From 2c7099ada60f44e5d1962b8c6cd79aed0a19e97c Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Fri, 2 Oct 2020 11:31:28 -0600 Subject: [PATCH] ensure mml validation works as expected --- .../hooks/use_create_analytics_form/reducer.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/reducer.ts b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/reducer.ts index 59a329b2898c1..6fb3904e76ecb 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/reducer.ts +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_management/hooks/use_create_analytics_form/reducer.ts @@ -425,13 +425,15 @@ const validateForm = (state: State): State => { dependentVariable === ''; const mmlValidationResult = validateMml(estimatedModelMemoryLimit, modelMemoryLimit); - const mmlInvalid = mmlValidationResult !== null && mmlValidationResult.invalidUnits !== undefined; + const mmlInvalid = + mmlValidationResult !== null && + (mmlValidationResult.invalidUnits !== undefined || mmlValidationResult.required === true); state.form.modelMemoryLimitValidationResult = mmlValidationResult; state.isValid = !jobTypeEmpty && - mmlInvalid && + !mmlInvalid && !jobIdEmpty && jobIdValid && !jobIdExists &&