From 227439b09f364e4b04f1ebd4404b38073fbc4fff Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Mon, 16 Jan 2023 18:21:52 +0100 Subject: [PATCH] [FEATURE] Adjust styling for Finding details flyout #121 Signed-off-by: Jovan Cvetkovic --- cypress/integration/3_alerts.spec.js | 8 -- .../components/FindingDetailsFlyout.tsx | 103 +++++++++--------- 2 files changed, 51 insertions(+), 60 deletions(-) diff --git a/cypress/integration/3_alerts.spec.js b/cypress/integration/3_alerts.spec.js index 332328c82..bf6ca4dae 100644 --- a/cypress/integration/3_alerts.spec.js +++ b/cypress/integration/3_alerts.spec.js @@ -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' diff --git a/public/pages/Findings/components/FindingDetailsFlyout.tsx b/public/pages/Findings/components/FindingDetailsFlyout.tsx index 413a393fe..afb63763a 100644 --- a/public/pages/Findings/components/FindingDetailsFlyout.tsx +++ b/public/pages/Findings/components/FindingDetailsFlyout.tsx @@ -19,6 +19,7 @@ import { EuiFormRow, EuiHorizontalRule, EuiLink, + EuiPanel, EuiSpacer, EuiText, EuiTitle, @@ -111,68 +112,70 @@ export default class FindingDetailsFlyout extends Component<
- {fullRule.title} - - Severity: {severity} - + +

Rule details

+
} initialIsOpen={rules.length === 1} data-test-subj={`finding-details-flyout-rule-accordion-${key}`} > - - - - {/*//TODO: Refactor EuiLink to filter rules table to the specific rule.*/} - - this.showRuleDetails(fullRule, rule.id)} - data-test-subj={`finding-details-flyout-${fullRule.title}-details`} - > - {fullRule.title || DEFAULT_EMPTY_DATA} - - - + + + + {/*//TODO: Refactor EuiLink to filter rules table to the specific rule.*/} + + this.showRuleDetails(fullRule, rule.id)} + data-test-subj={`finding-details-flyout-${fullRule.title}-details`} + > + {fullRule.title || DEFAULT_EMPTY_DATA} + + + - - - {severity || DEFAULT_EMPTY_DATA} - - + + + {severity || DEFAULT_EMPTY_DATA} + + - - - - {capitalizeFirstLetter(fullRule.category) || DEFAULT_EMPTY_DATA} - - - - + + + + {capitalizeFirstLetter(fullRule.category) || DEFAULT_EMPTY_DATA} + + + + - + - - {fullRule.description || DEFAULT_EMPTY_DATA} - + + {fullRule.description || DEFAULT_EMPTY_DATA} + - + - - {this.renderTags() || DEFAULT_EMPTY_DATA} - + + {this.renderTags() || DEFAULT_EMPTY_DATA} + - + + {rules.length > 1 && } @@ -353,10 +356,6 @@ export default class FindingDetailsFlyout extends Component< - -

Rule details

-
- {this.renderRuleDetails(queries)} {this.renderFindingDocuments()}