diff options
author | Mike Greiling <mgreiling@gitlab.com> | 2017-06-06 08:28:39 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-06-06 08:28:39 +0000 |
commit | e245d7eebe747378f4158b30634ab0da4df59117 (patch) | |
tree | c710812e72c181c066728817ef06c90e836acee3 /app/helpers | |
parent | 17feb2faa71416b3459003eeb2a877f2c65dd3ef (diff) | |
download | gitlab-ce-e245d7eebe747378f4158b30634ab0da4df59117.tar.gz |
Resolve "When changing project visibility setting, change other dropdowns automatically"
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/projects_helper.rb | 10 | ||||
-rw-r--r-- | app/helpers/visibility_level_helper.rb | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 7b0584c42a2..f74e61c9481 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -138,11 +138,15 @@ module ProjectsHelper if @project.private? level = @project.project_feature.send(field) - options.delete('Everyone with access') - highest_available_option = options.values.max if level == ProjectFeature::ENABLED + disabled_option = ProjectFeature::ENABLED + highest_available_option = ProjectFeature::PRIVATE if level == disabled_option end - options = options_for_select(options, selected: highest_available_option || @project.project_feature.public_send(field)) + options = options_for_select( + options, + selected: highest_available_option || @project.project_feature.public_send(field), + disabled: disabled_option + ) content_tag( :select, diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb index b4aaf498068..50757b01538 100644 --- a/app/helpers/visibility_level_helper.rb +++ b/app/helpers/visibility_level_helper.rb @@ -31,9 +31,9 @@ module VisibilityLevelHelper when Gitlab::VisibilityLevel::PRIVATE "Project access must be granted explicitly to each user." when Gitlab::VisibilityLevel::INTERNAL - "The project can be cloned by any logged in user." + "The project can be accessed by any logged in user." when Gitlab::VisibilityLevel::PUBLIC - "The project can be cloned without any authentication." + "The project can be accessed without any authentication." end end |