-
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
[ILM] Remove euiThemeVars and remapping colors for Borealis #204449
Changes from 9 commits
870da0a
9190564
d9a661d
84368d5
799f2e7
0332c39
d68169e
b2c0747
94476dd
5565d2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,21 @@ | |
* 2.0. | ||
*/ | ||
|
||
/** @jsx jsx */ | ||
// Needed for for testing out the css prop feature. See: https://emotion.sh/docs/css-prop#jsx-pragma | ||
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. After adding emotion css, the affected snapshots displayed messages like this one:
This was only happening in test, not in the final html. Following emotion docs and adding 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. If you have to set the JSX pragma this could indicate that you might be missing a required Emotion babel preset for using the |
||
import { css, jsx } from '@emotion/react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
|
||
import React, { FunctionComponent, memo } from 'react'; | ||
import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiText, EuiIconTip } from '@elastic/eui'; | ||
import { | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiTitle, | ||
EuiText, | ||
EuiIconTip, | ||
useEuiTheme, | ||
} from '@elastic/eui'; | ||
|
||
import { useKibana } from '../../../../../shared_imports'; | ||
|
||
|
@@ -135,6 +145,17 @@ export const Timeline: FunctionComponent<Props> = memo( | |
: undefined, | ||
}; | ||
|
||
const { euiTheme } = useEuiTheme(); | ||
|
||
const isBorealis = euiTheme.themeName === 'EUI_THEME_BOREALIS'; | ||
|
||
const timelineIconColors = { | ||
hot: isBorealis ? euiTheme.colors.vis.euiColorVis6 : euiTheme.colors.vis.euiColorVis9, | ||
warm: isBorealis ? euiTheme.colors.vis.euiColorVis9 : euiTheme.colors.vis.euiColorVis5, | ||
cold: isBorealis ? euiTheme.colors.vis.euiColorVis2 : euiTheme.colors.vis.euiColorVis1, | ||
frozen: euiTheme.colors.vis.euiColorVis4, | ||
}; | ||
|
||
const phaseAgeInMilliseconds = calculateRelativeFromAbsoluteMilliseconds(absoluteTimings); | ||
|
||
const widths = calculateWidths(phaseAgeInMilliseconds); | ||
|
@@ -188,7 +209,12 @@ export const Timeline: FunctionComponent<Props> = memo( | |
data-test-subj="ilmTimelinePhase-hot" | ||
className="ilmTimeline__phasesContainer__phase ilmTimeline__hotPhase" | ||
> | ||
<div className="ilmTimeline__colorBar ilmTimeline__hotPhase__colorBar" /> | ||
<div | ||
className={`ilmTimeline__colorBar `} | ||
css={css` | ||
background-color: ${timelineIconColors.hot}; | ||
`} | ||
/> | ||
<TimelinePhaseText | ||
phaseName={i18nTexts.hotPhase} | ||
durationInPhase={getDurationInPhaseContent('hot')} | ||
|
@@ -199,7 +225,12 @@ export const Timeline: FunctionComponent<Props> = memo( | |
data-test-subj="ilmTimelinePhase-warm" | ||
className="ilmTimeline__phasesContainer__phase ilmTimeline__warmPhase" | ||
> | ||
<div className="ilmTimeline__colorBar ilmTimeline__warmPhase__colorBar" /> | ||
<div | ||
className={`ilmTimeline__colorBar`} | ||
css={css` | ||
background-color: ${timelineIconColors.warm}; | ||
`} | ||
/> | ||
<TimelinePhaseText | ||
phaseName={i18nTexts.warmPhase} | ||
durationInPhase={getDurationInPhaseContent('warm')} | ||
|
@@ -211,7 +242,12 @@ export const Timeline: FunctionComponent<Props> = memo( | |
data-test-subj="ilmTimelinePhase-cold" | ||
className="ilmTimeline__phasesContainer__phase ilmTimeline__coldPhase" | ||
> | ||
<div className="ilmTimeline__colorBar ilmTimeline__coldPhase__colorBar" /> | ||
<div | ||
className={`ilmTimeline__colorBar`} | ||
css={css` | ||
background-color: ${timelineIconColors.cold}; | ||
`} | ||
/> | ||
<TimelinePhaseText | ||
phaseName={i18nTexts.coldPhase} | ||
durationInPhase={getDurationInPhaseContent('cold')} | ||
|
@@ -223,7 +259,12 @@ export const Timeline: FunctionComponent<Props> = memo( | |
data-test-subj="ilmTimelinePhase-frozen" | ||
className="ilmTimeline__phasesContainer__phase ilmTimeline__frozenPhase" | ||
> | ||
<div className="ilmTimeline__colorBar ilmTimeline__frozenPhase__colorBar" /> | ||
<div | ||
className="ilmTimeline__colorBar" | ||
css={css` | ||
background-color: ${timelineIconColors.frozen}; | ||
`} | ||
/> | ||
<TimelinePhaseText | ||
phaseName={i18nTexts.frozenPhase} | ||
durationInPhase={getDurationInPhaseContent('frozen')} | ||
|
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.
ℹ️ We're introducing the
behindText
vis colors to the euiTheme (PR). This will land in Kibana with this weeks release.As we want to remove the JSON token usages from client (react) code, it would be great if you could either update if the release is faster than this PR or do a follow-up to update 🙏