Skip to content
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

[Alerting][UI] Using KibanaThemeProvider #121415

Merged
merged 2 commits into from
Dec 16, 2021

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented Dec 16, 2021

Resolves #118880

Summary

Wrapping triggers_actions_ui app render with KibanaThemeProvider. KibanaThemeProvider wraps EuiThemeProvider so removed usage of EuiThemeProvider

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
triggersActionsUi 332 330 -2

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
triggersActionsUi 236 237 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
triggersActionsUi 780.8KB 780.3KB -513.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
triggersActionsUi 53.9KB 53.8KB -33.0B
Unknown metric groups

API count

id before after diff
triggersActionsUi 245 246 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ymao1

@ymao1 ymao1 added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.1.0 labels Dec 16, 2021
@ymao1 ymao1 marked this pull request as ready for review December 16, 2021 16:49
@ymao1 ymao1 requested a review from a team as a code owner December 16, 2021 16:49
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@chrisronline chrisronline left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ymao1 ymao1 merged commit 825e35d into elastic:main Dec 16, 2021
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Dec 16, 2021
@claudiopro
Copy link
Contributor

claudiopro commented Dec 21, 2021

KibanaThemeProvider wraps EuiThemeProvider (1) so removed usage of EuiThemeProvider (2)

Not quite, unfortunately! The two context providers are different, despite they have the same name. EuiThemeProvider (1) comes from @elastic/eui:

import { EuiThemeProvider } from '@elastic/eui';

while EuiThemeProvider (2), the one in use in Triggers Actions UI ,was defined here:

const EuiThemeProvider = <
OuterTheme extends styledComponents.DefaultTheme = styledComponents.DefaultTheme
>({
darkMode = false,
...otherProps
}: Omit<ThemeProviderProps<OuterTheme, OuterTheme & EuiTheme>, 'theme'> & {
darkMode?: boolean;
}) => (
<ThemeProvider
{...otherProps}
theme={(outerTheme?: OuterTheme) => ({
...outerTheme,
eui: darkMode ? euiDarkVars : euiLightVars,
darkMode,
})}
/>
);

export { css, euiStyled, EuiThemeProvider, createGlobalStyle, keyframes, withTheme };

cc @pgayvallet FYI this may be misleading

@pgayvallet
Copy link
Contributor

Not quite, unfortunately! The two context providers are different

Well well... That's the first time I'm hearing about this ThemeProvider used for styled-component. But that's right, this one is not the EUI's one, so if it was previously used by apps, it needs to be preserved in addition to KibanaThemeProvider.

Thanks for the heads up

@ymao1 ymao1 deleted the alerting/kibana-theme-provider branch January 27, 2022 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Alerting] Adapt all existing applications to use the new KibanaThemeProvider
8 participants