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
0e14bb24
Commit
0e14bb24
authored
Jul 27, 2020
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Default state filter to confirmed and confirmed
- Update tests - Update documentation
parent
25a98527
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
5 deletions
+35
-5
doc/user/application_security/security_dashboard/index.md
doc/user/application_security/security_dashboard/index.md
+4
-0
ee/app/assets/javascripts/security_dashboard/components/first_class_vulnerability_filters.vue
...ashboard/components/first_class_vulnerability_filters.vue
+6
-1
ee/app/assets/javascripts/security_dashboard/store/modules/filters/constants.js
...pts/security_dashboard/store/modules/filters/constants.js
+4
-0
ee/changelogs/unreleased/217472-do-not-display-dismissed-by-default.yml
...unreleased/217472-do-not-display-dismissed-by-default.yml
+5
-0
ee/spec/frontend/security_dashboard/components/first_class_vulnerability_filters_spec.js
...oard/components/first_class_vulnerability_filters_spec.js
+16
-4
No files found.
doc/user/application_security/security_dashboard/index.md
View file @
0e14bb24
...
@@ -69,6 +69,8 @@ You can filter the vulnerabilities by:
...
@@ -69,6 +69,8 @@ You can filter the vulnerabilities by:
-
Severity
-
Severity
-
Report type
-
Report type
By default, detected and confirmed vulnerabilities will be displayed.
You can also dismiss vulnerabilities in the table:
You can also dismiss vulnerabilities in the table:
1.
Select the checkbox for each vulnerability you want to dismiss.
1.
Select the checkbox for each vulnerability you want to dismiss.
...
@@ -97,6 +99,8 @@ You can filter which vulnerabilities the Security Dashboard displays by:
...
@@ -97,6 +99,8 @@ You can filter which vulnerabilities the Security Dashboard displays by:
-
Report type
-
Report type
-
Project
-
Project
By default, detected and confirmed vulnerabilities will be displayed.
A table lists the vulnerabilities, sorted by severity. The table shows each vulnerability's status,
A table lists the vulnerabilities, sorted by severity. The table shows each vulnerability's status,
severity, and description. Clicking a vulnerability takes you to its
[
Vulnerability Details
](
../vulnerabilities
)
severity, and description. Clicking a vulnerability takes you to its
[
Vulnerability Details
](
../vulnerabilities
)
page to view more information about that vulnerability.
page to view more information about that vulnerability.
...
...
ee/app/assets/javascripts/security_dashboard/components/first_class_vulnerability_filters.vue
View file @
0e14bb24
<
script
>
<
script
>
import
{
isEqual
}
from
'
lodash
'
;
import
{
isEqual
}
from
'
lodash
'
;
import
{
ALL
}
from
'
ee/security_dashboard/store/modules/filters/constants
'
;
import
{
ALL
,
STATE
}
from
'
ee/security_dashboard/store/modules/filters/constants
'
;
import
{
setFilter
}
from
'
ee/security_dashboard/store/modules/filters/utils
'
;
import
{
setFilter
}
from
'
ee/security_dashboard/store/modules/filters/utils
'
;
import
DashboardFilter
from
'
ee/security_dashboard/components/filter.vue
'
;
import
DashboardFilter
from
'
ee/security_dashboard/components/filter.vue
'
;
import
{
initFirstClassVulnerabilityFilters
,
mapProjects
}
from
'
ee/security_dashboard/helpers
'
;
import
{
initFirstClassVulnerabilityFilters
,
mapProjects
}
from
'
ee/security_dashboard/helpers
'
;
...
@@ -67,6 +67,11 @@ export default {
...
@@ -67,6 +67,11 @@ export default {
},
},
},
},
},
},
created
()
{
if
(
Object
.
keys
(
this
.
selectedFilters
).
length
===
0
)
{
this
.
$router
.
push
({
query
:
{
state
:
[
STATE
.
DETECTED
,
STATE
.
CONFIRMED
]
}
});
}
},
methods
:
{
methods
:
{
setFilter
(
options
)
{
setFilter
(
options
)
{
this
.
filters
=
setFilter
(
this
.
filters
,
options
);
this
.
filters
=
setFilter
(
this
.
filters
,
options
);
...
...
ee/app/assets/javascripts/security_dashboard/store/modules/filters/constants.js
View file @
0e14bb24
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
export
const
ALL
=
'
all
'
;
export
const
ALL
=
'
all
'
;
export
const
STATE
=
{
DETECTED
:
'
DETECTED
'
,
CONFIRMED
:
'
CONFIRMED
'
,
};
export
const
BASE_FILTERS
=
{
export
const
BASE_FILTERS
=
{
severity
:
{
severity
:
{
...
...
ee/changelogs/unreleased/217472-do-not-display-dismissed-by-default.yml
0 → 100644
View file @
0e14bb24
---
title
:
By default display only confirmed and detected vulnerabilities
merge_request
:
37914
author
:
type
:
changed
ee/spec/frontend/security_dashboard/components/first_class_vulnerability_filters_spec.js
View file @
0e14bb24
...
@@ -43,10 +43,6 @@ describe('First class vulnerability filters component', () => {
...
@@ -43,10 +43,6 @@ describe('First class vulnerability filters component', () => {
expect
(
findFilters
()).
toHaveLength
(
filters
.
length
);
expect
(
findFilters
()).
toHaveLength
(
filters
.
length
);
});
});
it
(
'
should pass down the filter information to the first filter
'
,
()
=>
{
expect
(
findStateFilter
().
props
().
filter
).
toEqual
(
filters
[
0
]);
});
it
(
'
should call the setFilter mutation when setting a filter
'
,
()
=>
{
it
(
'
should call the setFilter mutation when setting a filter
'
,
()
=>
{
const
stub
=
jest
.
fn
();
const
stub
=
jest
.
fn
();
const
options
=
{
foo
:
'
bar
'
};
const
options
=
{
foo
:
'
bar
'
};
...
@@ -108,6 +104,22 @@ describe('First class vulnerability filters component', () => {
...
@@ -108,6 +104,22 @@ describe('First class vulnerability filters component', () => {
});
});
});
});
describe
(
'
when no filter is persisted in the URL
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
({
propsData
:
{
projects
},
});
});
it
(
'
should redirect the user to an updated the URL and default the filters to CONFIRMED + DETECTED state
'
,
()
=>
{
expect
(
findStateFilter
().
props
(
'
filter
'
)).
toEqual
(
expect
.
objectContaining
({
selection
:
new
Set
([
'
DETECTED
'
,
'
CONFIRMED
'
]),
}),
);
});
});
describe
.
each
`
describe
.
each
`
filter | value | selector
filter | value | selector
${
'
state
'
}
|
${
'
DETECTED,DISMISSED
'
}
|
${
findStateFilter
}
${
'
state
'
}
|
${
'
DETECTED,DISMISSED
'
}
|
${
findStateFilter
}
...
...
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