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
ff691472
Commit
ff691472
authored
Jun 01, 2017
by
kushalpandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use array reduce instead of forEach
parent
73c4cfb7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
app/assets/javascripts/protected_tags/protected_tag_edit.js
app/assets/javascripts/protected_tags/protected_tag_edit.js
+6
-5
No files found.
app/assets/javascripts/protected_tags/protected_tag_edit.js
View file @
ff691472
...
@@ -40,13 +40,14 @@ export default class ProtectedTagEdit {
...
@@ -40,13 +40,14 @@ export default class ProtectedTagEdit {
}
}
updatePermissions
()
{
updatePermissions
()
{
const
formData
=
{};
const
formData
=
Object
.
keys
(
ACCESS_LEVELS
).
reduce
((
acc
,
level
)
=>
{
/* eslint-disable no-param-reassign */
Object
.
keys
(
ACCESS_LEVELS
).
forEach
((
level
)
=>
{
const
accessLevelName
=
ACCESS_LEVELS
[
level
];
const
accessLevelName
=
ACCESS_LEVELS
[
level
];
const
inputData
=
this
[
`
${
accessLevelName
}
_dropdown`
].
getInputData
(
accessLevelName
);
acc
[
`
${
accessLevelName
}
_attributes`
]
=
inputData
;
formData
[
`
${
accessLevelName
}
_attributes`
]
=
this
[
`
${
accessLevelName
}
_dropdown`
].
getInputData
(
accessLevelName
)
;
return
acc
;
});
}
,
{}
);
return
$
.
ajax
({
return
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
...
...
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