Commit 98eaa4b4 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Removed tooltip from clone dropdown

parent af687aa1
...@@ -17,13 +17,14 @@ export default class Project { ...@@ -17,13 +17,14 @@ export default class Project {
$('a', $cloneOptions).on('click', (e) => { $('a', $cloneOptions).on('click', (e) => {
const $this = $(e.currentTarget); const $this = $(e.currentTarget);
const url = $this.attr('href'); const url = $this.attr('href');
const activeText = $this.find('.dropdown-menu-inner-title').text();
e.preventDefault(); e.preventDefault();
$('.is-active', $cloneOptions).not($this).removeClass('is-active'); $('.is-active', $cloneOptions).not($this).removeClass('is-active');
$this.toggleClass('is-active'); $this.toggleClass('is-active');
$projectCloneField.val(url); $projectCloneField.val(url);
$cloneBtnText.text($this.text()); $cloneBtnText.text(activeText);
$('#modal-geo-info').data({ $('#modal-geo-info').data({
cloneUrlSecondary: $this.attr('href'), cloneUrlSecondary: $this.attr('href'),
......
...@@ -57,44 +57,36 @@ module ButtonHelper ...@@ -57,44 +57,36 @@ module ButtonHelper
end end
def http_clone_button(project, placement = 'right', append_link: true) def http_clone_button(project, placement = 'right', append_link: true)
klass = 'http-selector'
klass << ' has-tooltip' if current_user.try(:require_extra_setup_for_git_auth?)
protocol = gitlab_config.protocol.upcase protocol = gitlab_config.protocol.upcase
tooltip_title = protocol_description =
if current_user.try(:require_password_creation_for_git?) if current_user.try(:require_password_creation?)
_("Set a password on your account to pull or push via %{protocol}.") % { protocol: protocol } _("Set a password on your account to pull or push via %{protocol}.") % { protocol: protocol }
else else
_("Create a personal access token on your account to pull or push via %{protocol}.") % { protocol: protocol } _("Create a personal access token on your account to pull or push via %{protocol}.") % { protocol: protocol }
end end
content_tag (append_link ? :a : :span), protocol, protocol_element_output = content_tag(:strong, protocol, class: 'dropdown-menu-inner-title')
class: klass,
href: (project.http_url_to_repo if append_link), if current_user.try(:require_password_creation?) || current_user.try(:require_personal_access_token_creation_for_git_auth?)
data: { protocol_element_output << content_tag(:span, protocol_description, class: 'dropdown-menu-inner-content')
html: true,
placement: placement,
container: 'body',
title: tooltip_title,
primary_url: (geo_primary_http_url_to_repo(project) if Gitlab::Geo.secondary?)
}
end end
def ssh_clone_button(project, placement = 'right', append_link: true) content_tag (append_link ? :a : :span),
klass = 'ssh-selector' protocol_element_output,
klass << ' has-tooltip' if current_user.try(:require_ssh_key?) class: 'http-selector',
href: (project.http_url_to_repo if append_link)
end
content_tag (append_link ? :a : :span), 'SSH', def ssh_clone_button(project, append_link: true)
class: klass, ssh_description = _('Add an SSH key to your profile to pull or push via SSH.')
href: (project.ssh_url_to_repo if append_link), ssh_element_output = content_tag(:strong, 'SSH', class: 'dropdown-menu-inner-title')
data: { ssh_element_output << content_tag(:span, ssh_description, class: 'dropdown-menu-inner-content') if current_user.try(:require_ssh_key?)
html: true,
placement: placement, content_tag (append_link ? :a : :span),
container: 'body', ssh_element_output,
title: _('Add an SSH key to your profile to pull or push via SSH.'), class: 'ssh-selector',
primary_url: (geo_primary_ssh_url_to_repo(project) if Gitlab::Geo.secondary?) href: (project.ssh_url_to_repo if append_link)
}
end end
def kerberos_clone_button(project) def kerberos_clone_button(project)
......
---
title: Removed tooltip from clone dropdown
merge_request: 15334
author:
type: other
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment