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
7001c914
Commit
7001c914
authored
Aug 19, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass access level data to dropdowns
parent
3a343be8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
app/assets/javascripts/protected_branch_access_dropdown.js.es6
...ssets/javascripts/protected_branch_access_dropdown.js.es6
+3
-2
app/assets/javascripts/protected_branch_create.js.es6
app/assets/javascripts/protected_branch_create.js.es6
+2
-2
app/assets/javascripts/protected_branch_edit.js.es6
app/assets/javascripts/protected_branch_edit.js.es6
+3
-1
No files found.
app/assets/javascripts/protected_branch_access_dropdown.js.es6
View file @
7001c914
...
...
@@ -3,10 +3,11 @@
gl.ProtectedBranchAccessDropdown = class {
constructor(options) {
const { $dropdown, onSelect, onHide, accessLevel } = options;
const { $dropdown, onSelect, onHide, accessLevel
, accessLevelsData
} = options;
const self = this;
this.accessLevel = accessLevel;
this.accessLevelsData = accessLevelsData;
this.$dropdown = $dropdown;
this.$wrap = this.$dropdown.parents().eq(1); // TODO: Find a better way to get the wrap element
this.usersPath = '/autocomplete/users.json';
...
...
@@ -85,7 +86,7 @@
return user;
});
let mergeAccessLevels =
gon.merge_access_levels
.map((level) => {
let mergeAccessLevels =
this.accessLevelsData
.map((level) => {
level.type = 'role';
return level;
});
...
...
app/assets/javascripts/protected_branch_create.js.es6
View file @
7001c914
...
...
@@ -17,14 +17,14 @@
// Allowed to Merge dropdown
new gl.allowedToMergeDropdown({
$dropdown: $allowedToMergeDropdown,
d
ata: gon.merge_access_levels,
accessLevelsD
ata: gon.merge_access_levels,
onSelect: this.onSelectCallback
});
// Allowed to Push dropdown
new gl.allowedToPushDropdown({
$dropdown: $allowedToPushDropdown,
d
ata: gon.push_access_levels,
accessLevelsD
ata: gon.push_access_levels,
onSelect: this.onSelectCallback
});
...
...
app/assets/javascripts/protected_branch_edit.js.es6
View file @
7001c914
...
...
@@ -35,14 +35,16 @@
// Allowed to merge dropdown
new gl.allowedToMergeDropdown({
accessLevel: ACCESS_LEVELS.MERGE,
accessLevelsData: gon.merge_access_levels,
$dropdown: this.$allowedToMergeDropdown,
onSelect: this.onSelectOption.bind(this),
onHide: this.onDropdownHide.bind(this)
,
onHide: this.onDropdownHide.bind(this)
});
// Allowed to push dropdown
new gl.allowedToPushDropdown({
accessLevel: ACCESS_LEVELS.PUSH,
accessLevelsData: gon.push_access_levels,
$dropdown: this.$allowedToPushDropdown,
onSelect: this.onSelectOption.bind(this),
onHide: this.onDropdownHide.bind(this)
...
...
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