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
e415590a
Commit
e415590a
authored
Apr 08, 2020
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add filters to group level
Add the filters component in the Group Level Security Dashboard
parent
895cb36f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
3 deletions
+54
-3
ee/app/assets/javascripts/security_dashboard/components/first_class_group_security_dashboard.vue
...board/components/first_class_group_security_dashboard.vue
+17
-1
ee/app/assets/javascripts/security_dashboard/components/first_class_group_security_dashboard_vulnerabilities.vue
.../first_class_group_security_dashboard_vulnerabilities.vue
+6
-0
ee/app/assets/javascripts/security_dashboard/graphql/group_vulnerabilities.graphql
.../security_dashboard/graphql/group_vulnerabilities.graphql
+15
-2
ee/spec/frontend/security_dashboard/components/first_class_group_security_dashboard_spec.js
...d/components/first_class_group_security_dashboard_spec.js
+16
-0
No files found.
ee/app/assets/javascripts/security_dashboard/components/first_class_group_security_dashboard.vue
View file @
e415590a
<
script
>
import
SecurityDashboardLayout
from
'
ee/security_dashboard/components/security_dashboard_layout.vue
'
;
import
GroupSecurityVulnerabilities
from
'
./first_class_group_security_dashboard_vulnerabilities.vue
'
;
import
GroupSecurityVulnerabilities
from
'
ee/security_dashboard/components/first_class_group_security_dashboard_vulnerabilities.vue
'
;
import
Filters
from
'
ee/security_dashboard/components/first_class_vulnerability_filters.vue
'
;
import
VulnerabilitySeverity
from
'
./vulnerability_severity.vue
'
;
export
default
{
...
...
@@ -8,6 +9,7 @@ export default {
SecurityDashboardLayout
,
GroupSecurityVulnerabilities
,
VulnerabilitySeverity
,
Filters
,
},
props
:
{
dashboardDocumentation
:
{
...
...
@@ -27,15 +29,29 @@ export default {
required
:
true
,
},
},
data
()
{
return
{
filters
:
{},
};
},
methods
:
{
handleFilterChange
(
filters
)
{
this
.
filters
=
filters
;
},
},
};
</
script
>
<
template
>
<security-dashboard-layout>
<template
#header
>
<filters
@
filterChange=
"handleFilterChange"
/>
</
template
>
<group-security-vulnerabilities
:dashboard-documentation=
"dashboardDocumentation"
:empty-state-svg-path=
"emptyStateSvgPath"
:group-full-path=
"groupFullPath"
:filters=
"filters"
/>
<
template
#aside
>
<vulnerability-severity
:endpoint=
"vulnerableProjectsEndpoint"
/>
...
...
ee/app/assets/javascripts/security_dashboard/components/first_class_group_security_dashboard_vulnerabilities.vue
View file @
e415590a
...
...
@@ -26,6 +26,11 @@ export default {
type
:
String
,
required
:
true
,
},
filters
:
{
type
:
Object
,
required
:
false
,
default
:
()
=>
({}),
},
},
data
()
{
return
{
...
...
@@ -41,6 +46,7 @@ export default {
return
{
fullPath
:
this
.
groupFullPath
,
first
:
VULNERABILITIES_PER_PAGE
,
...
this
.
filters
,
};
},
update
:
({
group
})
=>
group
.
vulnerabilities
.
nodes
,
...
...
ee/app/assets/javascripts/security_dashboard/graphql/group_vulnerabilities.graphql
View file @
e415590a
#import "~/graphql_shared/fragments/pageInfo.fragment.graphql"
#import "ee/vulnerabilities/graphql/vulnerability.fragment.graphql"
query
group
(
$fullPath
:
ID
!,
$after
:
String
,
$first
:
Int
)
{
query
group
(
$fullPath
:
ID
!,
$after
:
String
,
$first
:
Int
,
$severity
:
[
VulnerabilitySeverity
!]
$reportType
:
[
VulnerabilityReportType
!]
$state
:
[
VulnerabilityState
!]
)
{
group
(
fullPath
:
$fullPath
)
{
vulnerabilities
(
after
:
$after
,
first
:
$first
){
vulnerabilities
(
after
:
$after
,
first
:
$first
,
severity
:
$severity
reportType
:
$reportType
state
:
$state
){
nodes
{
...
Vulnerability
}
...
...
ee/spec/frontend/security_dashboard/components/first_class_group_security_dashboard_spec.js
View file @
e415590a
...
...
@@ -3,6 +3,7 @@ import SecurityDashboardLayout from 'ee/security_dashboard/components/security_d
import
FirstClassGroupDashboard
from
'
ee/security_dashboard/components/first_class_group_security_dashboard.vue
'
;
import
FirstClassGroupVulnerabilities
from
'
ee/security_dashboard/components/first_class_group_security_dashboard_vulnerabilities.vue
'
;
import
VulnerabilitySeverity
from
'
ee/security_dashboard/components/vulnerability_severity.vue
'
;
import
Filters
from
'
ee/security_dashboard/components/first_class_vulnerability_filters.vue
'
;
describe
(
'
First Class Group Dashboard Component
'
,
()
=>
{
let
wrapper
;
...
...
@@ -14,6 +15,7 @@ describe('First Class Group Dashboard Component', () => {
const
findGroupVulnerabilities
=
()
=>
wrapper
.
find
(
FirstClassGroupVulnerabilities
);
const
findVulnerabilitySeverity
=
()
=>
wrapper
.
find
(
VulnerabilitySeverity
);
const
findFilters
=
()
=>
wrapper
.
find
(
Filters
);
const
createWrapper
=
()
=>
{
return
shallowMount
(
FirstClassGroupDashboard
,
{
...
...
@@ -42,6 +44,20 @@ describe('First Class Group Dashboard Component', () => {
dashboardDocumentation
,
emptyStateSvgPath
,
groupFullPath
,
filters
:
{},
});
});
it
(
'
has filters
'
,
()
=>
{
expect
(
findFilters
().
exists
()).
toBe
(
true
);
});
it
(
'
it responds to the filterChange event
'
,
()
=>
{
const
filters
=
{
severity
:
'
critical
'
};
findFilters
().
vm
.
$listeners
.
filterChange
(
filters
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
filters
).
toEqual
(
filters
);
expect
(
findGroupVulnerabilities
().
props
(
'
filters
'
)).
toEqual
(
filters
);
});
});
...
...
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