Commit 67ef62a6 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

UX adjustments and spec corrections

parent 614b8679
...@@ -414,6 +414,10 @@ ...@@ -414,6 +414,10 @@
.clone-dropdown-btn { .clone-dropdown-btn {
background-color: $white-light; background-color: $white-light;
} }
.clone-options-dropdown {
min-width: 240px;
}
} }
.project-repo-buttons { .project-repo-buttons {
......
...@@ -31,9 +31,9 @@ module ApplicationSettingsHelper ...@@ -31,9 +31,9 @@ module ApplicationSettingsHelper
def enabled_project_button(project, protocol) def enabled_project_button(project, protocol)
case protocol case protocol
when 'ssh' when 'ssh'
ssh_clone_button(project, 'bottom', append_link: false) ssh_clone_button(project, append_link: false)
else else
http_clone_button(project, 'bottom', append_link: false) http_clone_button(project, append_link: false)
end end
end end
......
...@@ -56,7 +56,7 @@ module ButtonHelper ...@@ -56,7 +56,7 @@ module ButtonHelper
end end
end end
def http_clone_button(project, placement = 'right', append_link: true) def http_clone_button(project, append_link: true)
protocol = gitlab_config.protocol.upcase protocol = gitlab_config.protocol.upcase
protocol_description = protocol_description =
...@@ -79,7 +79,7 @@ module ButtonHelper ...@@ -79,7 +79,7 @@ module ButtonHelper
end end
def ssh_clone_button(project, append_link: true) def ssh_clone_button(project, append_link: true)
ssh_description = _('Add an SSH key to your profile to pull or push via SSH.') ssh_description = _("You won't be able to pull or push project code via SSH until you add an SSH key to your profile")
ssh_element_output = content_tag(:strong, 'SSH', class: 'dropdown-menu-inner-title') ssh_element_output = content_tag(:strong, 'SSH', class: 'dropdown-menu-inner-title')
ssh_element_output << content_tag(:span, ssh_description, class: 'dropdown-menu-inner-content') if current_user.try(:require_ssh_key?) ssh_element_output << content_tag(:span, ssh_description, class: 'dropdown-menu-inner-content') if current_user.try(:require_ssh_key?)
......
...@@ -26,9 +26,10 @@ describe ButtonHelper do ...@@ -26,9 +26,10 @@ describe ButtonHelper do
context 'when user has password automatically set' do context 'when user has password automatically set' do
let(:user) { create(:user, password_automatically_set: true) } let(:user) { create(:user, password_automatically_set: true) }
it 'shows a password tooltip' do it 'shows the password text on the dropdown' do
expect(element.attr('class')).to include(has_tooltip_class) expect(element.children.length).to eq(2)
expect(element.attr('data-title')).to eq('Set a password on your account to pull or push via HTTP.') expect(element.children[1].name).to eq('span')
expect(element.children[1].children[0].text).to eq('Set a password on your account to pull or push via HTTP.')
end end
end end
end end
...@@ -40,8 +41,9 @@ describe ButtonHelper do ...@@ -40,8 +41,9 @@ describe ButtonHelper do
context 'when user has no personal access tokens' do context 'when user has no personal access tokens' do
it 'has a personal access token tooltip ' do it 'has a personal access token tooltip ' do
expect(element.attr('class')).to include(has_tooltip_class) expect(element.children.length).to eq(2)
expect(element.attr('data-title')).to eq('Create a personal access token on your account to pull or push via HTTP.') expect(element.children[1].name).to eq('span')
expect(element.children[1].children[0].text).to eq('Create a personal access token on your account to pull or push via HTTP.')
end end
end end
......
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