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

[Cloud Security] Add description list to findings flyout and copy buttons #184054

Merged
merged 8 commits into from
Jun 9, 2024

Conversation

JordanSh
Copy link
Contributor

Summary

Part of https://github.com/elastic/security-team/issues/9520 quick wins task

Screen.Recording.2024-05-22.at.21.14.52.mov

I also wanted to implement the ellipsis as shown in this figma but i tried various method like using <EuiTextTruncate />, using `className="eui-textTruncate", and just plain custom css for ellipsis. all of them are just not working very good with the icon at the end combined with the inline display. its probably possible but after trying many combinations i've decided that its not worth the time investment at the moment, if anyone has any suggestions i'd be hear of course!

@JordanSh JordanSh added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Team:Cloud Security Cloud Security team related csp: quick win cloud-security label: tagging issues which are relatively small in effort and lowered in priority labels May 22, 2024
@JordanSh JordanSh self-assigned this May 22, 2024
@JordanSh JordanSh marked this pull request as ready for review May 23, 2024 12:58
@JordanSh JordanSh requested a review from a team as a code owner May 23, 2024 12:58
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

@JordanSh
Copy link
Contributor Author

@einatjacoby , as we agreed

`}
>
<CspInlineDescriptionList
testId={FINDINGS_VULNERABILITY_FLYOUT_DESCRIPTION_LIST}
Copy link
Contributor

Choose a reason for hiding this comment

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

this test_id is imported from vulnerabilities, I think we should use a test id different for misconfigurations

Copy link
Contributor

@opauloh opauloh left a comment

Choose a reason for hiding this comment

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

overall looks good just proposed some small changes

[
finding.resource?.id && {
title: i18n.translate(
'xpack.csp.vulnerabilities.vulnerabilitiesFindingFlyout.flyoutDescriptionList.resourceId',
Copy link
Contributor

Choose a reason for hiding this comment

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

the translations are using vulnerability identifiers, think we can use the identifiers that were being used before, i.e
xpack.csp.findings.findingsFlyout.overviewTab.resourceIdTitle

} from '@elastic/eui';
import { assertNever } from '@kbn/std';
import { i18n } from '@kbn/i18n';
import type { HttpSetup } from '@kbn/core/public';
import { generatePath } from 'react-router-dom';
import { css } from '@emotion/react/dist/emotion-react.cjs';
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
import { css } from '@emotion/react/dist/emotion-react.cjs';
import { css } from '@emotion/react';

@JordanSh
Copy link
Contributor Author

JordanSh commented Jun 5, 2024

Thanks @opauloh, all review comments were fixed

@JordanSh JordanSh requested a review from opauloh June 5, 2024 12:11
@JordanSh JordanSh enabled auto-merge (squash) June 5, 2024 13:37
Copy link
Contributor

@seanrathier seanrathier left a comment

Choose a reason for hiding this comment

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

Just a single question if the change is showing a React key error in the console.

I had to make a similar change in the past and found that Flex was the issue, setting it to flex: 1 resolved it.

.long-and-truncated {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

title: `${item.title}:`,
description:
typeof item.description === 'string' ? (
<span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this showing a React key warning?

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'm not sure I follow Sean, is this regarding the CSS which i ended up not implementing in the end? let's take this offline so i can understand better

@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
cloudSecurityPosture 449.5KB 450.1KB +657.0B

History

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

cc @JordanSh

@JordanSh JordanSh merged commit 2eaaa32 into elastic:main Jun 9, 2024
17 checks passed
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Jun 13, 2024
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 csp: quick win cloud-security label: tagging issues which are relatively small in effort and lowered in priority release_note:skip Skip the PR/issue when compiling release notes Team:Cloud Security Cloud Security team related v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants