-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ML] Always enable next button in advanced job validation
- Loading branch information
1 parent
855a33c
commit f5af7b5
Showing
2 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
.../application/jobs/new_job/pages/components/validation_step/validation_warning_callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import React, { FC, useContext, useEffect, useState } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { EuiCallOut } from '@elastic/eui'; | ||
import { JobCreatorContext } from '../job_creator_context'; | ||
import { JOB_TYPE } from '../../../../../../../common/constants/new_job'; | ||
|
||
export const ValidationWarningCallout: FC = () => { | ||
const { jobCreator, jobValidator, jobValidatorUpdated } = useContext(JobCreatorContext); | ||
const [valid, setValid] = useState(false); | ||
|
||
useEffect(() => { | ||
setValid(jobValidator.validationSummary.advanced); | ||
}, [jobValidatorUpdated]); | ||
|
||
return jobCreator.type === JOB_TYPE.ADVANCED && valid === false ? ( | ||
<EuiCallOut | ||
title={ | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.validationStep.validationWarning.title" | ||
defaultMessage="Validation failed" | ||
/> | ||
} | ||
color="warning" | ||
iconType="alert" | ||
> | ||
<FormattedMessage | ||
id="xpack.ml.newJob.wizard.validationStep.validationWarning.message" | ||
defaultMessage="Job validation has failed, however for the advanced wizard it is still possible to continue to create the job. | ||
Please be aware the this job may encounter problems when running." | ||
/> | ||
</EuiCallOut> | ||
) : null; | ||
}; |