Commit 25ad01ff authored by Alfredo Sumaran's avatar Alfredo Sumaran

Provide accessLevel to instante dropdown classes

parent 527d55f1
(global => { (global => {
global.gl = global.gl || {}; global.gl = global.gl || {};
const ACCESS_LEVELS = {
MERGE: 'merge_access_levels',
PUSH: 'push_access_levels',
};
gl.ProtectedBranchCreate = class { gl.ProtectedBranchCreate = class {
constructor() { constructor() {
this.$wrap = this.$form = $('#new_protected_branch'); this.$wrap = this.$form = $('#new_protected_branch');
...@@ -16,6 +21,7 @@ ...@@ -16,6 +21,7 @@
// Allowed to Merge dropdown // Allowed to Merge dropdown
new gl.AllowedToMergeDropdown({ new gl.AllowedToMergeDropdown({
accessLevel: ACCESS_LEVELS.MERGE,
$dropdown: $allowedToMergeDropdown, $dropdown: $allowedToMergeDropdown,
accessLevelsData: gon.merge_access_levels, accessLevelsData: gon.merge_access_levels,
onSelect: this.onSelectCallback onSelect: this.onSelectCallback
...@@ -23,6 +29,7 @@ ...@@ -23,6 +29,7 @@
// Allowed to Push dropdown // Allowed to Push dropdown
new gl.AllowedToPushDropdown({ new gl.AllowedToPushDropdown({
accessLevel: ACCESS_LEVELS.PUSH,
$dropdown: $allowedToPushDropdown, $dropdown: $allowedToPushDropdown,
accessLevelsData: gon.push_access_levels, accessLevelsData: gon.push_access_levels,
onSelect: this.onSelectCallback onSelect: this.onSelectCallback
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment