[ML] Add validation of label and time range when editing custom URLs#21960
Merged
peteharverson merged 2 commits intoelastic:masterfrom Aug 15, 2018
Merged
[ML] Add validation of label and time range when editing custom URLs#21960peteharverson merged 2 commits intoelastic:masterfrom
peteharverson merged 2 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/ml-ui |
Contributor
💔 Build Failed |
jgowdyelastic
approved these changes
Aug 14, 2018
Member
jgowdyelastic
left a comment
There was a problem hiding this comment.
Added a couple of nit-picks, but otherwise LGTM
| jobModelMemoryLimitValidationError, | ||
| jobGroupsValidationError, | ||
| valid, | ||
| validJobDetails, |
Member
There was a problem hiding this comment.
this variable name makes it sound like a filtered list of valid job details.
perhaps something like jobDetailsValid or isJobDetailsValid would be clearer
| const validJobCustomUrls = isValidCustomUrls(jobCustomUrls); | ||
| this.setState({ | ||
| jobCustomUrls, | ||
| validJobCustomUrls, |
Member
There was a problem hiding this comment.
same as issue with validJobDetails
| @@ -96,3 +100,24 @@ function buildKibanaUrl(urlConfig, record) { | |||
| return tokenValue !== null ? tokenValue : match; | |||
Member
There was a problem hiding this comment.
i know this is old code, but this condition should be wrapped in parentheses.
return (tokenValue !== null) ? tokenValue : match;
Contributor
💚 Build Succeeded |
peteharverson
added a commit
to peteharverson/kibana
that referenced
this pull request
Aug 16, 2018
…lastic#21960) * [ML] Add validation of label and time range when editing custom URLs * [ML] Edits to custom URL validation following review
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds validation to the label and time range when editing custom URLs in the Jobs List edit job flyout.
Also adds a 'Test' button to the section for creating new URLs, so that the settings can be tested before hitting the 'Add' button (fixes #18211)
Also adds in units tests for
ml/public/util/custom_url_utils.js.PR refactors
ml/public/jobs/components/custom_url_editor/editor.jsandml/public/jobs/components/custom_url_editor/list.jsto convert them into classes, to avoid having to pass properties to all the event handlers, as raised in a review of #21094.