Commit 4b6ab497 authored by Tim Zallmann's avatar Tim Zallmann

Externalised Dropdown

Checks for creating new issue
Styling of .dropdown-bold-header
Fixed Spinach Tests to limit them to the main content area for clicking 'New Project' etc. so that they don't click the dropdown menu
parent 9387dd5f
......@@ -261,7 +261,13 @@
text-transform: capitalize;
}
.separator + .dropdown-header {
.dropdown-bold-header {
font-weight: 600;
line-height: 22px;
padding: 0 16px;
}
.separator + .dropdown-header, .separator + .dropdown-bold-header {
padding-top: 2px;
}
......
......@@ -4,34 +4,37 @@
= icon('caret-down')
.dropdown-menu-nav.dropdown-menu-align-right
%ul
- if @group
- create_group_project = can?(current_user, :create_projects, @group)
- create_group_subgroup = can?(current_user, :create_subgroup, @group)
- if @group && (create_group_project || create_group_subgroup)
%li
.bold This group
- if (create_group_project || create_group_subgroup)
%li.dropdown-bold-header This group
- if create_group_project
%li
= link_to 'New project', new_project_path(namespace_id: @group.id)
- if create_group_subgroup
%li
= link_to 'New subgroup', new_group_path(parent_id: @group.id)
%li.divider
%li.dropdown-bold-header GitLab
- if @project
%li
.bold This project
- create_project_issue = can?(current_user, :create_issue, @project)
- merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project))
- create_project_snippet = can?(current_user, :create_project_snippet, @project)
- if (create_project_issue || create_project_mr || create_project_snippet)
%li.dropdown-bold-header This project
- if create_project_issue
%li
= link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project)
- merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project))
- if merge_project
%li
= link_to 'New merge request', new_namespace_project_merge_request_path(merge_project.namespace, merge_project)
- if can?(current_user, :create_project_snippet, @project)
- if create_project_snippet
%li
= link_to 'New snippet', new_namespace_project_snippet_path(@project.namespace, @project)
- if @group || @project
%li.divider
%li
.bold GitLab
%li.dropdown-bold-header GitLab
- if current_user.can_create_project?
%li
= link_to 'New project', new_project_path
......
......@@ -4,7 +4,7 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
include SharedProject
step 'I click "New project" link' do
page.within('.content') do
page.within '#content-body' do
click_link "New project"
end
end
......
......@@ -5,8 +5,10 @@ class Spinach::Features::ProjectCreate < Spinach::FeatureSteps
step 'fill project form with valid data' do
fill_in 'project_path', with: 'Empty'
page.within '#content-body' do
click_button "Create project"
end
end
step 'I should see project page' do
expect(page).to have_content "Empty"
......
......@@ -17,8 +17,10 @@ class Spinach::Features::ProjectForkedMergeRequests < Spinach::FeatureSteps
end
step 'I click link "New Merge Request"' do
page.within '#content-body' do
page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request')
end
end
step 'I should see merge request "Merge Request On Forked Project"' do
expect(@project.merge_requests.size).to be >= 1
......
......@@ -62,8 +62,10 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
step 'I click link "New issue"' do
page.within '#content-body' do
page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue')
end
end
step 'I click "author" dropdown' do
page.find('.js-author-search').click
......
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