summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-04-12 15:47:40 +0000
committerClement Ho <clemmakesapps@gmail.com>2018-04-12 15:47:40 +0000
commitbbb24da922f7e501571b5f356fd68257e75e4d40 (patch)
treeb747bba5a16d9e9a2245b1f4ba2283ad74db2c95 /app/helpers
parent7ea7b2abe7e9fbf89d76037a5606aedac5743c49 (diff)
downloadgitlab-ce-bbb24da922f7e501571b5f356fd68257e75e4d40.tar.gz
Resolve "Clean up old project permissions frontend code"
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/projects_helper.rb66
1 files changed, 0 insertions, 66 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 15f48e43a28..a64b2acdd77 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -157,40 +157,6 @@ module ProjectsHelper
current_user&.recent_push(@project)
end
- def project_feature_access_select(field)
- # Don't show option "everyone with access" if project is private
- options = project_feature_options
-
- level = @project.project_feature.public_send(field) # rubocop:disable GitlabSecurity/PublicSend
-
- if @project.private?
- disabled_option = ProjectFeature::ENABLED
- highest_available_option = ProjectFeature::PRIVATE if level == disabled_option
- end
-
- options = options_for_select(
- options.invert,
- selected: highest_available_option || level,
- disabled: disabled_option
- )
-
- content_tag :div, class: "select-wrapper" do
- concat(
- content_tag(
- :select,
- options,
- name: "project[project_feature_attributes][#{field}]",
- id: "project_project_feature_attributes_#{field}",
- class: "pull-right form-control select-control #{repo_children_classes(field)} ",
- data: { field: field }
- )
- )
- concat(
- icon('chevron-down')
- )
- end.html_safe
- end
-
def link_to_autodeploy_doc
link_to _('About auto deploy'), help_page_path('ci/autodeploy/index'), target: '_blank'
end
@@ -274,16 +240,6 @@ module ProjectsHelper
private
- def repo_children_classes(field)
- needs_repo_check = [:merge_requests_access_level, :builds_access_level]
- return unless needs_repo_check.include?(field)
-
- classes = "project-repo-select js-repo-select"
- classes << " disabled" unless @project.feature_available?(:repository, current_user)
-
- classes
- end
-
def get_project_nav_tabs(project, current_user)
nav_tabs = [:home]
@@ -447,14 +403,6 @@ module ProjectsHelper
filtered_message.gsub(project.repository_storage_path.chomp('/'), "[REPOS PATH]")
end
- def project_feature_options
- {
- ProjectFeature::DISABLED => s_('ProjectFeature|Disabled'),
- ProjectFeature::PRIVATE => s_('ProjectFeature|Only team members'),
- ProjectFeature::ENABLED => s_('ProjectFeature|Everyone with access')
- }
- end
-
def project_child_container_class(view_path)
view_path == "projects/issues/issues" ? "prepend-top-default" : "project-show-#{view_path}"
end
@@ -463,20 +411,6 @@ module ProjectsHelper
IssuesFinder.new(current_user, project_id: project.id).execute
end
- def visibility_select_options(project, selected_level)
- level_options = Gitlab::VisibilityLevel.values.each_with_object([]) do |level, level_options|
- next if restricted_levels.include?(level)
-
- level_options << [
- visibility_level_label(level),
- { data: { description: visibility_level_description(level, project) } },
- level
- ]
- end
-
- options_for_select(level_options, selected_level)
- end
-
def restricted_levels
return [] if current_user.admin?