summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-08-26 02:43:45 -0500
committerMike Greiling <mike@pixelcog.com>2017-08-26 03:31:15 -0500
commit0a8d0924fe9a1525b92423411dc1bfcdc9760833 (patch)
tree38c58b16e9c52d92a57696c9a9b5a428f5c07005
parent3488e8f011e493a89df60cd0db0fff4086f42bd5 (diff)
downloadgitlab-ce-0a8d0924fe9a1525b92423411dc1bfcdc9760833.tar.gz
expand the help text with links and additional instructions
-rw-r--r--app/assets/javascripts/project_visibility.js8
-rw-r--r--app/helpers/namespaces_helper.rb9
2 files changed, 14 insertions, 3 deletions
diff --git a/app/assets/javascripts/project_visibility.js b/app/assets/javascripts/project_visibility.js
index b43c8ba56e2..c3f5e8cb907 100644
--- a/app/assets/javascripts/project_visibility.js
+++ b/app/assets/javascripts/project_visibility.js
@@ -3,7 +3,7 @@ function setVisibilityOptions(namespaceSelector) {
return;
}
const selectedNamespace = namespaceSelector.options[namespaceSelector.selectedIndex];
- const { name, visibility, visibilityLevel } = selectedNamespace.dataset;
+ const { name, visibility, visibilityLevel, showPath, editPath } = selectedNamespace.dataset;
document.querySelectorAll('.visibility-level-setting .radio').forEach((option) => {
const optionInput = option.querySelector('input[type=radio]');
@@ -18,7 +18,11 @@ function setVisibilityOptions(namespaceSelector) {
optionInput.disabled = true;
const reason = option.querySelector('.option-disabled-reason');
if (reason) {
- reason.innerText = `This project cannot be ${optionName} because the visibility of ${name} is ${visibility}.`;
+ reason.innerHTML =
+ `This project cannot be ${optionName} because the visibility of
+ <a href="${showPath}">${name}</a> is ${visibility}. To make this project
+ ${optionName}, you must first <a href="${editPath}">change the visibility</a>
+ of the parent group.`;
}
} else {
option.classList.remove('disabled');
diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb
index ca149ac2c20..33d6875a704 100644
--- a/app/helpers/namespaces_helper.rb
+++ b/app/helpers/namespaces_helper.rb
@@ -41,7 +41,14 @@ module NamespacesHelper
elements = namespaces.sort_by(&:human_name).map! do |n|
[display_path ? n.full_path : n.human_name, n.id,
- data: { options_parent: type, visibility_level: n.visibility_level_value, visibility: n.visibility, name: n.name }]
+ data: {
+ options_parent: type,
+ visibility_level: n.visibility_level_value,
+ visibility: n.visibility,
+ name: n.name,
+ show_path: n.is_a?(Group) ? group_path(n) : user_path(n),
+ edit_path: n.is_a?(Group) ? edit_group_path(n) : nil
+ }]
end
[type.camelize, elements]