Commit 9fd8789a authored by Alexander Turinske's avatar Alexander Turinske

Add scanner vendor to scanner column

- for normal scanners, the vendor will be `GitLab`
- for custom scnners, the vendor will a custom string
- if no scanner exists, the report type should still show
- add tests
parent 5433dadb
...@@ -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,8 +158,13 @@ export default { ...@@ -155,8 +158,13 @@ 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">
{{ useConvertReportType }} <div class="text-capitalize">
{{ useConvertReportType }}
</div>
<div class="gl-text-gray-500">
{{ vulnerabilityVendor }}
</div>
</div> </div>
</div> </div>
......
---
title: Add scanner vendor to pipeline scanner column
merge_request: 36764
author:
type: changed
...@@ -53,6 +53,10 @@ describe('Security Dashboard Table Row', () => { ...@@ -53,6 +53,10 @@ 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('');
});
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 +93,10 @@ describe('Security Dashboard Table Row', () => { ...@@ -89,6 +93,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