Skip to content

Commit

Permalink
[FEATURE] Adjust styling for Finding details flyout opensearch-projec…
Browse files Browse the repository at this point in the history
…t#121

Signed-off-by: Jovan Cvetkovic <[email protected]>
  • Loading branch information
jovancvetkovic3006 committed Jan 16, 2023
1 parent b957bd4 commit 227439b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 60 deletions.
8 changes: 0 additions & 8 deletions cypress/integration/3_alerts.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,6 @@ 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
cy.get('[data-test-subj="finding-details-flyout-rule-accordion-button"]').contains(
'USB Device Plugged'
);
cy.get('[data-test-subj="finding-details-flyout-rule-accordion-button"]').contains(
'Severity: Low'
);

// Confirm the rule name
cy.get('[data-test-subj="finding-details-flyout-USB Device Plugged-details"]').contains(
'USB Device Plugged'
Expand Down
103 changes: 51 additions & 52 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,68 +112,70 @@ export default class FindingDetailsFlyout extends Component<
<div key={key}>
<EuiAccordion
id={`${key}`}
className="euiAccordionForm"
buttonClassName="euiAccordionForm__button"
buttonContent={
<div data-test-subj={'finding-details-flyout-rule-accordion-button'}>
<EuiText size={'s'}>{fullRule.title}</EuiText>
<EuiText size={'s'} color={'subdued'}>
Severity: {severity}
</EuiText>
<EuiTitle size={'s'}>
<h3>Rule details</h3>
</EuiTitle>
</div>
}
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>
<EuiPanel color="subdued">
<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>
<EuiFlexItem>
<EuiFormRow
label={'Rule severity'}
data-test-subj={'finding-details-flyout-rule-severity'}
>
<EuiText>{severity || DEFAULT_EMPTY_DATA}</EuiText>
</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={'Log type'}
data-test-subj={'finding-details-flyout-rule-category'}
>
<EuiText>
{capitalizeFirstLetter(fullRule.category) || DEFAULT_EMPTY_DATA}
</EuiText>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>

<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={'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={'Tags'} data-test-subj={'finding-details-flyout-rule-tags'}>
<EuiText>{this.renderTags() || 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={'l'} />
<EuiSpacer size={'l'} />
</EuiPanel>
</EuiAccordion>
{rules.length > 1 && <EuiHorizontalRule />}
</div>
Expand Down Expand Up @@ -353,10 +356,6 @@ export default class FindingDetailsFlyout extends Component<

<EuiSpacer size={'m'} />

<EuiTitle size={'s'}>
<h3>Rule details</h3>
</EuiTitle>
<EuiSpacer size={'m'} />
{this.renderRuleDetails(queries)}
<EuiSpacer size="l" />
{this.renderFindingDocuments()}
Expand Down

0 comments on commit 227439b

Please sign in to comment.