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

[ResponseOps][UI] - EUI Visual Refresh integration and QA #204352

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

georgianaonoleata1904
Copy link
Contributor

@georgianaonoleata1904 georgianaonoleata1904 commented Dec 16, 2024

Summary

Closes: #202551
Closes: #202550
Closes: #202549
Closes: #202548

Meta: #202547

Summary

  • Buttons with success color have been updated to primary
  • Replaced "textSuccess" to "successText"
    example: Edit connector -> Save button
Screenshot 2024-12-17 at 15 32 14
  • All references to renamed tokens have been updated to use the new token name
  • Replaced the color utility functions with EUI color tokens as they will be deprecated
  • All usage of color palette tokens and functions now pull from the theme
  • changed severity colors in Borealis

Amsterdam:
Screenshot 2024-12-18 at 11 50 51

Borealis:
Screenshot 2024-12-18 at 11 50 06

…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]>
@cnasikas cnasikas added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v9.0.0 EUI Visual Refresh labels Dec 16, 2024
@@ -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">
Copy link
Contributor

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' }}
Copy link
Contributor

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">
Copy link
Contributor

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?

Copy link
Contributor Author

@georgianaonoleata1904 georgianaonoleata1904 Dec 17, 2024

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:
Screenshot 2024-12-17 at 10 33 54

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.

Copy link
Contributor

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" /> ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this would work.

const { euiTheme } = useEuiTheme();

const severityData = {
low: { color: euiTheme.colors.vis.euiColorVis0, label: LOW },
Copy link
Contributor

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)

image

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

Copy link
Contributor

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.

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

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 and colors.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 😊

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:

Screenshot 2024-12-17 at 13 00 30

Copy link
Member

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.

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.

Copy link
Member

@cnasikas cnasikas Dec 18, 2024

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?

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?

Copy link
Contributor

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};
Copy link
Contributor

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,
Copy link
Member

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)?

Copy link
Contributor

@mgadewoll mgadewoll Dec 17, 2024

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.

Copy link
Member

Choose a reason for hiding this comment

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

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 👍

Copy link
Contributor

@andreadelrio andreadelrio Dec 17, 2024

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.

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.

@georgianaonoleata1904 georgianaonoleata1904 marked this pull request as ready for review December 17, 2024 13:36
@georgianaonoleata1904 georgianaonoleata1904 requested a review from a team as a code owner December 17, 2024 13:36
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Copy link
Contributor

@mgadewoll mgadewoll left a 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>;
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, i ll update!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
alerting 100.3KB 100.1KB -235.0B
cases 491.2KB 491.4KB +249.0B
cloudSecurityPosture 503.0KB 503.0KB +8.0B
observability 480.8KB 480.8KB -30.0B
securitySolution 21.4MB 21.4MB -635.0B
stackConnectors 660.5KB 660.6KB +114.0B
triggersActionsUi 1.7MB 1.7MB +228.0B
total -301.0B

Page load bundle

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

id before after diff
alerting 25.6KB 25.6KB -54.0B
cases 160.0KB 159.9KB -54.0B
stackConnectors 59.0KB 58.9KB -54.0B
triggersActionsUi 127.1KB 127.1KB +26.0B
total -136.0B

History

cc @georgianaonoleata1904

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 EUI Visual Refresh release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v9.0.0
Projects
None yet
8 participants