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

[Backport 2.x] Adjust styling for Finding details flyout #382

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cypress/integration/3_alerts.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ describe('Alerts', () => {

// Check the rule details accordion for the expected values
cy.get('[data-test-subj="finding-details-flyout-rule-accordion-0"]').within(() => {
// Confirm the accordion button contains the expected text
// Confirm the accordion button contains the expected name
cy.get('[data-test-subj="finding-details-flyout-rule-accordion-button"]').contains(
'USB Device Plugged'
);

// Confirm the accordion button contains the expected severity
cy.get('[data-test-subj="finding-details-flyout-rule-accordion-button"]').contains(
'Severity: Low'
);
Expand Down
93 changes: 46 additions & 47 deletions public/pages/Findings/components/FindingDetailsFlyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
EuiFormRow,
EuiHorizontalRule,
EuiLink,
EuiPanel,
EuiSpacer,
EuiText,
EuiTitle,
Expand Down Expand Up @@ -111,6 +112,7 @@ export default class FindingDetailsFlyout extends Component<
<div key={key}>
<EuiAccordion
id={`${key}`}
buttonClassName="euiAccordionForm__button"
buttonContent={
<div data-test-subj={'finding-details-flyout-rule-accordion-button'}>
<EuiText size={'s'}>{fullRule.title}</EuiText>
Expand All @@ -122,59 +124,57 @@ export default class FindingDetailsFlyout extends Component<
initialIsOpen={rules.length === 1}
data-test-subj={`finding-details-flyout-rule-accordion-${key}`}
>
<EuiSpacer size={'m'} />
<EuiFlexGroup>
<EuiFlexItem>
{/*//TODO: Refactor EuiLink to filter rules table to the specific rule.*/}
<EuiFormRow label={'Rule name'}>
<EuiLink
onClick={() => this.showRuleDetails(fullRule, rule.id)}
data-test-subj={`finding-details-flyout-${fullRule.title}-details`}
>
{fullRule.title || DEFAULT_EMPTY_DATA}
</EuiLink>
</EuiFormRow>
</EuiFlexItem>

<EuiFlexItem>
<EuiFormRow
label={'Rule severity'}
data-test-subj={'finding-details-flyout-rule-severity'}
>
<EuiText>{severity || DEFAULT_EMPTY_DATA}</EuiText>
</EuiFormRow>
</EuiFlexItem>
<EuiPanel color="subdued">
<EuiFlexGroup>
<EuiFlexItem>
<EuiFormRow label={'Rule name'}>
<EuiLink
onClick={() => this.showRuleDetails(fullRule, rule.id)}
data-test-subj={`finding-details-flyout-${fullRule.title}-details`}
>
{fullRule.title || DEFAULT_EMPTY_DATA}
</EuiLink>
</EuiFormRow>
</EuiFlexItem>

<EuiFlexItem>
<EuiFormRow
label={'Log type'}
data-test-subj={'finding-details-flyout-rule-category'}
>
<EuiText>
{capitalizeFirstLetter(fullRule.category) || DEFAULT_EMPTY_DATA}
</EuiText>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
<EuiFlexItem>
<EuiFormRow
label={'Rule severity'}
data-test-subj={'finding-details-flyout-rule-severity'}
>
<EuiText>{severity || DEFAULT_EMPTY_DATA}</EuiText>
</EuiFormRow>
</EuiFlexItem>

<EuiSpacer size={'m'} />
<EuiFlexItem>
<EuiFormRow
label={'Log type'}
data-test-subj={'finding-details-flyout-rule-category'}
>
<EuiText>
{capitalizeFirstLetter(fullRule.category) || DEFAULT_EMPTY_DATA}
</EuiText>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>

<EuiFormRow
label={'Description'}
data-test-subj={'finding-details-flyout-rule-description'}
>
<EuiText>{fullRule.description || DEFAULT_EMPTY_DATA}</EuiText>
</EuiFormRow>
<EuiSpacer size={'m'} />

<EuiSpacer size={'m'} />
<EuiFormRow
label={'Description'}
data-test-subj={'finding-details-flyout-rule-description'}
>
<EuiText>{fullRule.description || DEFAULT_EMPTY_DATA}</EuiText>
</EuiFormRow>

<EuiFormRow label={'Tags'} data-test-subj={'finding-details-flyout-rule-tags'}>
<EuiText>{this.renderTags() || DEFAULT_EMPTY_DATA}</EuiText>
</EuiFormRow>
<EuiSpacer size={'m'} />

<EuiSpacer size={'l'} />
<EuiFormRow label={'Tags'} data-test-subj={'finding-details-flyout-rule-tags'}>
<EuiText>{this.renderTags() || DEFAULT_EMPTY_DATA}</EuiText>
</EuiFormRow>
</EuiPanel>
</EuiAccordion>
{rules.length > 1 && <EuiHorizontalRule />}
{rules.length > 1 && <EuiHorizontalRule margin={'xs'} />}
</div>
);
});
Expand Down Expand Up @@ -352,7 +352,6 @@ export default class FindingDetailsFlyout extends Component<
</EuiFlexGroup>

<EuiSpacer size={'m'} />

<EuiTitle size={'s'}>
<h3>Rule details</h3>
</EuiTitle>
Expand Down