Commit 91b0754d authored by Stan Hu's avatar Stan Hu

Fix HTTP/SSH clone panel for mobile

parent f50ee65b
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
%button.btn.btn-primary.dropdown-toggle.js-dropdown-toggle{ type: "button", data: { toggle: "dropdown" } } %button.btn.btn-primary.dropdown-toggle.js-dropdown-toggle{ type: "button", data: { toggle: "dropdown" } }
= sprite_icon("arrow-down", css_class: "dropdown-btn-icon icon") = sprite_icon("arrow-down", css_class: "dropdown-btn-icon icon")
%ul.dropdown-menu.dropdown-menu-selectable.dropdown-menu-right.clone-options-dropdown{ data: { dropdown: true } } %ul.dropdown-menu.dropdown-menu-selectable.dropdown-menu-right.clone-options-dropdown{ data: { dropdown: true } }
%li - if ssh_enabled?
= dropdown_item_with_description(ssh_copy_label, project.ssh_url_to_repo, href: project.ssh_url_to_repo, data: { clone_type: 'ssh' }, default: true) %li
%li = dropdown_item_with_description(ssh_copy_label, project.ssh_url_to_repo, href: project.ssh_url_to_repo, data: { clone_type: 'ssh' }, default: true)
= dropdown_item_with_description(http_copy_label, project.http_url_to_repo, href: project.http_url_to_repo, data: { clone_type: 'http' }) - if http_enabled?
%li
= dropdown_item_with_description(http_copy_label, project.http_url_to_repo, href: project.http_url_to_repo, data: { clone_type: 'http' })
...@@ -139,6 +139,16 @@ describe 'Project' do ...@@ -139,6 +139,16 @@ describe 'Project' do
expect(page).not_to have_content('Clone with SSH') expect(page).not_to have_content('Clone with SSH')
end end
end end
context 'mobile component' do
it 'shows only the instructions for HTTP' do
resize_screen_xs
find('.dropdown-toggle').click
expect(page).to have_content('Copy HTTP clone URL')
expect(page).not_to have_content('Copy SSH clone URL')
end
end
end end
context 'when only SSH clones are allowed' do context 'when only SSH clones are allowed' do
...@@ -152,6 +162,16 @@ describe 'Project' do ...@@ -152,6 +162,16 @@ describe 'Project' do
expect(page).not_to have_content('Clone with HTTP') expect(page).not_to have_content('Clone with HTTP')
end end
end end
context 'mobile component' do
it 'shows only the instructions for SSH' do
resize_screen_xs
find('.dropdown-toggle').click
expect(page).to have_content('Copy SSH clone URL')
expect(page).not_to have_content('Copy HTTP clone URL')
end
end
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