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
dbeea6c3
Commit
dbeea6c3
authored
Jul 24, 2020
by
Savas Vedova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add info and unknown counts
- Update tests
parent
36f595bb
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
18 deletions
+26
-18
ee/app/assets/javascripts/security_dashboard/components/vulnerability_count_list_layout.vue
..._dashboard/components/vulnerability_count_list_layout.vue
+1
-3
ee/app/assets/javascripts/security_dashboard/graphql/project_vulnerability_severities_count.graphql
...rd/graphql/project_vulnerability_severities_count.graphql
+2
-0
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/constants.js
...rity_dashboard/store/modules/vulnerabilities/constants.js
+3
-0
ee/changelogs/unreleased/230384-add-counters-for-severities-on-security-dashboards.yml
...84-add-counters-for-severities-on-security-dashboards.yml
+5
-0
ee/spec/frontend/security_dashboard/components/vulnerability_count_list_layout_spec.js
...hboard/components/vulnerability_count_list_layout_spec.js
+13
-15
ee/spec/frontend/security_dashboard/components/vulnerability_count_list_spec.js
...ity_dashboard/components/vulnerability_count_list_spec.js
+2
-0
No files found.
ee/app/assets/javascripts/security_dashboard/components/vulnerability_count_list_layout.vue
View file @
dbeea6c3
<
script
>
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
CRITICAL
,
HIGH
,
MEDIUM
,
LOW
}
from
'
../store/modules/vulnerabilities/constants
'
;
import
{
SEVERITIES
}
from
'
../store/modules/vulnerabilities/constants
'
;
import
VulnerabilityCount
from
'
./vulnerability_count.vue
'
;
const
SEVERITIES
=
[
CRITICAL
,
HIGH
,
MEDIUM
,
LOW
];
export
default
{
components
:
{
VulnerabilityCount
,
...
...
ee/app/assets/javascripts/security_dashboard/graphql/project_vulnerability_severities_count.graphql
View file @
dbeea6c3
...
...
@@ -5,6 +5,8 @@ query vulnerabilitySeveritiesCount($fullPath: ID!) {
high
low
medium
info
unknown
}
}
}
ee/app/assets/javascripts/security_dashboard/store/modules/vulnerabilities/constants.js
View file @
dbeea6c3
...
...
@@ -4,6 +4,9 @@ export const CRITICAL = 'critical';
export
const
HIGH
=
'
high
'
;
export
const
MEDIUM
=
'
medium
'
;
export
const
LOW
=
'
low
'
;
export
const
INFO
=
'
info
'
;
export
const
UNKNOWN
=
'
unknown
'
;
export
const
SEVERITIES
=
[
CRITICAL
,
HIGH
,
MEDIUM
,
LOW
,
INFO
,
UNKNOWN
];
export
const
DAY_IN_MS
=
1000
*
60
*
60
*
24
;
...
...
ee/changelogs/unreleased/230384-add-counters-for-severities-on-security-dashboards.yml
0 → 100644
View file @
dbeea6c3
---
title
:
Add info and unknown counts along other severity counts
merge_request
:
37763
author
:
type
:
added
ee/spec/frontend/security_dashboard/components/vulnerability_count_list_layout_spec.js
View file @
dbeea6c3
...
...
@@ -33,7 +33,7 @@ describe('Vulnerabilities count list component', () => {
});
describe
(
'
when loaded and has a list of vulnerability counts
'
,
()
=>
{
const
vulnerabilitiesCount
=
{
critical
:
5
,
medium
:
3
};
const
vulnerabilitiesCount
=
{
critical
:
5
,
medium
:
3
,
info
:
1
,
unknown
:
2
,
low
:
0
,
high
:
0
};
beforeEach
(()
=>
{
wrapper
=
createWrapper
({
propsData
:
{
vulnerabilitiesCount
}
});
...
...
@@ -45,20 +45,18 @@ describe('Vulnerabilities count list component', () => {
});
});
it
(
'
shows the counts
'
,
()
=>
{
const
vulnerabilites
=
findVulnerability
();
const
critical
=
vulnerabilites
.
at
(
0
);
const
high
=
vulnerabilites
.
at
(
1
);
const
medium
=
vulnerabilites
.
at
(
2
);
expect
(
critical
.
props
(
'
severity
'
)).
toBe
(
'
critical
'
);
expect
(
critical
.
props
(
'
count
'
)).
toBe
(
5
);
expect
(
high
.
props
(
'
severity
'
)).
toBe
(
'
high
'
);
expect
(
high
.
props
(
'
count
'
)).
toBe
(
0
);
expect
(
medium
.
props
(
'
severity
'
)).
toBe
(
'
medium
'
);
expect
(
medium
.
props
(
'
count
'
)).
toBe
(
3
);
it
.
each
`
index | count | name
${
0
}
|
${
vulnerabilitiesCount
.
critical
}
|
${
'
critical
'
}
${
1
}
|
${
vulnerabilitiesCount
.
high
}
|
${
'
high
'
}
${
2
}
|
${
vulnerabilitiesCount
.
medium
}
|
${
'
medium
'
}
${
3
}
|
${
vulnerabilitiesCount
.
low
}
|
${
'
low
'
}
${
4
}
|
${
vulnerabilitiesCount
.
info
}
|
${
'
info
'
}
${
5
}
|
${
vulnerabilitiesCount
.
unknown
}
|
${
'
unknown
'
}
`
(
'
shows count for $name correctly
'
,
({
index
,
count
,
name
})
=>
{
const
vulnerability
=
findVulnerability
().
at
(
index
);
expect
(
vulnerability
.
props
(
'
severity
'
)).
toBe
(
name
);
expect
(
vulnerability
.
props
(
'
count
'
)).
toBe
(
count
);
});
});
...
...
ee/spec/frontend/security_dashboard/components/vulnerability_count_list_spec.js
View file @
dbeea6c3
...
...
@@ -37,6 +37,7 @@ describe('Vulnerabilities count list component', () => {
critical
:
5
,
high
:
3
,
low
:
19
,
info
:
4
,
},
});
});
...
...
@@ -50,6 +51,7 @@ describe('Vulnerabilities count list component', () => {
critical
:
5
,
high
:
3
,
low
:
19
,
info
:
4
,
});
});
});
...
...
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