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
00160427
Commit
00160427
authored
Apr 10, 2020
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add filters to the instance level dashboard
- Rename wrong test names
parent
fc4091a5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
2 deletions
+55
-2
ee/app/assets/javascripts/security_dashboard/components/first_class_instance_security_dashboard.vue
...rd/components/first_class_instance_security_dashboard.vue
+19
-0
ee/app/assets/javascripts/security_dashboard/components/first_class_instance_security_dashboard_vulnerabilities.vue
...rst_class_instance_security_dashboard_vulnerabilities.vue
+6
-0
ee/app/assets/javascripts/security_dashboard/graphql/instance_vulnerabilities.graphql
...curity_dashboard/graphql/instance_vulnerabilities.graphql
+14
-2
ee/spec/frontend/security_dashboard/components/first_class_instance_security_dashboard_spec.js
...omponents/first_class_instance_security_dashboard_spec.js
+16
-0
No files found.
ee/app/assets/javascripts/security_dashboard/components/first_class_instance_security_dashboard.vue
View file @
00160427
...
@@ -2,12 +2,14 @@
...
@@ -2,12 +2,14 @@
import
SecurityDashboardLayout
from
'
ee/security_dashboard/components/security_dashboard_layout.vue
'
;
import
SecurityDashboardLayout
from
'
ee/security_dashboard/components/security_dashboard_layout.vue
'
;
import
InstanceSecurityVulnerabilities
from
'
./first_class_instance_security_dashboard_vulnerabilities.vue
'
;
import
InstanceSecurityVulnerabilities
from
'
./first_class_instance_security_dashboard_vulnerabilities.vue
'
;
import
VulnerabilitySeverity
from
'
ee/security_dashboard/components/vulnerability_severity.vue
'
;
import
VulnerabilitySeverity
from
'
ee/security_dashboard/components/vulnerability_severity.vue
'
;
import
Filters
from
'
ee/security_dashboard/components/first_class_vulnerability_filters.vue
'
;
export
default
{
export
default
{
components
:
{
components
:
{
SecurityDashboardLayout
,
SecurityDashboardLayout
,
InstanceSecurityVulnerabilities
,
InstanceSecurityVulnerabilities
,
VulnerabilitySeverity
,
VulnerabilitySeverity
,
Filters
,
},
},
props
:
{
props
:
{
dashboardDocumentation
:
{
dashboardDocumentation
:
{
...
@@ -23,14 +25,31 @@ export default {
...
@@ -23,14 +25,31 @@ export default {
required
:
true
,
required
:
true
,
},
},
},
},
data
()
{
return
{
filters
:
{},
};
},
methods
:
{
handleFilterChange
(
filters
)
{
this
.
filters
=
filters
;
},
},
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<security-dashboard-layout>
<security-dashboard-layout>
<template
#header
>
<header
class=
"page-title-holder flex-fill d-flex align-items-center"
>
<h2
class=
"page-title"
>
{{
s__
(
'
SecurityDashboard|Security Dashboard
'
)
}}
</h2>
</header>
<filters
@
filterChange=
"handleFilterChange"
/>
</
template
>
<instance-security-vulnerabilities
<instance-security-vulnerabilities
:dashboard-documentation=
"dashboardDocumentation"
:dashboard-documentation=
"dashboardDocumentation"
:empty-state-svg-path=
"emptyStateSvgPath"
:empty-state-svg-path=
"emptyStateSvgPath"
:filters=
"filters"
/>
/>
<
template
#aside
>
<
template
#aside
>
<vulnerability-severity
:endpoint=
"vulnerableProjectsEndpoint"
/>
<vulnerability-severity
:endpoint=
"vulnerableProjectsEndpoint"
/>
...
...
ee/app/assets/javascripts/security_dashboard/components/first_class_instance_security_dashboard_vulnerabilities.vue
View file @
00160427
...
@@ -22,6 +22,11 @@ export default {
...
@@ -22,6 +22,11 @@ export default {
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
},
},
filters
:
{
type
:
Object
,
required
:
false
,
default
:
()
=>
({}),
},
},
},
data
()
{
data
()
{
return
{
return
{
...
@@ -36,6 +41,7 @@ export default {
...
@@ -36,6 +41,7 @@ export default {
variables
()
{
variables
()
{
return
{
return
{
first
:
VULNERABILITIES_PER_PAGE
,
first
:
VULNERABILITIES_PER_PAGE
,
...
this
.
filters
,
};
};
},
},
update
:
({
vulnerabilities
})
=>
vulnerabilities
.
nodes
,
update
:
({
vulnerabilities
})
=>
vulnerabilities
.
nodes
,
...
...
ee/app/assets/javascripts/security_dashboard/graphql/instance_vulnerabilities.graphql
View file @
00160427
#import "~/graphql_shared/fragments/pageInfo.fragment.graphql"
#import "~/graphql_shared/fragments/pageInfo.fragment.graphql"
#import "ee/vulnerabilities/graphql/vulnerability.fragment.graphql"
#import "ee/vulnerabilities/graphql/vulnerability.fragment.graphql"
query
instance
(
$after
:
String
,
$first
:
Int
)
{
query
instance
(
vulnerabilities
(
after
:
$after
,
first
:
$first
)
{
$after
:
String
,
$first
:
Int
$severity
:
[
VulnerabilitySeverity
!]
$reportType
:
[
VulnerabilityReportType
!]
$state
:
[
VulnerabilityState
!]
)
{
vulnerabilities
(
after
:
$after
,
first
:
$first
,
severity
:
$severity
reportType
:
$reportType
state
:
$state
)
{
nodes
{
nodes
{
...
Vulnerability
...
Vulnerability
}
}
...
...
ee/spec/frontend/security_dashboard/components/first_class_instance_security_dashboard_spec.js
View file @
00160427
...
@@ -3,6 +3,7 @@ import SecurityDashboardLayout from 'ee/security_dashboard/components/security_d
...
@@ -3,6 +3,7 @@ import SecurityDashboardLayout from 'ee/security_dashboard/components/security_d
import
FirstClassInstanceDashboard
from
'
ee/security_dashboard/components/first_class_instance_security_dashboard.vue
'
;
import
FirstClassInstanceDashboard
from
'
ee/security_dashboard/components/first_class_instance_security_dashboard.vue
'
;
import
FirstClassInstanceVulnerabilities
from
'
ee/security_dashboard/components/first_class_instance_security_dashboard_vulnerabilities.vue
'
;
import
FirstClassInstanceVulnerabilities
from
'
ee/security_dashboard/components/first_class_instance_security_dashboard_vulnerabilities.vue
'
;
import
VulnerabilitySeverity
from
'
ee/security_dashboard/components/vulnerability_severity.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 Instance Dashboard Component
'
,
()
=>
{
describe
(
'
First Class Instance Dashboard Component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -13,6 +14,7 @@ describe('First Class Instance Dashboard Component', () => {
...
@@ -13,6 +14,7 @@ describe('First Class Instance Dashboard Component', () => {
const
findInstanceVulnerabilities
=
()
=>
wrapper
.
find
(
FirstClassInstanceVulnerabilities
);
const
findInstanceVulnerabilities
=
()
=>
wrapper
.
find
(
FirstClassInstanceVulnerabilities
);
const
findVulnerabilitySeverity
=
()
=>
wrapper
.
find
(
VulnerabilitySeverity
);
const
findVulnerabilitySeverity
=
()
=>
wrapper
.
find
(
VulnerabilitySeverity
);
const
findFilters
=
()
=>
wrapper
.
find
(
Filters
);
const
createWrapper
=
()
=>
{
const
createWrapper
=
()
=>
{
return
shallowMount
(
FirstClassInstanceDashboard
,
{
return
shallowMount
(
FirstClassInstanceDashboard
,
{
...
@@ -39,6 +41,20 @@ describe('First Class Instance Dashboard Component', () => {
...
@@ -39,6 +41,20 @@ describe('First Class Instance Dashboard Component', () => {
expect
(
findInstanceVulnerabilities
().
props
()).
toEqual
({
expect
(
findInstanceVulnerabilities
().
props
()).
toEqual
({
dashboardDocumentation
,
dashboardDocumentation
,
emptyStateSvgPath
,
emptyStateSvgPath
,
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
(
findInstanceVulnerabilities
().
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