-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[ML] Add checkbox to enable model plot in Advanced job wizard #25468
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
alvarezmelissa87
merged 10 commits into
elastic:master
from
alvarezmelissa87:ml-configure-model-plot-advanced
Nov 16, 2018
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0ed01e8
Move cardinality success check to utils
alvarezmelissa87 b506f85
enableModelPlot checkbox base added
alvarezmelissa87 b2cf90b
Run cardinality check on add/update fields
alvarezmelissa87 e2bdf4c
Handle changes made via json
alvarezmelissa87 826d9d0
only run cardinality check if model plot enabled
alvarezmelissa87 4c5006c
Handle model plot enabled via EditJSON tab
alvarezmelissa87 e04f92d
show message on cardinality check error
alvarezmelissa87 b28d318
multi-metric + pop: show message on cardinality check error
alvarezmelissa87 aefa3e3
add test for callout component
alvarezmelissa87 fa6c040
Fix flexitem overflow in IE11
alvarezmelissa87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
x-pack/plugins/ml/public/jobs/new_job/advanced/_advanced.scss
This file contains hidden or 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 hidden or 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
22 changes: 22 additions & 0 deletions
22
.../public/jobs/new_job/advanced/enable_model_plot_callout/enable_model_plot_callout.test.js
This file contains hidden or 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,22 @@ | ||
| /* | ||
| * 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 from 'react'; | ||
| import { mount } from 'enzyme'; | ||
| import { EnableModelPlotCallout } from './enable_model_plot_callout_view.js'; | ||
|
|
||
| const message = 'Test message'; | ||
|
|
||
| describe('EnableModelPlotCallout', () => { | ||
|
|
||
| test('Callout is rendered correctly with message', () => { | ||
| const wrapper = mount(<EnableModelPlotCallout message={message} />); | ||
| const calloutText = wrapper.find('EuiText'); | ||
|
|
||
| expect(calloutText.text()).toBe(message); | ||
| }); | ||
|
|
||
| }); |
22 changes: 22 additions & 0 deletions
22
...ic/jobs/new_job/advanced/enable_model_plot_callout/enable_model_plot_callout_directive.js
This file contains hidden or 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,22 @@ | ||
| /* | ||
| * 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 'ngreact'; | ||
|
|
||
| import { uiModules } from 'ui/modules'; | ||
| const module = uiModules.get('apps/ml', ['react']); | ||
|
|
||
| import { EnableModelPlotCallout } from './enable_model_plot_callout_view.js'; | ||
|
|
||
| module.directive('mlEnableModelPlotCallout', function (reactDirective) { | ||
| return reactDirective( | ||
| EnableModelPlotCallout, | ||
| undefined, | ||
| { restrict: 'E' } | ||
| ); | ||
| }); |
39 changes: 39 additions & 0 deletions
39
.../public/jobs/new_job/advanced/enable_model_plot_callout/enable_model_plot_callout_view.js
This file contains hidden or 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 PropTypes from 'prop-types'; | ||
| import React, { Fragment } from 'react'; | ||
|
|
||
| import { | ||
| EuiCallOut, | ||
| EuiFlexGroup, | ||
| EuiFlexItem, | ||
| } from '@elastic/eui'; | ||
|
|
||
|
|
||
| export const EnableModelPlotCallout = ({ message }) => ( | ||
| <Fragment> | ||
| <EuiFlexGroup direction="column"> | ||
| <EuiFlexItem grow={false}> | ||
| <EuiCallOut | ||
| title={'Proceed with caution!'} | ||
| color="warning" | ||
| iconType="help" | ||
| > | ||
| <p> | ||
| {message} | ||
| </p> | ||
| </EuiCallOut> | ||
| </EuiFlexItem> | ||
| </EuiFlexGroup> | ||
| </Fragment> | ||
| ); | ||
|
|
||
| EnableModelPlotCallout.propTypes = { | ||
| message: PropTypes.string.isRequired, | ||
| }; | ||
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/ml/public/jobs/new_job/advanced/enable_model_plot_callout/index.js
This file contains hidden or 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; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
|
|
||
| import './enable_model_plot_callout_directive.js'; |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably have a unit test for this component, even though it is fairly simple.