[ML] Adds Create a data view button to index or saved search selector in ML pages and Transforms management#166668
Conversation
d9076f6 to
3a5f171
Compare
|
Could this be added for the 'Create job' workflow for Data frame analytics? |
Yes! Updated here Screen.Recording.2023-09-25.at.11.23.05.mov |
I think this behavior is fine. The user gets the option in the wizard to create a data view for the results index, and if that is created, the results view will be fully available even without a data view for the source index. On cloning, a clear error is displayed to create the data view if one does not already exist. |
|
Pinging @elastic/ml-ui (:ml) |
| }) => { | ||
| const { dataViewEditor } = useMlKibana().services; | ||
| const canEditDataView = Boolean(dataViewEditor?.userPermissions.editDataView()); | ||
| const closeDataViewEditor = useRef<() => void | undefined>(); |
There was a problem hiding this comment.
This is currently not being used.
Looking at other examples, it should be used to close the editor when unmounting the component.
| /> | ||
| </EuiButton> | ||
| ) : ( | ||
| <Fragment /> |
There was a problem hiding this comment.
Unless there is a specific reason for this, normally we just return null
| import type { ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; | ||
| import type { SavedSearchPublicPluginStart } from '@kbn/saved-search-plugin/public'; | ||
| import type { PluginInitializerContext } from '@kbn/core/public'; | ||
| import { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; |
There was a problem hiding this comment.
| import { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; | |
| import type { DataViewEditorStart } from '@kbn/data-view-editor-plugin/public'; |
| const dataViewEditorRef = useRef<() => void | undefined>(); | ||
|
|
||
| const createNewDataView = useCallback(() => { | ||
| dataViewEditorRef.current = dataViewEditor?.openEditor({ |
There was a problem hiding this comment.
If this ref isn't going to be used to close the editor when navigating away, then I don't think we need the ref at all.
However, I think it would be good to use the ref as it was initially intended to close the editor when this button component is destroyed.
There was a problem hiding this comment.
Thanks for catching that, updated here 2a655ac (#166668) so it closes upon unmounting/ navigating away.
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: cc @qn895 |
Summary
This PR add Create a data view button to index or saved search selector in ML pages including Index Data Visualizer, AIOps pages, and Data Frame Analytics.
ML pages:
Screen.Recording.2023-09-18.at.15.41.35.mov
Screen.Recording.2023-09-25.at.11.23.05.mov
Transforms
Screen.Recording.2023-09-20.at.09.04.40.mov
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers