Skip to content

DRAFT Overview Dashboard redesign #924

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

Draft
wants to merge 41 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d875e64
Initial updates to overviewdash page
RKohler21 May 14, 2025
57d1a45
Tooltip code updates
RKohler21 May 19, 2025
f25e9dc
Merge branch 'develop' into VS-Dashboard-Develop
RKohler21 May 20, 2025
b8a5ba4
Merge branch 'VS-Dashboard-Develop' of https://github.com/cisagov/XFD…
RKohler21 May 20, 2025
6f0607a
Merge branch 'VS-Dashboard-Develop' of https://github.com/cisagov/XFD…
RKohler21 May 20, 2025
b634137
Merge branch 'VS-Dashboard-Develop' into Overview-Dash-Updates
RKohler21 May 20, 2025
ee40ac7
Merge branch 'VS-Dashboard-Develop' into Overview-Dash-Updates
RKohler21 May 20, 2025
a1e1a24
Re-adding vuln port widget
RKohler21 May 20, 2025
2814be6
Re-adding widgets
RKohler21 May 20, 2025
6144014
removing commented code
RKohler21 May 20, 2025
46c18b4
Card updates
RKohler21 May 20, 2025
941e1bf
Merge branch 'VS-Dashboard-Develop' into Overview-Dash-Updates
ameliav May 20, 2025
a4cd384
Common ports data showing fix
RKohler21 May 20, 2025
2aa9e2b
Merge branch 'Overview-Dash-Updates' of https://github.com/cisagov/XF…
RKohler21 May 20, 2025
519f6cb
Merge branch 'Overview-Dash-Updates' of https://github.com/cisagov/XF…
RKohler21 May 20, 2025
fd6c070
removing comments
RKohler21 May 20, 2025
7e77079
Merge branch 'VS-Dashboard-Develop' into Overview-Dash-Updates
ameliav May 20, 2025
021de25
main grid sizing and style updates
RKohler21 May 20, 2025
db5fad6
main grid sizing and style updates
RKohler21 May 20, 2025
288f3cc
Merge branch 'Overview-Dash-Updates' of https://github.com/cisagov/XF…
RKohler21 May 20, 2025
8569554
Update Most common vulns widget to Overview
ameliav May 20, 2025
4ea44ea
Update Detected Kevs widget in Overview
ameliav May 21, 2025
0a904e8
Update Overview layout to be responsive
ameliav May 21, 2025
5a5b484
Update Risk.tsx to OverviewDash.tsx
ameliav May 21, 2025
9893805
Add accessibility labels to GraphChip.tsx
ameliav May 21, 2025
37d8182
Merge branch 'VS-Dashboard-Develop' into Overview-Dash-Updates
ameliav May 21, 2025
188cbcd
Update padding of boxes
ameliav May 21, 2025
fa12abe
Merge branch 'VS-Dashboard-Develop' into Overview-Dash-Updates
ameliav May 21, 2025
013cee1
Update imports for Overview dash
ameliav May 21, 2025
fc91834
Add tooltip content
ameliav May 22, 2025
1187fda
Merge branch 'VS-Dashboard-Develop' into Overview-Dash-Updates
ameliav May 22, 2025
b14f1dd
Merge branch 'VS-Dashboard-Develop' into Overview-Dash-Updates
ameliav May 23, 2025
8df9356
Rename Risk folder to OverviewDash
ameliav May 23, 2025
7670f43
Fix linter error on package-lock
ameliav May 23, 2025
213fe4d
Reorder widgets in Overview layout
ameliav May 23, 2025
68278c7
Add Open Vullns By Hosts graph to Overview
ameliav May 27, 2025
29c4254
Merge branch 'develop' into Overview-Dash-Updates
ameliav May 28, 2025
43297c1
Merge branch 'develop' into Overview-Dash-Updates
ameliav Jun 5, 2025
60fcb15
Comment unused port
ameliav Jun 5, 2025
19289c9
Merge branch 'develop' into Overview-Dash-Updates
ameliav Jun 6, 2025
5eb7410
Merge branch 'develop' into Overview-Dash-Updates
ameliav Jun 23, 2025
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
2 changes: 1 addition & 1 deletion frontend/src/components/DomainDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { DefinitionList } from './DefinitionList';
import { differenceInCalendarDays, parseISO } from 'date-fns';
import { Webpage } from 'types';
import { useAuthContext } from 'context';
import { getSeverityColor } from 'pages/Risk/utils';
import { getSeverityColor } from 'pages/OverviewDash/utils';
import { Box } from '@mui/system';

const PREFIX = 'DomainDetails';
Expand Down
122 changes: 122 additions & 0 deletions frontend/src/pages/OverviewDash/LatestKEVs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import { Box, Link, Stack, Tooltip, Typography } from '@mui/material';
import { Circle } from '@mui/icons-material';
import RoundedTable from 'components/Dashboard/RoundedTable';
import { severityColor } from 'utils/severityLevelColorMap';
import InfoLabel from 'components/Dashboard/InfoLabel';
import infoIconContent from './infoIconContent.json';

type CommonVuln = {
title: string | null;
count: number;
severity: string | null;
};

type ColumnConfig<T> = {
key: keyof T;
header: string;
textAlign?: 'left' | 'center' | 'right';
minWidth?: string;
render: (value: T[keyof T], row: T) => React.ReactNode;
};

const tooltipContentJson = infoIconContent.infoIconContent;

export default function LatestKEVs({ data }: { data: CommonVuln[] }) {
const history = useHistory();
const filteredVulnTableLinkHandler = (title: string) =>
history.push('/inventory/vulnerabilities', { title: title });

const TruncatedLink = ({ text = '' }: { text: string | null }) => (
<Tooltip title={text} placement={'right'}>
<Link
onClick={() => filteredVulnTableLinkHandler(text || '')}
aria-label={`View details for vulnerability: ${text}`}
sx={{
display: '-webkit-box',
WebkitLineClamp: 2,
WebkitBoxOrient: 'vertical',
overflow: 'hidden',
textOverflow: 'ellipsis',
lineHeight: '1.5',
maxHeight: '3em',
cursor: 'pointer'
}}
>
{text}
</Link>
</Tooltip>
);

const LatestKevsColumns: ColumnConfig<CommonVuln>[] = [
{
key: 'title',
header: 'Vulnerability Name',
minWidth: '100px',
render: (value) => (
<TruncatedLink text={value !== null ? String(value) : null} />
)
},
{
key: 'count',
header: 'Host Counts',
textAlign: 'center',
render: (value) => (
<Typography variant="body1" textAlign="center">
{value}
</Typography>
)
},
{
key: 'severity',
header: 'Severity',
textAlign: 'center',
render: (value, row) => (
<Stack direction="row" alignItems="center" justifyContent="center">
<Circle
sx={{
color: severityColor(
value !== null ? String(value).toLowerCase() : null
),
fontSize: '18px',
mr: 1,
...(value === 'Low' || value === 'Medium'
? { '& path': { stroke: '#646566', strokeWidth: 1.5 } }
: {})
}}
/>
<Typography variant="body1" textTransform="capitalize">
{value}
</Typography>
</Stack>
)
}
];

return (
<Box
border="1px solid"
borderRadius="4px"
borderColor="neutrals.light"
px={3}
py={2}
>
<InfoLabel
label="Latest KEV's"
typographyVariant="h3"
headingLevel="h3"
viewDetails
link="/inventory/vulnerabilities"
tooltipContentJson={tooltipContentJson}
/>
<Box sx={{ height: 'auto', mt: -1.5 }}>
<RoundedTable
data={data.slice(0, 5)}
columns={LatestKevsColumns}
noDataMessage="There were no vulnerabilities found."
/>
</Box>
</Box>
);
}
122 changes: 122 additions & 0 deletions frontend/src/pages/OverviewDash/MostCommonVulns.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import { Box, Link, Stack, Tooltip, Typography } from '@mui/material';
import { Circle } from '@mui/icons-material';
import RoundedTable from 'components/Dashboard/RoundedTable';
import { severityColor } from 'utils/severityLevelColorMap';
import InfoLabel from 'components/Dashboard/InfoLabel';
import infoIconContent from './infoIconContent.json';

type CommonVuln = {
title: string | null;
count: number;
severity: string | null;
};

type ColumnConfig<T> = {
key: keyof T;
header: string;
textAlign?: 'left' | 'center' | 'right';
minWidth?: string;
render: (value: T[keyof T], row: T) => React.ReactNode;
};

const tooltipContentJson = infoIconContent.infoIconContent;

export default function MostCommonVulns({ data }: { data: CommonVuln[] }) {
const history = useHistory();
const filteredVulnTableLinkHandler = (title: string) =>
history.push('/inventory/vulnerabilities', { title: title });

const TruncatedLink = ({ text = '' }: { text: string | null }) => (
<Tooltip title={text} placement={'right'}>
<Link
onClick={() => filteredVulnTableLinkHandler(text || '')}
aria-label={`View details for vulnerability: ${text}`}
sx={{
display: '-webkit-box',
WebkitLineClamp: 2,
WebkitBoxOrient: 'vertical',
overflow: 'hidden',
textOverflow: 'ellipsis',
lineHeight: '1.5',
maxHeight: '3em',
cursor: 'pointer'
}}
>
{text}
</Link>
</Tooltip>
);

const mostCommonVulnsColumns: ColumnConfig<CommonVuln>[] = [
{
key: 'title',
header: 'Vulnerability Name',
minWidth: '100px',
render: (value) => (
<TruncatedLink text={value !== null ? String(value) : null} />
)
},
{
key: 'count',
header: 'Host Counts',
textAlign: 'center',
render: (value) => (
<Typography variant="body1" textAlign="center">
{value}
</Typography>
)
},
{
key: 'severity',
header: 'Severity',
textAlign: 'center',
render: (value, row) => (
<Stack direction="row" alignItems="center" justifyContent="center">
<Circle
sx={{
color: severityColor(
value !== null ? String(value).toLowerCase() : null
),
fontSize: '18px',
mr: 1,
...(value === 'Low' || value === 'Medium'
? { '& path': { stroke: '#646566', strokeWidth: 1.5 } }
: {})
}}
/>
<Typography variant="body1" textTransform="capitalize">
{value}
</Typography>
</Stack>
)
}
];

return (
<Box
border="1px solid"
borderRadius="4px"
borderColor="neutrals.light"
px={3}
py={2}
>
<InfoLabel
label="Most Common Vulnerabilities"
typographyVariant="h3"
headingLevel="h3"
viewDetails
link="/inventory/vulnerabilities"
tooltipContentJson={tooltipContentJson}
/>
<Box sx={{ height: 'auto', mt: -1.5 }}>
<RoundedTable
data={data.slice(0, 5)}
columns={mostCommonVulnsColumns}
noDataMessage="There were no vulnerabilities found."
/>
</Box>
</Box>
);
}
Loading
Loading