-
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
[ResponseOps][UI] - EUI Visual Refresh integration and QA #204352
base: main
Are you sure you want to change the base?
Conversation
…203068) Closes #202548 Closes #202549 ## Summary - no changes were needed to the use of "success" color as it was used for semantic purpose - replaced "textSuccess" to "successText" --------- Co-authored-by: Elastic Machine <[email protected]>
…precated color variables (#203120) Closes #202550 ## Summary - All references to renamed tokens have been updated to use the new token name # previous color token -> new color token primaryText -> textPrimary accentText -> textAccent between this and textSuccess. warningText -> textWarning dangerText -> textDanger text -> textParagraph title -> textHeading subduedText -> textSubdued disabledText -> textDisabled successText -> textSuccess - replaced the color utility functions with EUI color tokens as they will be deprecated
…ate with theme changes (#203448) Closes #202551 ## Summary - All usage of color palette tokens and functions now pull from the theme JSON tokens are anything from: @elastic/eui/dist/eui_theme_light.json @elastic/eui/dist/eui_theme_dark.json import { euiThemeVars } from '@kbn/ui-theme' --------- Co-authored-by: kibanamachine <[email protected]>
@@ -198,12 +201,16 @@ const GroupingComponent = <T,>({ | |||
{groupCount > 0 && unitCount > 0 ? ( | |||
<EuiFlexGroup gutterSize="none"> | |||
<EuiFlexItem grow={false}> | |||
<span css={countCss} data-test-subj="unit-count"> | |||
<span css={countCss(euiTheme)} data-test-subj="unit-count"> |
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 don't need to pass the theme to the styles, this happens automatically. 🙂
css={countCss}
= css={({ euiTheme }) => countCss(euiTheme)}
<span | ||
css={countCss(euiTheme)} | ||
data-test-subj="group-count" | ||
style={{ borderRight: 'none' }} |
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 don't need to overwrite with inline styles, we can use css
styles:
css={[countCss, css`
border-right: none;
`]}
@@ -692,7 +691,7 @@ export const RuleActionsItem = (props: RuleActionsItemProps) => { | |||
} | |||
buttonContentClassName="eui-fullWidth" | |||
buttonContent={ | |||
<EuiPanel color="subdued" paddingSize="m"> | |||
<EuiPanel color={subdued} paddingSize="m"> |
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.
Question: Why do we need to override the default subdued
panel style?
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.
Since we had to replace useEuiBackgroundColor('subdued')
, the closes color I found was euiTheme.colors.lightestShade
, but if I hadn't also replaced the default subdued panel color, it would have looked something like this:
But still, it doesn't seem the best approach, since the colors supported by EuiPanel are the following: "transparent", "accent", "primary", "success", "warning", "danger", "subdued", "plain". I need to find a workaround.
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 see. Since you're adding a background color to the Accordion, would it work to use <EuiPanel color="transparent" />
?
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.
Yes, this would work.
x-pack/plugins/alerting/public/pages/maintenance_windows/components/page_header.tsx
Outdated
Show resolved
Hide resolved
const { euiTheme } = useEuiTheme(); | ||
|
||
const severityData = { | ||
low: { color: euiTheme.colors.vis.euiColorVis0, label: LOW }, |
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 vis colors have changed and don't directly map to similar colors (related conversation)
Since these are used as severity colors here, you likely want to ensure they are still using a specific color.
The severity color palette is still being worked on, but we can remap vis colors per theme.
I'm not sure who's the responsible designer to involve here for this code? cc @gvnmagni
We have two options here:
- use new tokens which mean the current Amsterdam colors change a bit (the main issue seems to be distinguishing high and critical)
- map severity colors per theme
Option 1
low: { color: euiTheme.colors.vis.euiColorVisSuccess0, label: LOW }
medium: { euiTheme.colors.vis.euiColorVisWarning0, label: MEDIUM }
high: { color: euiTheme.colors.vis.euiColorVisDanger1, label: CRITICAL }
critical: { color: euiTheme.colors.vis.euiColorVisDanger0, label: CRITICAL }
Severity level | previous value | Amsterdam | Borealis |
---|---|---|---|
low | #54B399 |
#209280 |
#24C292 |
medium | #D6BF57 |
#D6BF57 |
#FCD883 |
high | #DA8B45 |
#E7664C |
#FFC9C2 |
critical | #E7664C |
#CC5642 |
#F6726A |
Option 2
const { euiTheme } = useEuiTheme();
const { hasVisColorAdjustment } = euiTheme;
low: { color: hasVisColorAdjustment ? euiTheme.colors.vis.euiColorVis0 : euiTheme.colors.vis.euiColorVisSuccess0, label: LOW }
medium: { color: hasVisColorAdjustment ? euiTheme.colors.vis.euiColorVis5 : euiTheme.colors.vis.euiColorVisWarning0, label: MEDIUM }
high: { color: hasVisColorAdjustment ? euiTheme.colors.vis.euiColorVis7 : euiTheme.colors.vis.euiColorVisDanger1, label: CRITICAL }
critical: { color: hasVisColorAdjustment ? euiTheme.colors.vis.euiColorVis9 : euiTheme.colors.vis.euiColorVisDanger0, label: CRITICAL }
Severity level | previous value | Amsterdam | Borealis |
---|---|---|---|
low | #54B399 |
#54B399 |
#24C292 |
medium | #D6BF57 |
#D6BF57 |
#FCD883 |
high | #DA8B45 |
#DA8B45 |
#FFC9C2 |
critical | #E7664C |
#E7664C |
#F6726A |
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.
Hi @mgadewoll, thanks for the detailed suggestion here. @joana-cps is the designer in charge of this area of the product. I'm personally ok with either option. Will defer to @gvnmagni or @joana-cps.
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.
@joana-cps let's chat about this, I want to be sure I can support you but I need to understand a little bit better the 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.
Hi @mgadewoll, thanks very much for the detailed suggestion here, this was a topic that we spent some time discussing with the team (@georgianaonoleata1904 and @cnasikas) and we agreed on using this approach:
Severity level | previous value | Amsterdam | Borealis | Color token |
---|---|---|---|---|
low | #54B399 |
#00BFB3 |
#008A5E |
colors.success |
medium | #D6BF57 |
#FEC514 |
#FACB3D |
colors.warning |
high | #DA8B45 |
#F04E98 |
#BC1E70 |
colors.accent |
critical | #E7664C |
#BD271E |
#C61E25 |
colors.danger |
The main reasons:
- We tried both proposals but in Borealis
#FFC9C2
it's too light for a High Status - We use
colors.success
,colors.warning
andcolors.danger
in other ResponseOps pages, so we would like to have some consistency in our status - We use same color token for both themes
- The new severity colors change will have less impact since we are already using dark red/pink in higher status
We were missing an "orange" for the high status, and this was the best solution that we could find
Let me know what you think 😊
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.
ok, I got the chance to chat with Joana and I believe we reached a consensus.
From my perspective, I would not change anything in Amsterdam, while for Borealis I would proceed this way. We don't have yet all the tokens set up for our new Severity Color Palette (issue) but what we can do is to apply color primitives directly and eventually come back here introducing severity tokens as soon as they are ready.
Specifically, this would be the mapping of our levels in this case:
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.
@joana-cps Since we will use the hardcoded values, should we use the same in Borealis? The colors on your table seem to be different from the two themes.
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.
@cnasikas The idea is to keep Amsterdam as it is right now and just change the Borealis for the new ones.
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.
Ok! Is this a final decision? Could we all agree on this before @georgianaonoleata1904 does the implementation?
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.
@mgadewoll can you please confirm if you're ok with these changes?
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.
Yes, I agree. Let's keep Amsterdam as is and use the new ones for Borealis.
Fyi, we're introducing new tokens for severity colors. These will then replace these mappings, but it will be done as a follow-up.
@@ -19,7 +18,7 @@ const Stat = styled(EuiStat)` | |||
`; | |||
|
|||
const Divider = styled.div` | |||
border-right: 1px solid ${euiThemeVars.euiColorLightShade}; | |||
border-right: 1px solid ${(props) => props.theme.euiTheme.colors.lightShade}; |
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.
Let's update this to use a semantic border token:
border-right: ${euiTheme.border.thin};
color: isActive ? '#a8376a' : euiTheme.colors.subduedText, | ||
color: isActive | ||
? euiTheme.colors.textAccent | ||
: euiTheme.colors.textSubdued, | ||
backgroundColor: isActive ? 'rgba(240,78,152,0.2)' : euiTheme.colors.body, |
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.
@mgadewoll Should we also replace rgba(240,78,152,0.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.
Maybe, yes. Does it need the transparency or can it be a solid color?
Just looking at the code, I'd think it can become a solid color as this is a button. And based on button definitions it should then probably use euiTheme.colors.backgroundLightAccent
.
Edit: One note on that: This will change the color for current Amsterdam, so I'd advise to check if that change is ok.
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.
I reviewed it with @georgianaonoleata1904 and it looks good to me in Amsterdam and Borealis 👍
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.
@joana-cps Not blocking but looking at the code only, I'm curious why we are using a button here instead of EuiButton and why we're passing a custom color. Something to consider for later.
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.
yes good point @andreadelrio, I didn't look into the code, I just did a visual review.
Something to look into @georgianaonoleata1904 @cnasikas.
Pinging @elastic/response-ops (Team:ResponseOps) |
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 LGTM from EUI side
|
||
const { color, label } = severityData[severity]; | ||
|
||
return <EuiHealth color={color}>{label}</EuiHealth>; |
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.
data-test-subj
is missing here, i think that is why the tests are failing.
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.
Thanks, i ll update!
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
|
Summary
Closes: #202551
Closes: #202550
Closes: #202549
Closes: #202548
Meta: #202547
Summary
success
color have been updated toprimary
example: Edit connector -> Save button
Amsterdam:
Borealis: