-
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] Data Frame Analytics creation wizard: add validation step (Part …
…1) (#93478) (#93869) * wip: create validationStep component * wip: trainingPercent check, analysisFields check. Step details * move validation check to server * handle no training percent in validation * move callout component to shared dir * use shared Callout component in AD val and update message headings * update types * adds functional tests for validation * adds api integration test for validate endpoint * consolidate messages for depvar and fields * fix accessibility test * update license * update validation messages * update types in validation model * add jobValidationReturnType
- Loading branch information
1 parent
ad63751
commit 46e7ec0
Showing
28 changed files
with
947 additions
and
101 deletions.
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
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
67 changes: 67 additions & 0 deletions
67
x-pack/plugins/ml/public/application/components/callout/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,67 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React, { FC } from 'react'; | ||
import { EuiCallOut, EuiLink, EuiSpacer } from '@elastic/eui'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { CalloutMessage, VALIDATION_STATUS } from '../../../../common/constants/validation'; | ||
|
||
export const defaultIconType = 'questionInCircle'; | ||
|
||
const statusToEuiColor = (status: VALIDATION_STATUS) => { | ||
switch (status) { | ||
case VALIDATION_STATUS.INFO: | ||
return 'primary'; | ||
case VALIDATION_STATUS.ERROR: | ||
return 'danger'; | ||
default: | ||
return status; | ||
} | ||
}; | ||
|
||
export const statusToEuiIconType = (status: VALIDATION_STATUS) => { | ||
switch (status) { | ||
case VALIDATION_STATUS.INFO: | ||
return 'iInCircle'; | ||
case VALIDATION_STATUS.ERROR: | ||
return 'cross'; | ||
case VALIDATION_STATUS.SUCCESS: | ||
return 'check'; | ||
case VALIDATION_STATUS.WARNING: | ||
return 'alert'; | ||
default: | ||
return status; | ||
} | ||
}; | ||
|
||
const Link: FC<{ url: string }> = ({ url }) => ( | ||
<EuiLink href={url} target="_BLANK"> | ||
<FormattedMessage id="xpack.ml.validateJob.learnMoreLinkText" defaultMessage="Learn more" /> | ||
</EuiLink> | ||
); | ||
|
||
const Message: FC<Pick<CalloutMessage, 'text' | 'url'>> = ({ text, url }) => ( | ||
<> | ||
{text} {url && <Link url={url} />} | ||
</> | ||
); | ||
|
||
export const Callout: FC<CalloutMessage> = ({ heading, status, text, url }) => ( | ||
<> | ||
<EuiCallOut | ||
data-test-subj={'mlValidationCallout'} | ||
// @ts-ignore | ||
color={statusToEuiColor(status)} | ||
size="s" | ||
title={heading || <Message text={text} url={url} />} | ||
iconType={status ? statusToEuiIconType(status) : defaultIconType} | ||
> | ||
{heading && <Message text={text} url={url} />} | ||
</EuiCallOut> | ||
<EuiSpacer size="m" /> | ||
</> | ||
); |
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/ml/public/application/components/callout/index.ts
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,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export { Callout, statusToEuiIconType } from './callout'; |
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
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
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
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
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
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
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
8 changes: 8 additions & 0 deletions
8
...ication/data_frame_analytics/pages/analytics_creation/components/validation_step/index.ts
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,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export { ValidationStepWrapper } from './validation_step_wrapper'; |
Oops, something went wrong.