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
5d45ffe1
Commit
5d45ffe1
authored
Jun 25, 2020
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document getFormattedSummary helper
parent
c72e5b3a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
ee/app/assets/javascripts/security_dashboard/helpers.js
ee/app/assets/javascripts/security_dashboard/helpers.js
+26
-0
No files found.
ee/app/assets/javascripts/security_dashboard/helpers.js
View file @
5d45ffe1
...
...
@@ -48,6 +48,32 @@ export const initFirstClassVulnerabilityFilters = projects => {
return
filters
;
};
/**
* Provided a security reports summary from the GraphQL API, this returns an array of arrays
* representing a properly formatted report ready to be displayed in the UI. Each sub-array consists
* of the user-friend report's name, and the summary's payload. Note that summary entries are
* considered empty and are filtered out of the return if the payload is `null` or don't include
* a vulnerabilitiesCount property. Report types whose name can't be matched to a user-friendly
* name are filtered out as well.
*
* Take the following summary for example:
* {
* containerScanning: { vulnerabilitiesCount: 123 },
* invalidReportType: { vulnerabilitiesCount: 123 },
* dast: null,
* }
*
* The formatted summary would look like this:
* [
* ['containerScanning', { vulnerabilitiesCount: 123 }]
* ]
*
* Note that `invalidReportType` was filtered out as it can't be matched with a user-friendly name,
* and the DAST report was omitted because it's empty (`null`).
*
* @param {Object} rawSummary
* @returns {Array}
*/
export
const
getFormattedSummary
=
(
rawSummary
=
{})
=>
{
if
(
!
isPlainObject
(
rawSummary
))
{
return
[];
...
...
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