Skip to content

Commit

Permalink
Fix summaries in the asset table and asset details (#437)
Browse files Browse the repository at this point in the history
Ensures the data is pulled from the API for the summaries to be
displayed in the assets table.

Ensures that assets with missing summary data don't crash the UI when in
the assets drill down, without this change it just displays a blank
screen.
  • Loading branch information
Sam Betts committed Jun 28, 2023
1 parent fa7252d commit cb4d64a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ui/src/layout/Assets/AssetsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const AssetsTable = () => {
<TablePage
columns={columns}
url={APIS.ASSETS}
select="id,targetInfo"
select="id,targetInfo,summary"
tableTitle={TABLE_TITLE}
filterType={FILTER_TYPES.ASSETS}
filtersConfig={[
Expand Down
7 changes: 4 additions & 3 deletions ui/src/layout/detail-displays/Findings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import FindingsCounterDisplay from './FindingsCounterDisplay';
import FindingsSystemFilterLinks from './FindingsSystemFilterLinks';

const Findings = ({findingsSummary, findingsFilter, findingsFilterTitle, findingsFilterSuffix=""}) => {
const {totalVulnerabilities} = findingsSummary || {};
findingsSummary = findingsSummary || {};
const {totalVulnerabilities} = findingsSummary;

const {pathname} = useLocation();
const filtersDispatch = useFilterDispatch();
Expand All @@ -26,7 +27,7 @@ const Findings = ({findingsSummary, findingsFilter, findingsFilterTitle, finding
backPath: pathname,
customDisplay: () => (
<FindingsSystemFilterLinks
findingsSummary={findingsSummary || {}}
findingsSummary={findingsSummary}
totalVulnerabilitiesCount={getTotlalVulnerabilitiesFromCounters(totalVulnerabilities)}
/>
)
Expand Down Expand Up @@ -66,4 +67,4 @@ const Findings = ({findingsSummary, findingsFilter, findingsFilterTitle, finding
)
}

export default Findings;
export default Findings;

0 comments on commit cb4d64a

Please sign in to comment.