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
d148c7d2
Commit
d148c7d2
authored
Sep 04, 2020
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply filters to vuln count list
- Update tests - Add changelog
parent
1cb88955
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
7 deletions
+46
-7
ee/app/assets/javascripts/security_dashboard/components/first_class_project_security_dashboard.vue
...ard/components/first_class_project_security_dashboard.vue
+1
-1
ee/app/assets/javascripts/security_dashboard/components/vulnerability_count_list.vue
...ecurity_dashboard/components/vulnerability_count_list.vue
+9
-1
ee/app/assets/javascripts/security_dashboard/graphql/project_vulnerability_severities_count.graphql
...rd/graphql/project_vulnerability_severities_count.graphql
+13
-2
ee/changelogs/unreleased/231400-update-severity-counts-to-match-filters.yml
...leased/231400-update-severity-counts-to-match-filters.yml
+5
-0
ee/spec/frontend/security_dashboard/components/first_class_project_security_dashboard_spec.js
...components/first_class_project_security_dashboard_spec.js
+18
-3
No files found.
ee/app/assets/javascripts/security_dashboard/components/first_class_project_security_dashboard.vue
View file @
d148c7d2
...
...
@@ -61,7 +61,7 @@ export default {
<h4
class=
"flex-grow mt-0 mb-0"
>
{{
__
(
'
Vulnerabilities
'
)
}}
</h4>
<csv-export-button
:vulnerabilities-export-endpoint=
"vulnerabilitiesExportEndpoint"
/>
</div>
<vulnerabilities-count-list
:project-full-path=
"projectFullPath"
/>
<vulnerabilities-count-list
:project-full-path=
"projectFullPath"
:filters=
"filters"
/>
</
template
>
<
template
#sticky
>
<filters
@
filterChange=
"handleFilterChange"
/>
...
...
ee/app/assets/javascripts/security_dashboard/components/vulnerability_count_list.vue
View file @
d148c7d2
...
...
@@ -11,6 +11,11 @@ export default {
type
:
String
,
required
:
true
,
},
filters
:
{
type
:
Object
,
required
:
false
,
default
:
()
=>
({}),
},
},
data
:
()
=>
({
queryError
:
false
,
...
...
@@ -25,7 +30,10 @@ export default {
vulnerabilitiesCount
:
{
query
:
vulnerabilitySeveritiesCountQuery
,
variables
()
{
return
{
fullPath
:
this
.
projectFullPath
};
return
{
fullPath
:
this
.
projectFullPath
,
...
this
.
filters
,
};
},
update
:
({
project
})
=>
project
.
vulnerabilitySeveritiesCount
,
result
()
{
...
...
ee/app/assets/javascripts/security_dashboard/graphql/project_vulnerability_severities_count.graphql
View file @
d148c7d2
query
vulnerabilitySeveritiesCount
(
$fullPath
:
ID
!)
{
query
vulnerabilitySeveritiesCount
(
$fullPath
:
ID
!
$severity
:
[
VulnerabilitySeverity
!]
$reportType
:
[
VulnerabilityReportType
!]
$scanner
:
[
String
!]
$state
:
[
VulnerabilityState
!]
)
{
project
(
fullPath
:
$fullPath
)
{
vulnerabilitySeveritiesCount
{
vulnerabilitySeveritiesCount
(
severity
:
$severity
reportType
:
$reportType
scanner
:
$scanner
state
:
$state
)
{
critical
high
low
...
...
ee/changelogs/unreleased/231400-update-severity-counts-to-match-filters.yml
0 → 100644
View file @
d148c7d2
---
title
:
Apply filters to vulnerability count list
merge_request
:
41566
author
:
type
:
changed
ee/spec/frontend/security_dashboard/components/first_class_project_security_dashboard_spec.js
View file @
d148c7d2
...
...
@@ -4,6 +4,7 @@ import FirstClassProjectSecurityDashboard from 'ee/security_dashboard/components
import
Filters
from
'
ee/security_dashboard/components/first_class_vulnerability_filters.vue
'
;
import
SecurityDashboardLayout
from
'
ee/security_dashboard/components/security_dashboard_layout.vue
'
;
import
ProjectVulnerabilitiesApp
from
'
ee/security_dashboard/components/project_vulnerabilities.vue
'
;
import
VulnerabilityCountList
from
'
ee/security_dashboard/components/vulnerability_count_list.vue
'
;
import
ReportsNotConfigured
from
'
ee/security_dashboard/components/empty_states/reports_not_configured.vue
'
;
import
CsvExportButton
from
'
ee/security_dashboard/components/csv_export_button.vue
'
;
...
...
@@ -27,6 +28,7 @@ describe('First class Project Security Dashboard component', () => {
const
findFilters
=
()
=>
wrapper
.
find
(
Filters
);
const
findVulnerabilities
=
()
=>
wrapper
.
find
(
ProjectVulnerabilitiesApp
);
const
findVulnerabilityCountList
=
()
=>
wrapper
.
find
(
VulnerabilityCountList
);
const
findUnconfiguredState
=
()
=>
wrapper
.
find
(
ReportsNotConfigured
);
const
findCsvExportButton
=
()
=>
wrapper
.
find
(
CsvExportButton
);
...
...
@@ -49,15 +51,28 @@ describe('First class Project Security Dashboard component', () => {
describe
(
'
on render when there are vulnerabilities
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({
props
:
{
hasVulnerabilities
:
true
}
});
createComponent
({
props
:
{
hasVulnerabilities
:
true
},
data
:
()
=>
({
filters
}),
});
});
it
(
'
should render the vulnerabilities
'
,
()
=>
{
expect
(
findVulnerabilities
().
exists
()).
toBe
(
true
);
});
it
(
'
should pass down the "projectFullPath" prop to the vulnerabilities
'
,
()
=>
{
expect
(
findVulnerabilities
().
props
(
'
projectFullPath
'
)).
toBe
(
props
.
projectFullPath
);
it
(
'
should pass down the properties correctly to the vulnerabilities
'
,
()
=>
{
expect
(
findVulnerabilities
().
props
()).
toEqual
({
projectFullPath
:
props
.
projectFullPath
,
filters
,
});
});
it
(
'
should pass down the properties correctly to the vulnerability count list
'
,
()
=>
{
expect
(
findVulnerabilityCountList
().
props
()).
toEqual
({
projectFullPath
:
props
.
projectFullPath
,
filters
,
});
});
it
(
'
should render the filters component
'
,
()
=>
{
...
...
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