diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2018-08-03 23:52:01 +0300 |
---|---|---|
committer | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2018-08-08 18:28:27 +0300 |
commit | b6ba8cc696a45e58bde24a592a9c315a0eb16744 (patch) | |
tree | 1e04dca8822b719f94a459292cccb5bc699ed696 /app/helpers/button_helper.rb | |
parent | 6f21652f0b79a614ad809dc028aaa28aee16732e (diff) |
Add ability suppress the global "You won't be able [use] SSH" message
This fixes gitlab-org/gitlab-ce#49953, as noted in the documentation
this feature is intended to be used when SSH certificates are
enabled. Then this warning becomes not only pointless, but also
misleading.
This builds on top of gitlab-org/gitlab-ce!21009 since both need to
modify the same documentation, which avoids a merge conflict.
See also the gitlab-org/gitlab-ce#49218 issue and associated merge
request.
Diffstat (limited to 'app/helpers/button_helper.rb')
-rw-r--r-- | app/helpers/button_helper.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb index 0171a880164..7adc882bc47 100644 --- a/app/helpers/button_helper.rb +++ b/app/helpers/button_helper.rb @@ -73,7 +73,11 @@ module ButtonHelper end def ssh_clone_button(project, append_link: true) - dropdown_description = _("You won't be able to pull or push project code via SSH until you add an SSH key to your profile") if current_user.try(:require_ssh_key?) + if Gitlab::CurrentSettings.user_show_add_ssh_key_message? && + current_user.try(:require_ssh_key?) + dropdown_description = _("You won't be able to pull or push project code via SSH until you add an SSH key to your profile") + end + append_url = project.ssh_url_to_repo if append_link dropdown_item_with_description('SSH', dropdown_description, href: append_url) |