From 6f03ddcdc3af1fbb840498a0e4765458079f0b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20D=C3=A1vila?= Date: Tue, 29 Aug 2017 00:49:01 -0500 Subject: Address some suggestions from first code review --- app/helpers/visibility_level_helper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/helpers/visibility_level_helper.rb') diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb index 347f796fdc1..caadc12019c 100644 --- a/app/helpers/visibility_level_helper.rb +++ b/app/helpers/visibility_level_helper.rb @@ -65,7 +65,7 @@ module VisibilityLevelHelper def restricted_visibility_level_description(level) level_name = Gitlab::VisibilityLevel.level_name(level) - "#{level_name.capitalize} visibilitiy has been restricted by the administrator." + "#{level_name.capitalize} visibility has been restricted by the administrator." end def disallowed_visibility_level_description(level, form_model) @@ -82,11 +82,11 @@ module VisibilityLevelHelper reasons = [] unless project.visibility_level_allowed_as_fork?(level) - reasons << "the fork source project has lower visibility" + reasons << project.visibility_error_for(:fork, level: level_name) end unless project.visibility_level_allowed_by_group?(level) - reasons << "the visibility of #{project.group.name} is #{project.group.visibility}" + reasons << project.visibility_error_for(:group, level: level_name, group_level: project.group.visibility) end reasons = reasons.any? ? ' because ' + reasons.to_sentence : '' @@ -98,15 +98,15 @@ module VisibilityLevelHelper reasons = [] unless group.visibility_level_allowed_by_projects?(level) - reasons << "it contains projects with higher visibility" + reasons << group.visibility_error_for(:projects, level: level_name) end unless group.visibility_level_allowed_by_sub_groups?(level) - reasons << "it contains sub-groups with higher visibility" + reasons << group.visibility_error_for(:sub_groups, level: level_name) end unless group.visibility_level_allowed_by_parent?(level) - reasons << "the visibility of its parent group is #{group.parent.visibility}" + reasons << group.visibility_error_for(:parent, level: level_name, parent_level: group.parent.visibility) end reasons = reasons.any? ? ' because ' + reasons.to_sentence : '' -- cgit v1.2.3