Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-07-14 06:42:16 +0300
committerTimothy Andrew <mail@timothyandrew.net>2016-07-29 12:50:39 +0300
commitf2df2966aabc601dd1d6a6f9e75ead84db8a2765 (patch)
tree541e68b69d76145ef55b04f6907ceaefe5a88b3d /app/controllers/projects/protected_branches_controller.rb
parentc647540c1010fd1e51bced1db90947aa00c83fa8 (diff)
Humanize protected branches' access levels at one location.
1. The model now contains this humanization data, which is the once source of truth. 2. Previously, this was being listed out in the dropdown component as well.
Diffstat (limited to 'app/controllers/projects/protected_branches_controller.rb')
-rw-r--r--app/controllers/projects/protected_branches_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/protected_branches_controller.rb b/app/controllers/projects/protected_branches_controller.rb
index 126358bfe77..ddf1824ccb9 100644
--- a/app/controllers/projects/protected_branches_controller.rb
+++ b/app/controllers/projects/protected_branches_controller.rb
@@ -9,7 +9,9 @@ class Projects::ProtectedBranchesController < Projects::ApplicationController
def index
@protected_branch = @project.protected_branches.new
- gon.push({ open_branches: @project.open_branches.map { |br| { text: br.name, id: br.name, title: br.name } } })
+ gon.push({ open_branches: @project.open_branches.map { |br| { text: br.name, id: br.name, title: br.name } },
+ push_access_levels: ProtectedBranch::PushAccessLevel.human_access_levels.map { |id, text| { id: id, text: text } },
+ merge_access_levels: ProtectedBranch::MergeAccessLevel.human_access_levels.map { |id, text| { id: id, text: text } } })
end
def create