-
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
[EuiProvider/ResponseOps] Remove usage of deprecated React rendering utilities #180098
[EuiProvider/ResponseOps] Remove usage of deprecated React rendering utilities #180098
Conversation
6584509
to
df6aa4d
Compare
@@ -114,30 +108,28 @@ export const ManagementApp = ({ | |||
}; | |||
|
|||
return ( | |||
<RedirectAppLinks coreStart={dependencies.coreStart}> | |||
<I18nProvider> | |||
<KibanaRenderContextProvider i18n={coreStart.i18n} theme={coreStart.theme}> |
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.
I placed KibanaRenderContextProvider
above other context providers, in all changes, for consistency
@@ -93,16 +93,12 @@ export const renderApp = ({ | |||
}} | |||
> | |||
<Router history={history}> | |||
<EuiThemeProvider darkMode={isDarkMode}> | |||
<i18nCore.Context> |
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.
The i18n context provider is not explicitly needed since KibnaRenderContextProvider provides it
@@ -30,16 +29,15 @@ const ActionWrapperWithContext: React.FC<PropsWithChildren<Props>> = ({ | |||
caseContextProps, | |||
currentAppId, | |||
}) => { | |||
const { application } = useKibana().services; | |||
const isDarkTheme = useIsDarkTheme(); |
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.
useIsDarkTheme
seems to just be passing through the dark theme setting from core, which isn't explicitly needed with KibanaRenderContextProvider
|
||
setDataViewsService(dataViews); | ||
return ( | ||
<I18nProvider> |
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.
The i18n context provider is not explicitly needed since KibnaRenderContextProvider provides it
@@ -29,23 +27,18 @@ export const renderApp = (deps: TriggersAndActionsUiServices) => { | |||
}; | |||
|
|||
export const App = ({ deps }: { deps: TriggersAndActionsUiServices }) => { | |||
const { dataViews, theme, theme$ } = deps; | |||
const isDarkMode = theme.getTheme().darkMode; |
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 is just passing through the dark mode setting from Core, which isn't explicitly needed with KibanaRenderContextProvider
|
||
const sectionsRegex = sections.join('|'); | ||
setDataViewsService(dataViews); | ||
return ( | ||
<I18nProvider> |
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.
The i18n context provider is not explicitly needed since KibnaRenderContextProvider provides it
return render(<ModalInspectQuery {...defaultProps} />, { | ||
wrapper: ({ children }) => <EuiThemeProvider>{children}</EuiThemeProvider>, | ||
wrapper: ({ children }) => ( | ||
<KibanaThemeProvider theme={theme}>{children}</KibanaThemeProvider> |
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.
Not using KibanaRenderContextProvider
here since this is a test file
39699cf
to
95376ef
Compare
4d5e7d0
to
5c69f2c
Compare
/ci |
bulkDisableRules, | ||
bulkEnableRules, | ||
bulkDeleteRules, | ||
snoozeRule, | ||
unsnoozeRule, |
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.
removed unused variables to eliminate warnings seen in the editor
cbe06c8
to
2578f8d
Compare
@@ -76,8 +69,8 @@ export const getMockApplications$ = () => | |||
|
|||
export const getMockCaseUiActionProps = () => { | |||
const core = { | |||
...coreStart, |
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 was done to add i18n
to the context
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
References to deprecated APIs
History
To update your PR or re-run it, just comment with: |
@@ -106,7 +106,8 @@ const getErrorMessage = (error: Error | ServerError): string => { | |||
|
|||
export const useCasesToast = () => { | |||
const { appId } = useApplication(); | |||
const { getUrlForApp, navigateToUrl } = useKibana().services.application; | |||
const { application, i18n, theme } = useKibana().services; |
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.
Are these services available to all plugins? I am asking because Cases are used in a lot of places across Kibana.
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.
Nice, thanks!
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.
Changes in Security plugin tests LGTM, thanks!
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.
Management changes LGTM
…180521) ## Summary Partially addresses elastic/kibana-team#805 Follows #180098 These changes come up from searching in the code and finding where certain kinds of deprecated AppEx-SharedUX modules are imported. **Reviewers: Please interact with critical paths through the UI components touched in this PR, ESPECIALLY in terms of testing dark mode and i18n.** This focuses on code within Response Ops. <img width="1107" alt="image" src="https://github.com/elastic/kibana/assets/908371/c0d2ce08-ac35-45a7-8192-0b2256fceb0e"> ### Checklist Delete any items that are not applicable to this PR. - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: kibanamachine <[email protected]>
Summary
Partially addresses https://github.com/elastic/kibana-team/issues/805
Follows #180003
These changes come up from searching in the code and finding where certain kinds of deprecated AppEx-SharedUX modules are imported. Reviewers: Please interact with critical paths through the UI components touched in this PR, ESPECIALLY in terms of testing dark mode and i18n.
theme
field fromManagementAppMountParams
Checklist
Delete any items that are not applicable to this PR.