Commit c1477461 authored by Phil Hughes's avatar Phil Hughes

Merge branch '210327-project-vendor-in-scanner-column' into 'master'

Add the scan vendor into the scanner column

See merge request gitlab-org/gitlab!36145
parents db484bcf b0bae50e
......@@ -287,9 +287,12 @@ export default {
</template>
<template #cell(reportType)="{ item }">
<span data-testid="vulnerability-report-type" class="text-capitalize">{{
useConvertReportType(item.reportType)
}}</span>
<div data-testid="vulnerability-report-type" class="text-capitalize">
{{ useConvertReportType(item.reportType) }}
</div>
<div data-testid="vulnerability-vendor" class="gl-text-gray-500">
{{ item.scanner.vendor }}
</div>
</template>
<template #table-busy>
......
......@@ -39,4 +39,7 @@ fragment Vulnerability on Vulnerability {
nameWithNamespace
}
reportType
scanner {
vendor
}
}
---
title: Add the scan vendor into the scanner column of the vulnerability list
merge_request: 36145
author:
type: changed
......@@ -22,6 +22,9 @@ export const generateVulnerabilities = () => [
project: {
nameWithNamespace: 'Administrator / Security reports',
},
scanner: {
vendor: 'GitLab',
},
},
{
id: 'id_1',
......@@ -42,6 +45,9 @@ export const generateVulnerabilities = () => [
project: {
nameWithNamespace: 'Administrator / Vulnerability reports',
},
scanner: {
vendor: 'GitLab',
},
},
{
id: 'id_2',
......@@ -55,6 +61,9 @@ export const generateVulnerabilities = () => [
project: {
nameWithNamespace: 'Mixed Vulnerabilities / Dependency List Test 01',
},
scanner: {
vendor: 'My Custom Scanner',
},
},
{
id: 'id_3',
......@@ -67,6 +76,7 @@ export const generateVulnerabilities = () => [
project: {
nameWithNamespace: 'Mixed Vulnerabilities / Rails App',
},
scanner: {},
},
{
id: 'id_4',
......@@ -77,6 +87,7 @@ export const generateVulnerabilities = () => [
project: {
nameWithNamespace: 'Administrator / Security reports',
},
scanner: {},
},
];
......
......@@ -214,6 +214,16 @@ describe('Vulnerability list component', () => {
expect(cells.at(2).text()).toBe('Custom scanner without translation');
expect(cells.at(3).text()).toBe('');
});
it('should display the vulnerability vendor if the vulnerability vendor does exist', () => {
const cells = findDataCells('vulnerability-vendor');
expect(cells.at(0).text()).toBe('GitLab');
});
it('should display an empty string if the vulnerability vendor does not exist', () => {
const cells = findDataCells('vulnerability-vendor');
expect(cells.at(3).text()).toBe('');
});
});
describe('when has an issue associated', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment