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
8575ee72
Commit
8575ee72
authored
Mar 19, 2019
by
Mark Florian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use more explicit/less confusing function name
It takes options objects (id/name key/value pairs), not `Map`s.
parent
d9bb4cd1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ee/app/assets/javascripts/security_dashboard/store/modules/filters/state.js
...scripts/security_dashboard/store/modules/filters/state.js
+3
-3
No files found.
ee/app/assets/javascripts/security_dashboard/store/modules/filters/state.js
View file @
8575ee72
import
{
SEVERITY_LEVELS
,
REPORT_TYPES
,
BASE_FILTERS
}
from
'
./constants
'
;
const
mapToArray
=
map
=>
Object
.
entries
(
map
).
map
(([
id
,
name
])
=>
({
id
,
name
}));
const
optionsObjectToArray
=
obj
=>
Object
.
entries
(
obj
).
map
(([
id
,
name
])
=>
({
id
,
name
}));
export
default
()
=>
({
filters
:
[
{
name
:
'
Severity
'
,
id
:
'
severity
'
,
options
:
[
BASE_FILTERS
.
severity
,
...
map
ToArray
(
SEVERITY_LEVELS
)],
options
:
[
BASE_FILTERS
.
severity
,
...
optionsObject
ToArray
(
SEVERITY_LEVELS
)],
selection
:
new
Set
([
'
all
'
]),
},
{
name
:
'
Report type
'
,
id
:
'
report_type
'
,
options
:
[
BASE_FILTERS
.
report_type
,
...
map
ToArray
(
REPORT_TYPES
)],
options
:
[
BASE_FILTERS
.
report_type
,
...
optionsObject
ToArray
(
REPORT_TYPES
)],
selection
:
new
Set
([
'
all
'
]),
},
{
...
...
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