From b69b1640082f056c793000e809257721338b8642 Mon Sep 17 00:00:00 2001 From: Melissa Alvarez Date: Mon, 17 Aug 2020 16:55:38 -0400 Subject: [PATCH] Clarify no documents error message when filtering by is_training --- .../regression_exploration/evaluate_panel.tsx | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx index 895d217555ef..197160a1be4d 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_exploration/components/regression_exploration/evaluate_panel.tsx @@ -338,7 +338,16 @@ export const EvaluatePanel: FC = ({ jobConfig, jobStatus, searchQuery }) {generalizationEval.error !== null && ( - {generalizationEval.error} + {isTrainingFilter === true && + generalizationDocsCount === 0 && + generalizationEval.error.includes('No documents found') + ? i18n.translate( + 'xpack.ml.dataframe.analytics.regressionExploration.evaluateNoTestingDocsError', + { + defaultMessage: 'No testing documents found', + } + ) + : generalizationEval.error} )} @@ -421,7 +430,16 @@ export const EvaluatePanel: FC = ({ jobConfig, jobStatus, searchQuery }) {trainingEval.error !== null && ( - {trainingEval.error} + {isTrainingFilter === false && + trainingDocsCount === 0 && + trainingEval.error.includes('No documents found') + ? i18n.translate( + 'xpack.ml.dataframe.analytics.regressionExploration.evaluateNoTrainingDocsError', + { + defaultMessage: 'No training documents found', + } + ) + : trainingEval.error} )}