-
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
[Security Solution] Asset criticality UI #173512
Conversation
adding footer btns to the modal improving tests
using react-query
8374236
to
6fa437d
Compare
6fa437d
to
1532e07
Compare
tags: ['@ess', '@serverless'], | ||
env: { | ||
ftrConfig: { | ||
enableExperimental: ['entityAnalyticsAssetCriticalityEnabled'], |
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.
Quick questions: I noticed that you enabled entityAnalyticsAssetCriticalityEnabled
on Serverless and ESS cypress configs files.
Do you also need to enable it here?
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.
Ah!
I'm not sure exactly.
I talked with Mark about this. I think this flag here is required for running in CI. But locally, it doesnt get picked up, so I need the other one. I'm not sure if the other one is required for CI or if it's just local
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.
As discussed in this thread, I think @elastic/security-engineering-productivity would prefer that you remove the configuration from the broader config files before merging this.
@@ -80,7 +82,9 @@ export const HostDetailsPanel: React.FC<HostDetailsProps> = React.memo( | |||
<StyledEuiFlyoutBody> | |||
<EuiSpacer size="m" /> | |||
<ExpandableHostDetailsPageLink hostName={hostName} /> | |||
<EuiSpacer size="m" /> | |||
<EuiHorizontalRule /> |
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.
Both EuiHorizontalRule
will render when asset criticality flag is disabled, or the user doesn't have the privileges.
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.
updated
@@ -43,7 +44,9 @@ export const UserDetailsFlyout = ({ | |||
<StyledEuiFlyoutBody> | |||
<EuiSpacer size="m" /> | |||
<ExpandableUserDetailsPageLink userName={userName} /> | |||
<EuiSpacer size="m" /> | |||
<EuiHorizontalRule /> |
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.
Updated
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 desk-tested the feature and it looks good to me.
Thank you for the amazing job 🔥 🚀
@elasticmachine merge upstream |
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.
LGTM for the Threat Hunting Investigations team
|
||
describe('Host flyout', () => { | ||
beforeEach(() => { | ||
expandFirstAlertHostFlyout(); |
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.
NIT: Why not moving this to the above beforeEach?
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.
ah, good one! Originally it was because there were other flyouts to test, but that got scrapped. I should move it yes, thanks!
cy.log('asset criticality update'); | ||
|
||
toggleAssetCriticalityModal(); | ||
cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT).should('be.visible').click(); |
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.
NIT: Wrap it into a meaningful task method. You don't need to check for the element to be visible, cypress makes sure the element is actionable before performing the click.
.contains('Important') | ||
.click(); | ||
|
||
cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SAVE_BTN).should('be.visible').click(); |
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.
NIT: Wrap it into a meaningful task method. You don't need to check for the element to be visible, cypress makes sure the element is actionable before performing the click.
toggleAssetCriticalityModal(); | ||
cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT).should('be.visible').click(); | ||
|
||
cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_MODAL_SELECT_OPTION) |
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.
NIT: Wrap it into a meaningful task method.
*/ | ||
export const toggleAssetCriticalityAccordion = () => { | ||
cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR).scrollIntoView(); | ||
cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_SELECTOR).should('be.visible').click(); |
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.
NIT: Cypress automatically performs different checks and actions before doing a click into an element when we are not forcing it as it is the case:
- Scroll the element into view.
- Ensure the element is not hidden.
- Ensure the element is not disabled.
- Ensure the element is not detached
- Ensure the element is not readonly.
- Ensure the element is not animating.
- Ensure the element is not covered
- Scroll the page if still covered by an element with fixed position.
So it should not be needed to do the the scrollIntoView
or the implicit check on visibility.
export const toggleAssetCriticalityModal = () => { | ||
toggleAssetCriticalityAccordion(); | ||
|
||
cy.get(HOST_DETAILS_FLYOUT_ASSET_CRITICALITY_BUTTON).should('be.visible').click(); |
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.
NIT: No need for checking that the element is visible before clicking on it.
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 left some nit comments that would be great to follow up when you have the chance :)
@MadameSheema Done! |
@elasticmachine merge upstream |
merge conflict between base and head |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @machadoum |
Summary
This PR adds the UI to assign asset criticality in the old host flyout. #8086
demoUI.mov
NOTE:
This introduces the changes from the closed PR #173011
Checklist
Delete any items that are not applicable to this PR.