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

[Observability][SecuritySolution] Fix to prevent observability style conflict in flyout across plugins #138091

Merged
merged 3 commits into from
Aug 10, 2022

Conversation

logeekal
Copy link
Contributor

@logeekal logeekal commented Aug 4, 2022

Fixes #137043

Problem & Fix

Hello @elastic/observability-ui & @elastic/security-threat-hunting-investigations team,

Code below was creating conflict with the styles of the Flyout components in Security Solution -> Alerts since, it only uses EUI standard classes. I think it could easily conflict with styles of other plugins as well. For more details please check the bug mentioned above.

.euiFlyout,
.euiCollapsibleNav {
top: $fullscreenFlyoutTop;
height: calc(100% - #{$fullscreenFlyoutTop});

I could not find any observability specific class tokens so I have taken a liberty to add one. Please feel free to suggest to push any change that you may seem correct.

Suggestion

Ideally, I think it will be better if there a common wrapper div section around observability pages that can have an oblt class token and this way all the styles can be specific to observability plugin.

This model can be applied to all the plugins for style segregation.

Caveats

This error only comes to light when user has visited both observability plugin and security solution plugin. This makes the situation difficult to identify and test. There is saperate github issue : #138102 to resolve this and you can contribute there if you have anything to add regarding how styles are loaded in kibana.

@logeekal logeekal added the backport:prev-major Backport to (8.x, 8.15) the previous major branch and all later branches still in development label Aug 4, 2022
@logeekal logeekal requested review from a team August 4, 2022 10:21
@logeekal logeekal added backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) and removed backport:prev-major Backport to (8.x, 8.15) the previous major branch and all later branches still in development labels Aug 4, 2022
@logeekal logeekal marked this pull request as ready for review August 4, 2022 10:36
@logeekal logeekal requested review from a team as code owners August 4, 2022 10:36
@logeekal logeekal added Team:Observability Team label for Observability Team (for things that are handled across all of observability) Team:Threat Hunting:Investigations Security Solution Investigations Team labels Aug 4, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/unified-observability (Team:Observability)

@@ -45,7 +45,12 @@ export function AlertsFlyout({
}

return (
<EuiFlyout onClose={onClose} size="s" data-test-subj="alertsFlyout">
<EuiFlyout
className="oblt__alert--flyout oblt__flyout"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is oblt__alert--flyout used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I will remove it. I started with this and then added more generic oblt__flyout, but forgot to remove this.

Comment on lines +7 to 8
.euiFlyout.oblt__flyout,
.euiCollapsibleNav {
Copy link
Contributor

Choose a reason for hiding this comment

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

It might make sense to scope euiCollapsibleNav to oblt__flyout as well, wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought so as well but I could not find any instance of EuiCollapsibleNav being used in Observability so I left it alone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay I found that EuiCollapsible is the left sidebar collapsible Menu and this CSS applies to Collapsible menu only and only when Data grid is full screen. But when datagrid is full screen, there is no way to open the collapsible menu. See below screenshot.

So, I guess it will be okay, we do not touch it. because I delete .euiCollapsibleNav from here, not sure what will break.

image

@fkanout fkanout self-requested a review August 4, 2022 13:59
Copy link
Contributor

@fkanout fkanout left a comment

Choose a reason for hiding this comment

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

Actionable Observability changes LGTM. Tested locally and the flyout worked as expected.

@logeekal logeekal added the v8.5.0 label Aug 4, 2022
@logeekal logeekal removed the request for review from a team August 9, 2022 10:06
@kibana-ci
Copy link
Collaborator

💚 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
observability 504.5KB 504.6KB +76.0B

History

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

Copy link
Member

@jasonrhodes jasonrhodes left a comment

Choose a reason for hiding this comment

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

Hmm, it seems to me that for localized styles we should be using something other than hand-rolled class names and relying on the CSS cascade. Let me check with our design team to see how we usually handle this and then get back to you ASAP.

@logeekal
Copy link
Contributor Author

Thanks @jasonrhodes for looking into it.

Copy link
Member

@jasonrhodes jasonrhodes left a comment

Choose a reason for hiding this comment

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

OK so I've asked around and I think we need to remove these global styles altogether and replace them with something more localized. That said, to unblock you all, I think we can merge the changes as-is and then file a follow up ticket to replace them (with emotion syntax, likely).

Since @fkanout has already approved it from the perspective of the @elastic/actionable-observability team (which owns the alerts page), I'll approve too.

Thanks for your patience!

@logeekal
Copy link
Contributor Author

Great. Thank you.. emotion makes sense to modularize styles.

Do you know who can approve on behalf of @elastic/observability-design as it is being shown as the code owner?

@logeekal logeekal enabled auto-merge (squash) August 10, 2022 14:52
Copy link
Contributor

@formgeist formgeist left a comment

Choose a reason for hiding this comment

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

LGTM

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Aug 10, 2022
…conflict in flyout across plugins (elastic#138091)

* fix to prevent style conflict in flyouts from diff. plugins

* remove unnecessary class token

(cherry picked from commit 3aa0599)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Aug 10, 2022
…conflict in flyout across plugins (elastic#138091) (elastic#138533)

* fix to prevent style conflict in flyouts from diff. plugins

* remove unnecessary class token

(cherry picked from commit 3aa0599)

Co-authored-by: Jatin Kathuria <jtn.kathuria@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Observability Team label for Observability Team (for things that are handled across all of observability) Team:Threat Hunting:Investigations Security Solution Investigations Team v8.4.0 v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security Solution] UI breaks when click on full screen icon under Timeline
8 participants