Commit a50fe76e authored by Kushal Pandya's avatar Kushal Pandya

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

Add scanner vendor to pipeline scanner column

See merge request gitlab-org/gitlab!36764
parents 40bc0825 a8cba0a8
...@@ -70,6 +70,9 @@ export default { ...@@ -70,6 +70,9 @@ export default {
useConvertReportType() { useConvertReportType() {
return convertReportType(this.vulnerability.report_type); return convertReportType(this.vulnerability.report_type);
}, },
vulnerabilityVendor() {
return this.vulnerability.scanner?.vendor;
},
}, },
methods: { methods: {
...mapActions('vulnerabilities', ['openModal', 'selectVulnerability', 'deselectVulnerability']), ...mapActions('vulnerabilities', ['openModal', 'selectVulnerability', 'deselectVulnerability']),
...@@ -155,9 +158,14 @@ export default { ...@@ -155,9 +158,14 @@ export default {
<div class="table-section section-15"> <div class="table-section section-15">
<div class="table-mobile-header" role="rowheader">{{ s__('Reports|Scanner') }}</div> <div class="table-mobile-header" role="rowheader">{{ s__('Reports|Scanner') }}</div>
<div class="table-mobile-content text-capitalize"> <div class="table-mobile-content">
<div class="text-capitalize">
{{ useConvertReportType }} {{ useConvertReportType }}
</div> </div>
<div v-if="vulnerabilityVendor" class="gl-text-gray-500" data-testid="vulnerability-vendor">
{{ vulnerabilityVendor }}
</div>
</div>
</div> </div>
<div class="table-section section-20"> <div class="table-section section-20">
......
---
title: Add scanner vendor to pipeline scanner column
merge_request: 36764
author:
type: changed
...@@ -53,6 +53,11 @@ describe('Security Dashboard Table Row', () => { ...@@ -53,6 +53,11 @@ describe('Security Dashboard Table Row', () => {
expect(findContent(0).text()).toEqual(''); expect(findContent(0).text()).toEqual('');
}); });
it('should render a `` for the report type and scanner', () => {
expect(findContent(3).text()).toEqual('');
expect(wrapper.find('vulnerability-vendor').exists()).toBeFalsy();
});
it('should not render action buttons', () => { it('should not render action buttons', () => {
expect(wrapper.findAll('.action-buttons button')).toHaveLength(0); expect(wrapper.findAll('.action-buttons button')).toHaveLength(0);
}); });
...@@ -89,6 +94,10 @@ describe('Security Dashboard Table Row', () => { ...@@ -89,6 +94,10 @@ describe('Security Dashboard Table Row', () => {
).toContain(vulnerability.report_type.toLowerCase()); ).toContain(vulnerability.report_type.toLowerCase());
}); });
it('should render the scanner vendor if the scanner does exist', () => {
expect(findContent(3).text()).toContain(vulnerability.scanner.vendor);
});
describe('the project name', () => { describe('the project name', () => {
it('should render the name', () => { it('should render the name', () => {
expect(findContent(1).text()).toContain(vulnerability.name); expect(findContent(1).text()).toContain(vulnerability.name);
......
...@@ -8,6 +8,7 @@ export default [ ...@@ -8,6 +8,7 @@ export default [
scanner: { scanner: {
external_id: 'find_sec_bugs', external_id: 'find_sec_bugs',
name: 'Find Security Bugs', name: 'Find Security Bugs',
vendor: 'GitLab',
}, },
identifiers: [ identifiers: [
{ {
...@@ -75,6 +76,7 @@ export default [ ...@@ -75,6 +76,7 @@ export default [
scanner: { scanner: {
external_id: 'find_sec_bugs', external_id: 'find_sec_bugs',
name: 'Find Security Bugs', name: 'Find Security Bugs',
vendor: 'GitLab',
}, },
identifiers: [ identifiers: [
{ {
...@@ -128,6 +130,7 @@ export default [ ...@@ -128,6 +130,7 @@ export default [
scanner: { scanner: {
external_id: 'find_sec_bugs', external_id: 'find_sec_bugs',
name: 'Find Security Bugs', name: 'Find Security Bugs',
vendor: 'GitLab',
}, },
identifiers: [ identifiers: [
{ {
...@@ -205,6 +208,7 @@ export default [ ...@@ -205,6 +208,7 @@ export default [
scanner: { scanner: {
external_id: 'find_sec_bugs', external_id: 'find_sec_bugs',
name: 'Find Security Bugs', name: 'Find Security Bugs',
vendor: 'GitLab',
}, },
identifiers: [ identifiers: [
{ {
...@@ -283,6 +287,7 @@ export default [ ...@@ -283,6 +287,7 @@ export default [
scanner: { scanner: {
external_id: 'find_sec_bugs', external_id: 'find_sec_bugs',
name: 'Find Security Bugs', name: 'Find Security Bugs',
vendor: 'GitLab',
}, },
identifiers: [ identifiers: [
{ {
...@@ -384,6 +389,7 @@ export default [ ...@@ -384,6 +389,7 @@ export default [
scanner: { scanner: {
external_id: 'find_sec_bugs', external_id: 'find_sec_bugs',
name: 'Find Security Bugs', name: 'Find Security Bugs',
vendor: 'GitLab',
}, },
identifiers: [ identifiers: [
{ {
...@@ -437,6 +443,7 @@ export default [ ...@@ -437,6 +443,7 @@ export default [
scanner: { scanner: {
external_id: 'find_sec_bugs', external_id: 'find_sec_bugs',
name: 'Find Security Bugs', name: 'Find Security Bugs',
vendor: 'GitLab',
}, },
identifiers: [ identifiers: [
{ {
...@@ -514,6 +521,7 @@ export default [ ...@@ -514,6 +521,7 @@ export default [
scanner: { scanner: {
external_id: 'clair', external_id: 'clair',
name: 'Clair', name: 'Clair',
vendor: 'GitLab',
}, },
identifiers: [ identifiers: [
{ {
......
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