Skip to content

Commit f6911d8

Browse files
committed
Grid item and better responsiveness for vuln summary
1 parent b2948f1 commit f6911d8

3 files changed

Lines changed: 8 additions & 19 deletions

File tree

libs/i18n/locales/en/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,7 @@
15131513
"Vulnerability counts by severity": "Vulnerability counts by severity",
15141514
"No CVEs detected": "No CVEs detected",
15151515
"All managed devices have been scanned. No CVEs were found affecting images currently deployed across your fleets and devices.": "All managed devices have been scanned. No CVEs were found affecting images currently deployed across your fleets and devices.",
1516-
"No vulnerability data to display.": "No vulnerability data to display.",
1516+
"No vulnerability data to display": "No vulnerability data to display",
15171517
"There are currently no deployed devices. Scan results will be available once devices have been added.": "There are currently no deployed devices. Scan results will be available once devices have been added.",
15181518
"Severity": "Severity",
15191519
"Affected devices": "Affected devices",

libs/ui-components/src/components/SecurityOverview/SecurityOverviewSummary.tsx

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import { Divider, Flex, FlexItem, Icon, Stack, StackItem } from '@patternfly/react-core';
2+
import { Divider, Flex, FlexItem, Grid, GridItem, Icon, Stack, StackItem } from '@patternfly/react-core';
33
import { Vulnerability } from '@flightctl/types/alpha';
44
import SeverityUndefinedIcon from '@patternfly/react-icons/dist/js/icons/severity-undefined-icon';
55

@@ -65,6 +65,7 @@ const SecurityOverviewSummary = () => {
6565

6666
const statusItems = getVulnerabilitySeverityStatusItems(t);
6767
const severityThresholdIndex = VULNERABILITY_SEVERITY_ORDER.indexOf(Vulnerability.severity.LOW);
68+
const severityColumnSpan = hasAllSeverities ? 4 : 3;
6869

6970
return (
7071
<Stack hasGutter>
@@ -83,15 +84,7 @@ const SecurityOverviewSummary = () => {
8384
<Divider className="pf-v6-u-my-md" />
8485
</StackItem>
8586
<StackItem>
86-
<div
87-
role="group"
88-
aria-label={t('Vulnerability counts by severity')}
89-
style={{
90-
display: 'grid',
91-
gridTemplateColumns: `repeat(${hasAllSeverities ? 3 : 4}, minmax(0, 1fr))`,
92-
gap: 'var(--pf-t--global--spacer--md)',
93-
}}
94-
>
87+
<Grid hasGutter role="group" aria-label={t('Vulnerability counts by severity')}>
9588
{VULNERABILITY_SEVERITY_ORDER.map((severity, index) => {
9689
// If none/unknown severities are present, we show all severities.
9790
// Otherwise, we only show severities of the main categories (Critical to Low)
@@ -101,15 +94,12 @@ const SecurityOverviewSummary = () => {
10194

10295
const item = statusItems.find((item) => item.id === severity) || defaultVulnerabilitySeverityStatusItem(t);
10396
return (
104-
<SeverityStat
105-
key={severity}
106-
count={getSeverityCountValue(severity, counts)}
107-
severity={severity}
108-
item={item}
109-
/>
97+
<GridItem key={severity} xl={severityColumnSpan} span={6}>
98+
<SeverityStat severity={severity} item={item} count={getSeverityCountValue(severity, counts)} />
99+
</GridItem>
110100
);
111101
})}
112-
</div>
102+
</Grid>
113103
</StackItem>
114104
</Stack>
115105
);

libs/ui-components/src/types/rbac.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export enum RESOURCE {
1313
CATALOG_ITEM = 'catalogitems',
1414
FLEET = 'fleets',
1515
DEVICE = 'devices',
16-
// CELIA-WIP: confirm vulnerabilities resource path with backend RBAC before release.
1716
VULNERABILITY = 'vulnerabilities',
1817
DEVICE_CONSOLE = 'devices/console',
1918
DEVICE_DECOMMISSION = 'devices/decommission',

0 commit comments

Comments
 (0)