-
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] Transforms: NP ui/imports migration #58469
[ML] Transforms: NP ui/imports migration #58469
Conversation
Pinging @elastic/ml-ui (:ml) |
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.
Great work! Code looks good to me. I really like how you import doc links through hooks instead of a documentation service! We'll get inspired by it in our apps 😊
@@ -5,8 +5,9 @@ | |||
*/ | |||
|
|||
import React, { useContext, FC } from 'react'; | |||
import { unmountComponentAtNode } from 'react-dom'; |
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.
nit: you could add the import inside the line below
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.
Fixed in 299f912.
@@ -29,9 +29,9 @@ export function getDiscoverUrl(indexPatternId: string, baseUrl: string): string | |||
} | |||
|
|||
export const RedirectToTransformManagement: FC = () => ( | |||
<Redirect from={`${CLIENT_BASE_PATH}`} to={`${CLIENT_BASE_PATH}/${SECTION_SLUG.HOME}`} /> | |||
<Redirect from={`${CLIENT_BASE_PATH}`} to={`${CLIENT_BASE_PATH}${SECTION_SLUG.HOME}`} /> |
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.
nit: as there is not string character, it could simply be
from={CLIENT_BASE_PATH} to={CLIENT_BASE_PATH + SECTION_SLUG.HOME}
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.
Fixed in 299f912.
message, | ||
} = error.data; | ||
const errorMessage = | ||
error?.message !== undefined ? error.message : JSON.stringify(error, null, 2); |
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.
nit: could be written error?.message ?? JSON.stringify(error, null, 2);
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.
Fixed in 299f912.
text: toMountPoint(<ToastNotificationText text={e} />), | ||
text: toMountPoint( | ||
<ToastNotificationText | ||
text={e.message !== undefined ? e.message : JSON.stringify(e, null, 2)} |
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.
nit: could be written e.message ?? JSON.stringify(e, null, 2)
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.
Fixed in 299f912.
@joshdover any hints how I could migrate away from |
@@ -61,7 +58,7 @@ export const KibanaProvider: FC<Props> = ({ savedObjectId, children }) => { | |||
const kibanaContext: InitializedKibanaContextValue = { | |||
indexPatterns, | |||
initialized: true, | |||
kbnBaseUrl: npStart.core.injectedMetadata.getBasePath(), | |||
kbnBaseUrl: appDeps.core.injectedMetadata.getBasePath(), |
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.
basePath
can be got from http
, i believe injectedMetadata
is deprecated.
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.
Fixed in 5757826.
@@ -124,6 +103,7 @@ export function createPublicShim(): { core: Core; plugins: Plugins } { | |||
uiMetric: { | |||
createUiStatsReporter, | |||
}, | |||
xsrfToken: chrome.getXsrfToken(), |
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.
ML will soon be replacing our http service with kibana's core http client to remove the need of this token.
let DependenciesContext: React.Context<AppDependencies>; | ||
|
||
const setAppDependencies = (deps: AppDependencies) => { | ||
const legacyBasePath = { |
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.
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.
Fixed in aa8535b.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
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.
Code LGTM
- Migrates ui/* imports to NP. - Uses direct React mounting instead of Angular. - Service Cleanup.
Summary
Part of #50902.
ui/*
imports to NP.Checklist
Delete any items that are not applicable to this PR.
For maintainers