[ML] Multi metric job wizard - ensure cardinality warning only shown on validity fail (#34874) (#34937)

* Ensure cardinality warning only showns on fail

* add missing whitespace and fix typo
This commit is contained in:
Melissa Alvarez 2019-04-11 09:11:56 -07:00 committed by GitHub
parent 6e4f55171b
commit 6dd4f22152
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,9 +38,9 @@ module.directive('mlEnableModelPlotCheckbox', function (i18n) {
console.log('Cardinality could not be validated', error);
$scope.ui.cardinalityValidator.status = STATUS.FAILED;
$scope.ui.cardinalityValidator.message = i18n('xpack.ml.newJob.simple.enableModelPlot.validatingConfigurationErrorMessage', {
defaultMessage: 'An error occurred validating the configuration' +
'for running the job with model plot enabled.' +
'Creating model plots can be resource intensive and not recommended where the cardinality of the selected fields is high.' +
defaultMessage: 'An error occurred validating the configuration ' +
'for running the job with model plot enabled. ' +
'Creating model plots can be resource intensive and not recommended where the cardinality of the selected fields is high. ' +
'You may want to select a dedicated results index on the Job Details tab.'
});
// Go ahead and check the dedicated index box for them
@ -61,11 +61,11 @@ module.directive('mlEnableModelPlotCheckbox', function (i18n) {
if (validationResult.success === true) {
$scope.formConfig.enableModelPlot = true;
$scope.ui.cardinalityValidator.status = STATUS.FINISHED;
} else {
$scope.ui.cardinalityValidator.message = i18n('xpack.ml.newJob.simple.enableModelPlot.enableModelPlotDescription', {
defaultMessage: 'Creating model plots is resource intensive and not recommended' +
'where the cardinality of the selected fields is greater than 100. Estimated cardinality' +
'for this job is {highCardinality}.' +
defaultMessage: 'Creating model plots is resource intensive and not recommended ' +
'where the cardinality of the selected fields is greater than 100. Estimated cardinality ' +
'for this job is {highCardinality}. ' +
'If you enable model plot with this configuration we recommend you use a dedicated results index.',
values: { highCardinality: validationResult.highCardinality }
});
@ -106,10 +106,10 @@ module.directive('mlEnableModelPlotCheckbox', function (i18n) {
// Update checkbox on these changes
$scope.$watch('ui.formValid', updateCheckbox, true);
$scope.$watch('ui.cardinalityValidator.status', updateCheckbox, true);
// MultiMetric: Fire off cardinality validatation when fields and/or split by field is updated
// MultiMetric: Fire off cardinality validation when fields and/or split by field is updated
$scope.$watch('formConfig.fields', revalidateCardinalityOnFieldChange, true);
$scope.$watch('formConfig.splitField', revalidateCardinalityOnFieldChange, true);
// Population: Fire off cardinality validatation when overField is updated
// Population: Fire off cardinality validation when overField is updated
$scope.$watch('formConfig.overField', revalidateCardinalityOnFieldChange, true);
function updateCheckbox() {