Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4e544633
Commit
4e544633
authored
Aug 31, 2020
by
Savas Vedova
Committed by
Kushal Pandya
Aug 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide vendor name when GitLab is the only one
parent
91df75d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
1 deletion
+51
-1
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
...ipts/security_dashboard/components/vulnerability_list.vue
+8
-1
ee/spec/frontend/security_dashboard/components/vulnerability_list_spec.js
.../security_dashboard/components/vulnerability_list_spec.js
+43
-0
No files found.
ee/app/assets/javascripts/security_dashboard/components/vulnerability_list.vue
View file @
4e544633
...
@@ -85,6 +85,9 @@ export default {
...
@@ -85,6 +85,9 @@ export default {
};
};
},
},
computed
:
{
computed
:
{
hasAnyScannersOtherThanGitLab
()
{
return
this
.
vulnerabilities
.
some
(
v
=>
v
.
scanner
?.
vendor
!==
'
GitLab
'
);
},
notEnabledSecurityScanners
()
{
notEnabledSecurityScanners
()
{
const
{
available
=
[],
enabled
=
[]
}
=
this
.
securityScanners
;
const
{
available
=
[],
enabled
=
[]
}
=
this
.
securityScanners
;
return
difference
(
available
,
enabled
);
return
difference
(
available
,
enabled
);
...
@@ -360,7 +363,11 @@ export default {
...
@@ -360,7 +363,11 @@ export default {
<div
data-testid=
"vulnerability-report-type"
class=
"text-capitalize"
>
<div
data-testid=
"vulnerability-report-type"
class=
"text-capitalize"
>
{{
useConvertReportType
(
item
.
reportType
)
}}
{{
useConvertReportType
(
item
.
reportType
)
}}
</div>
</div>
<div
data-testid=
"vulnerability-vendor"
class=
"gl-text-gray-300"
>
<div
v-if=
"hasAnyScannersOtherThanGitLab"
data-testid=
"vulnerability-vendor"
class=
"gl-text-gray-300"
>
{{
item
.
scanner
.
vendor
}}
{{
item
.
scanner
.
vendor
}}
</div>
</div>
</
template
>
</
template
>
...
...
ee/spec/frontend/security_dashboard/components/vulnerability_list_spec.js
View file @
4e544633
...
@@ -48,6 +48,7 @@ describe('Vulnerability list component', () => {
...
@@ -48,6 +48,7 @@ describe('Vulnerability list component', () => {
const
findCellText
=
label
=>
findDataCell
(
label
).
text
();
const
findCellText
=
label
=>
findDataCell
(
label
).
text
();
const
findFiltersProducedNoResults
=
()
=>
wrapper
.
find
(
FiltersProducedNoResults
);
const
findFiltersProducedNoResults
=
()
=>
wrapper
.
find
(
FiltersProducedNoResults
);
const
findDashboardHasNoVulnerabilities
=
()
=>
wrapper
.
find
(
DashboardHasNoVulnerabilities
);
const
findDashboardHasNoVulnerabilities
=
()
=>
wrapper
.
find
(
DashboardHasNoVulnerabilities
);
const
findVendorNames
=
()
=>
wrapper
.
find
(
`[data-testid="vulnerability-vendor"]`
);
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
...
@@ -284,6 +285,48 @@ describe('Vulnerability list component', () => {
...
@@ -284,6 +285,48 @@ describe('Vulnerability list component', () => {
});
});
});
});
describe
(
'
when GitLab is the only scanner in the reports
'
,
()
=>
{
let
newVulnerabilities
;
beforeEach
(()
=>
{
newVulnerabilities
=
generateVulnerabilities
();
newVulnerabilities
=
newVulnerabilities
.
map
(
v
=>
({
...
v
,
scanner
:
{
vendor
:
'
GitLab
'
},
}));
wrapper
=
createWrapper
({
props
:
{
vulnerabilities
:
newVulnerabilities
,
shouldShowReportType
:
true
,
},
});
});
it
(
'
should not render the vendor name
'
,
()
=>
{
expect
(
findVendorNames
().
exists
()).
toBe
(
false
);
});
});
describe
(
'
when there are other scanners in the report
'
,
()
=>
{
let
newVulnerabilities
;
beforeEach
(()
=>
{
newVulnerabilities
=
generateVulnerabilities
();
newVulnerabilities
[
0
].
scanner
=
{
vendor
:
'
GitLab
'
};
newVulnerabilities
[
1
].
scanner
=
{
vendor
:
'
Third Party Scanner
'
};
wrapper
=
createWrapper
({
props
:
{
vulnerabilities
:
newVulnerabilities
,
shouldShowReportType
:
true
,
},
});
});
it
(
'
should not render the vendor name
'
,
()
=>
{
expect
(
findVendorNames
().
exists
()).
toBe
(
true
);
});
});
describe
(
'
when a vulnerability is resolved on the default branch
'
,
()
=>
{
describe
(
'
when a vulnerability is resolved on the default branch
'
,
()
=>
{
let
newVulnerabilities
;
let
newVulnerabilities
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment