Remove vuln count detail for device user, fix padding/margins (#4744)

This commit is contained in:
RachelElysia 2022-03-23 10:57:42 -04:00 committed by GitHub
parent 778de64011
commit bf4713b742
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 9 deletions

View file

@ -68,7 +68,12 @@ const SoftwareTable = ({
{software?.length ? (
<>
{software && <SoftwareVulnCount softwareList={software} />}
{software && (
<SoftwareVulnCount
softwareList={software}
deviceUser={deviceUser}
/>
)}
{software && (
<TableContainer
columns={tableHeaders}

View file

@ -7,11 +7,13 @@ const baseClass = "software-vuln-count";
interface ISoftwareVulnCountProps {
softwareList: ISoftware[];
deviceUser?: boolean;
}
const SoftwareVulnCount = ({
softwareList,
}: ISoftwareVulnCountProps): JSX.Element | null => {
deviceUser,
}: ISoftwareVulnCountProps): JSX.Element => {
const vulnCount = softwareList.reduce((sum, software) => {
return software.vulnerabilities
? sum + software.vulnerabilities.length
@ -26,12 +28,16 @@ const SoftwareVulnCount = ({
? "1 vulnerability detected"
: `${vulnCount} vulnerabilities detected`}
</div>
<p>
Click a vulnerable item below to see the associated Common
Vulnerabilites and Exposures (CVEs).
</p>
{!deviceUser && (
<p>
Click a vulnerable item below to see the associated Common
Vulnerabilites and Exposures (CVEs).
</p>
)}
</div>
) : null;
) : (
<></>
);
};
export default SoftwareVulnCount;

View file

@ -7,12 +7,11 @@
overflow: auto;
margin-bottom: $pad-large;
padding: $pad-large;
padding-bottom: $pad-small;
p {
padding-left: $pad-large;
margin-top: $pad-medium;
margin-bottom: $pad-medium;
margin-bottom: 0;
}
img {