-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] DF Analytics: Ensure creation flyout can be opened when no jobs exist #50417
Merged
alvarezmelissa87
merged 2 commits into
elastic:master
from
alvarezmelissa87:ml-create-first-analytics-job-button
Nov 14, 2019
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
32 changes: 32 additions & 0 deletions
32
...management/components/create_analytics_flyout_wrapper/create_analytics_flyout_wrapper.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,32 @@ | ||||||
/* | ||||||
* 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, { Fragment, FC } from 'react'; | ||||||
|
||||||
import { CreateAnalyticsFormProps } from '../../hooks/use_create_analytics_form'; | ||||||
|
||||||
import { CreateAnalyticsAdvancedEditor } from '../create_analytics_advanced_editor'; | ||||||
import { CreateAnalyticsForm } from '../create_analytics_form'; | ||||||
import { CreateAnalyticsFlyout } from '../create_analytics_flyout'; | ||||||
|
||||||
export const CreateAnalyticsFlyoutWrapper: FC<CreateAnalyticsFormProps> = props => { | ||||||
const { isAdvancedEditorEnabled, isModalVisible } = props.state; | ||||||
|
||||||
if (isModalVisible === false) { | ||||||
return null; | ||||||
} | ||||||
|
||||||
return ( | ||||||
<Fragment> | ||||||
{isModalVisible && ( | ||||||
<CreateAnalyticsFlyout {...props}> | ||||||
{isAdvancedEditorEnabled === false && <CreateAnalyticsForm {...props} />} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this piece, I think it's fine to be explicit about what value is expected. |
||||||
{isAdvancedEditorEnabled === true && <CreateAnalyticsAdvancedEditor {...props} />} | ||||||
</CreateAnalyticsFlyout> | ||||||
)} | ||||||
</Fragment> | ||||||
); | ||||||
}; |
7 changes: 7 additions & 0 deletions
7
..._analytics/pages/analytics_management/components/create_analytics_flyout_wrapper/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,7 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { CreateAnalyticsFlyoutWrapper } from './create_analytics_flyout_wrapper'; |
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.
this check is redundant, you already return null 🙂 for
false
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.
Fragment
can be omitted as well