summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-09-07 13:17:32 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-09-07 13:17:32 +0000
commit0c2dc7273819b29efcb77a347af0116aeb5a9927 (patch)
tree3abcea65a35bc4b05990481bb8ee713eba0b4f5e
parent6f0042421447f6675a5fc3d2bf3fdaedb6007451 (diff)
parent2814ea6f7cc2c3cc97fd0f97cb4b598779465552 (diff)
downloadgitlab-ce-0c2dc7273819b29efcb77a347af0116aeb5a9927.tar.gz
Merge branch 'breadcrumbs-extra-btns-remove' into 'master'
Moves the action buttons out of the breadcrumbs Closes #36459 See merge request !14072
-rw-r--r--app/assets/stylesheets/new_nav.scss10
-rw-r--r--app/views/dashboard/_groups_head.html.haml8
-rw-r--r--app/views/dashboard/_projects_head.html.haml8
-rw-r--r--app/views/dashboard/_snippets_head.html.haml8
-rw-r--r--app/views/dashboard/issues.html.haml7
-rw-r--r--app/views/dashboard/merge_requests.html.haml5
-rw-r--r--app/views/dashboard/milestones/index.html.haml5
-rw-r--r--app/views/groups/issues.html.haml10
-rw-r--r--app/views/groups/labels/index.html.haml5
-rw-r--r--app/views/groups/merge_requests.html.haml6
-rw-r--r--app/views/groups/milestones/index.html.haml5
-rw-r--r--app/views/layouts/nav/_breadcrumbs.html.haml4
-rw-r--r--app/views/projects/issues/index.html.haml5
-rw-r--r--app/views/projects/labels/index.html.haml6
-rw-r--r--app/views/projects/merge_requests/index.html.haml5
-rw-r--r--app/views/projects/milestones/index.html.haml8
-rw-r--r--app/views/projects/pipeline_schedules/index.html.haml6
-rw-r--r--app/views/projects/snippets/index.html.haml6
-rw-r--r--features/steps/group/milestones.rb2
-rw-r--r--features/steps/project/issues/issues.rb2
-rw-r--r--features/steps/project/issues/milestones.rb2
-rw-r--r--features/steps/project/merge_requests.rb2
-rw-r--r--features/steps/project/snippets.rb2
-rw-r--r--spec/features/dashboard/issues_filter_spec.rb2
-rw-r--r--spec/features/issues_spec.rb2
25 files changed, 30 insertions, 101 deletions
diff --git a/app/assets/stylesheets/new_nav.scss b/app/assets/stylesheets/new_nav.scss
index e4b52ab480d..2b6c0fc015c 100644
--- a/app/assets/stylesheets/new_nav.scss
+++ b/app/assets/stylesheets/new_nav.scss
@@ -515,16 +515,6 @@ header.navbar-gitlab-new {
}
}
-.top-area {
- .nav-controls-new-nav {
- .dropdown {
- @media (min-width: $screen-sm-min) {
- margin-right: 0;
- }
- }
- }
-}
-
.btn-sign-in {
margin-top: 3px;
background-color: $indigo-100;
diff --git a/app/views/dashboard/_groups_head.html.haml b/app/views/dashboard/_groups_head.html.haml
index 11bf3f5d323..7981daa0705 100644
--- a/app/views/dashboard/_groups_head.html.haml
+++ b/app/views/dashboard/_groups_head.html.haml
@@ -1,7 +1,3 @@
-- if current_user.can_create_group?
- - content_for :breadcrumbs_extra do
- = link_to "New group", new_group_path, class: "btn btn-new"
-
.top-area
%ul.nav-links
= nav_link(page: dashboard_groups_path) do
@@ -10,8 +6,8 @@
= nav_link(page: explore_groups_path) do
= link_to explore_groups_path, title: 'Explore public groups' do
Explore public groups
- .nav-controls.nav-controls-new-nav
+ .nav-controls
= render 'shared/groups/search_form'
= render 'shared/groups/dropdown'
- if current_user.can_create_group?
- = link_to "New group", new_group_path, class: "btn btn-new visible-xs"
+ = link_to "New group", new_group_path, class: "btn btn-new"
diff --git a/app/views/dashboard/_projects_head.html.haml b/app/views/dashboard/_projects_head.html.haml
index e2a1914ada2..fd2ba9ac1ca 100644
--- a/app/views/dashboard/_projects_head.html.haml
+++ b/app/views/dashboard/_projects_head.html.haml
@@ -1,10 +1,6 @@
= content_for :flash_message do
= render 'shared/project_limit'
-- if current_user.can_create_project?
- - content_for :breadcrumbs_extra do
- = link_to "New project", new_project_path, class: 'btn btn-new'
-
.top-area.scrolling-tabs-container.inner-page-scroll-tabs
.fade-left= icon('angle-left')
.fade-right= icon('angle-right')
@@ -19,8 +15,8 @@
= link_to explore_root_path, title: 'Explore', data: {placement: 'right'} do
Explore projects
- .nav-controls.nav-controls-new-nav
+ .nav-controls
= render 'shared/projects/search_form'
= render 'shared/projects/dropdown'
- if current_user.can_create_project?
- = link_to "New project", new_project_path, class: "btn btn-new visible-xs"
+ = link_to "New project", new_project_path, class: "btn btn-new"
diff --git a/app/views/dashboard/_snippets_head.html.haml b/app/views/dashboard/_snippets_head.html.haml
index 14c18678ab1..7330f4cb523 100644
--- a/app/views/dashboard/_snippets_head.html.haml
+++ b/app/views/dashboard/_snippets_head.html.haml
@@ -1,7 +1,3 @@
-- if current_user
- - content_for :breadcrumbs_extra do
- = link_to "New snippet", new_snippet_path, class: "btn btn-new", title: "New snippet"
-
.top-area
%ul.nav-links
= nav_link(page: dashboard_snippets_path, html_options: {class: 'home'}) do
@@ -10,3 +6,7 @@
= nav_link(page: explore_snippets_path) do
= link_to explore_snippets_path, title: 'Explore snippets', data: {placement: 'right'} do
Explore Snippets
+
+ - if current_user
+ .nav-controls.hidden-xs
+ = link_to "New snippet", new_snippet_path, class: "btn btn-new", title: "New snippet"
diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml
index ad0e205a79f..42941acc508 100644
--- a/app/views/dashboard/issues.html.haml
+++ b/app/views/dashboard/issues.html.haml
@@ -4,14 +4,9 @@
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, params.merge(rss_url_options), title: "#{current_user.name} issues")
-- content_for :breadcrumbs_extra do
- = link_to params.merge(rss_url_options), class: 'btn has-tooltip append-right-10', title: 'Subscribe' do
- = icon('rss')
- = render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", with_feature_enabled: 'issues', type: :issues
-
.top-area
= render 'shared/issuable/nav', type: :issues
- .nav-controls.visible-xs
+ .nav-controls
= link_to params.merge(rss_url_options), class: 'btn has-tooltip', title: 'Subscribe' do
= icon('rss')
= render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", with_feature_enabled: 'issues', type: :issues
diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml
index ccc74f7cf3d..53cd1130299 100644
--- a/app/views/dashboard/merge_requests.html.haml
+++ b/app/views/dashboard/merge_requests.html.haml
@@ -2,12 +2,9 @@
- page_title "Merge Requests"
- header_title "Merge Requests", merge_requests_dashboard_path(assignee_id: current_user.id)
-- content_for :breadcrumbs_extra do
- = render 'shared/new_project_item_select', path: 'merge_requests/new', label: "New merge request", with_feature_enabled: 'merge_requests', type: :merge_requests
-
.top-area
= render 'shared/issuable/nav', type: :merge_requests
- .nav-controls.visible-xs
+ .nav-controls
= render 'shared/new_project_item_select', path: 'merge_requests/new', label: "New merge request", with_feature_enabled: 'merge_requests', type: :merge_requests
= render 'shared/issuable/filter', type: :merge_requests
diff --git a/app/views/dashboard/milestones/index.html.haml b/app/views/dashboard/milestones/index.html.haml
index 9fffdded1a0..f66e2b40d76 100644
--- a/app/views/dashboard/milestones/index.html.haml
+++ b/app/views/dashboard/milestones/index.html.haml
@@ -2,13 +2,10 @@
- page_title 'Milestones'
- header_title 'Milestones', dashboard_milestones_path
-- content_for :breadcrumbs_extra do
- = render 'shared/new_project_item_select', path: 'milestones/new', label: 'New milestone', include_groups: true, type: :milestones
-
.top-area
= render 'shared/milestones_filter', counts: @milestone_states
- .nav-controls.visible-xs
+ .nav-controls
= render 'shared/new_project_item_select', path: 'milestones/new', label: 'New milestone', include_groups: true, type: :milestones
.milestones
diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml
index 13a4b4c90c9..7f411927429 100644
--- a/app/views/groups/issues.html.haml
+++ b/app/views/groups/issues.html.haml
@@ -9,17 +9,9 @@
= webpack_bundle_tag 'filtered_search'
- if group_issues_exists
- - content_for :breadcrumbs_extra do
- = link_to params.merge(rss_url_options), class: 'btn btn-default append-right-10' do
- = icon('rss')
- %span.icon-label
- Subscribe
- = render 'shared/new_project_item_select', path: 'issues/new', label: "New issue", type: :issues
-
-- if group_issues_exists
.top-area
= render 'shared/issuable/nav', type: :issues
- .nav-controls.visible-xs
+ .nav-controls
= link_to params.merge(rss_url_options), class: 'btn' do
= icon('rss')
%span.icon-label
diff --git a/app/views/groups/labels/index.html.haml b/app/views/groups/labels/index.html.haml
index 9e59a09d459..89165096fe2 100644
--- a/app/views/groups/labels/index.html.haml
+++ b/app/views/groups/labels/index.html.haml
@@ -1,7 +1,4 @@
- page_title 'Labels'
-- if can?(current_user, :admin_label, @group)
- - content_for :breadcrumbs_extra do
- = link_to "New label", new_group_label_path(@group), class: "btn btn-new"
= render "groups/head_issues"
@@ -10,7 +7,7 @@
.nav-text
Labels can be applied to issues and merge requests. Group labels are available for any project within the group.
- .nav-controls.visible-xs
+ .nav-controls
- if can?(current_user, :admin_label, @group)
= link_to "New label", new_group_label_path(@group), class: "btn btn-new"
diff --git a/app/views/groups/merge_requests.html.haml b/app/views/groups/merge_requests.html.haml
index 0344770e0dd..e56dc1fb9c2 100644
--- a/app/views/groups/merge_requests.html.haml
+++ b/app/views/groups/merge_requests.html.haml
@@ -4,17 +4,13 @@
= webpack_bundle_tag 'common_vue'
= webpack_bundle_tag 'filtered_search'
-- if current_user
- - content_for :breadcrumbs_extra do
- = render 'shared/new_project_item_select', path: 'merge_requests/new', label: "New merge request", type: :merge_requests
-
- if @group_merge_requests.empty?
= render 'shared/empty_states/merge_requests', project_select_button: true
- else
.top-area
= render 'shared/issuable/nav', type: :merge_requests
- if current_user
- .nav-controls.visible-xs
+ .nav-controls
= render 'shared/new_project_item_select', path: 'merge_requests/new', label: "New merge request", type: :merge_requests
= render 'shared/issuable/search_bar', type: :merge_requests
diff --git a/app/views/groups/milestones/index.html.haml b/app/views/groups/milestones/index.html.haml
index 6e7a1af243d..ed582e521c4 100644
--- a/app/views/groups/milestones/index.html.haml
+++ b/app/views/groups/milestones/index.html.haml
@@ -1,14 +1,11 @@
- page_title "Milestones"
-- if can?(current_user, :admin_milestones, @group)
- - content_for :breadcrumbs_extra do
- = link_to "New milestone", new_group_milestone_path(@group), class: "btn btn-new"
= render "groups/head_issues"
.top-area
= render 'shared/milestones_filter', counts: @milestone_states
- .nav-controls.visible-xs
+ .nav-controls
- if can?(current_user, :admin_milestones, @group)
= link_to "New milestone", new_group_milestone_path(@group), class: "btn btn-new"
diff --git a/app/views/layouts/nav/_breadcrumbs.html.haml b/app/views/layouts/nav/_breadcrumbs.html.haml
index feffd7707dc..7bd3f5306a2 100644
--- a/app/views/layouts/nav/_breadcrumbs.html.haml
+++ b/app/views/layouts/nav/_breadcrumbs.html.haml
@@ -2,7 +2,7 @@
- hide_top_links = @hide_top_links || false
%nav.breadcrumbs{ role: "navigation", class: [container, @content_class] }
- .breadcrumbs-container{ class: [container, @content_class] }
+ .breadcrumbs-container
- if defined?(@left_sidebar)
= button_tag class: 'toggle-mobile-nav', type: 'button' do
%span.sr-only Open sidebar
@@ -17,6 +17,4 @@
= render "layouts/nav/breadcrumbs/collapsed_dropdown", location: :after
%li
%h2.breadcrumbs-sub-title= @breadcrumb_title
- - if content_for?(:breadcrumbs_extra)
- .breadcrumbs-extra.hidden-xs= yield :breadcrumbs_extra
= yield :header_content
diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml
index 6fcb5975707..e72c94695bc 100644
--- a/app/views/projects/issues/index.html.haml
+++ b/app/views/projects/issues/index.html.haml
@@ -13,14 +13,11 @@
= content_for :meta_tags do
= auto_discovery_link_tag(:atom, params.merge(rss_url_options), title: "#{@project.name} issues")
-- content_for :breadcrumbs_extra do
- = render "projects/issues/nav_btns"
-
- if project_issues(@project).exists?
%div{ class: (container_class) }
.top-area
= render 'shared/issuable/nav', type: :issues
- .nav-controls.visible-xs
+ .nav-controls
= render "projects/issues/nav_btns"
= render 'shared/issuable/search_bar', type: :issues
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml
index ec9e8444ac5..10d07ce8e45 100644
--- a/app/views/projects/labels/index.html.haml
+++ b/app/views/projects/labels/index.html.haml
@@ -3,10 +3,6 @@
- hide_class = ''
- can_admin_label = can?(current_user, :admin_label, @project)
-- if can?(current_user, :admin_label, @project)
- - content_for :breadcrumbs_extra do
- = link_to "New label", new_namespace_project_label_path(@project.namespace, @project), class: "btn btn-new"
-
= render "shared/mr_head"
- if @labels.exists? || @prioritized_labels.exists?
@@ -18,7 +14,7 @@
Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging.
- if can_admin_label
- .nav-controls.visible-xs
+ .nav-controls
= link_to new_project_label_path(@project), class: "btn btn-new" do
New label
diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml
index 27c3002366b..fc7190505da 100644
--- a/app/views/projects/merge_requests/index.html.haml
+++ b/app/views/projects/merge_requests/index.html.haml
@@ -12,16 +12,13 @@
= webpack_bundle_tag 'common_vue'
= webpack_bundle_tag 'filtered_search'
-- content_for :breadcrumbs_extra do
- = render "projects/merge_requests/nav_btns", merge_project: merge_project, new_merge_request_path: new_merge_request_path
-
= render 'projects/last_push'
- if @project.merge_requests.exists?
%div{ class: container_class }
.top-area
= render 'shared/issuable/nav', type: :merge_requests
- .nav-controls.visible-xs
+ .nav-controls
= render "projects/merge_requests/nav_btns", merge_project: merge_project, new_merge_request_path: new_merge_request_path
= render 'shared/issuable/search_bar', type: :merge_requests
diff --git a/app/views/projects/milestones/index.html.haml b/app/views/projects/milestones/index.html.haml
index 71ec88ef1c1..f3abecdd302 100644
--- a/app/views/projects/milestones/index.html.haml
+++ b/app/views/projects/milestones/index.html.haml
@@ -1,20 +1,16 @@
- @no_container = true
- page_title 'Milestones'
-- if can?(current_user, :admin_milestone, @project)
- - content_for :breadcrumbs_extra do
- = link_to "New milestone", new_namespace_project_milestone_path(@project.namespace, @project), class: 'btn btn-new', title: 'New milestone'
-
= render "shared/mr_head"
%div{ class: container_class }
.top-area
= render 'shared/milestones_filter', counts: milestone_counts(@project.milestones)
- .nav-controls.nav-controls-new-nav
+ .nav-controls
= render 'shared/milestones_sort_dropdown'
- if can?(current_user, :admin_milestone, @project)
- = link_to new_project_milestone_path(@project), class: "btn btn-new visible-xs", title: 'New milestone' do
+ = link_to new_project_milestone_path(@project), class: "btn btn-new", title: 'New milestone' do
New milestone
.milestones
diff --git a/app/views/projects/pipeline_schedules/index.html.haml b/app/views/projects/pipeline_schedules/index.html.haml
index d9957b54a4d..2b081786b6a 100644
--- a/app/views/projects/pipeline_schedules/index.html.haml
+++ b/app/views/projects/pipeline_schedules/index.html.haml
@@ -7,10 +7,6 @@
- @no_container = true
- page_title _("Pipeline Schedules")
-- if can?(current_user, :create_pipeline_schedule, @project)
- - content_for :breadcrumbs_extra do
- = link_to _('New schedule'), new_namespace_project_pipeline_schedule_path(@project.namespace, @project), class: 'btn btn-create'
-
= render "projects/pipelines/head"
%div{ class: container_class }
@@ -20,7 +16,7 @@
= render "tabs", schedule_path_proc: schedule_path_proc, all_schedules: @all_schedules, scope: @scope
- if can?(current_user, :create_pipeline_schedule, @project)
- .nav-controls.visible-xs
+ .nav-controls
= link_to new_project_pipeline_schedule_path(@project), class: 'btn btn-create' do
%span= _('New schedule')
diff --git a/app/views/projects/snippets/index.html.haml b/app/views/projects/snippets/index.html.haml
index 1803e7f7211..65efc083fdd 100644
--- a/app/views/projects/snippets/index.html.haml
+++ b/app/views/projects/snippets/index.html.haml
@@ -1,15 +1,11 @@
- page_title "Snippets"
-- if can?(current_user, :create_project_snippet, @project)
- - content_for :breadcrumbs_extra do
- = link_to "New snippet", new_namespace_project_snippet_path(@project.namespace, @project), class: "btn btn-new", title: "New snippet"
-
- if current_user
.top-area
- include_private = @project.team.member?(current_user) || current_user.admin?
= render partial: 'snippets/snippets_scope_menu', locals: { subject: @project, include_private: include_private }
- .nav-controls.visible-xs
+ .nav-controls
- if can?(current_user, :create_project_snippet, @project)
= link_to "New snippet", new_project_snippet_path(@project), class: "btn btn-new", title: "New snippet"
diff --git a/features/steps/group/milestones.rb b/features/steps/group/milestones.rb
index 20edcf75ff1..818bbb50d0e 100644
--- a/features/steps/group/milestones.rb
+++ b/features/steps/group/milestones.rb
@@ -47,7 +47,7 @@ class Spinach::Features::GroupMilestones < Spinach::FeatureSteps
end
step 'I click new milestone button' do
- page.within('.breadcrumbs') do
+ page.within('.nav-controls') do
click_link "New milestone"
end
end
diff --git a/features/steps/project/issues/issues.rb b/features/steps/project/issues/issues.rb
index f7dd4fc21e9..b9460f5b534 100644
--- a/features/steps/project/issues/issues.rb
+++ b/features/steps/project/issues/issues.rb
@@ -62,7 +62,7 @@ class Spinach::Features::ProjectIssues < Spinach::FeatureSteps
end
step 'I click link "New issue"' do
- page.within '.breadcrumbs' do
+ page.within '#content-body' do
page.has_link?('New Issue') ? click_link('New Issue') : click_link('New issue')
end
end
diff --git a/features/steps/project/issues/milestones.rb b/features/steps/project/issues/milestones.rb
index 307902a887e..16a2d4a6f93 100644
--- a/features/steps/project/issues/milestones.rb
+++ b/features/steps/project/issues/milestones.rb
@@ -16,7 +16,7 @@ class Spinach::Features::ProjectIssuesMilestones < Spinach::FeatureSteps
end
step 'I click link "New Milestone"' do
- page.within('.breadcrumbs') do
+ page.within('.nav-controls') do
click_link "New milestone"
end
end
diff --git a/features/steps/project/merge_requests.rb b/features/steps/project/merge_requests.rb
index 3c3bffd7223..0d49a4ab90d 100644
--- a/features/steps/project/merge_requests.rb
+++ b/features/steps/project/merge_requests.rb
@@ -14,7 +14,7 @@ class Spinach::Features::ProjectMergeRequests < Spinach::FeatureSteps
end
step 'I click link "New Merge Request"' do
- page.within '.breadcrumbs' do
+ page.within '.nav-controls' do
page.has_link?('New Merge Request') ? click_link("New Merge Request") : click_link('New merge request')
end
end
diff --git a/features/steps/project/snippets.rb b/features/steps/project/snippets.rb
index 96b7ba7549f..2a1e6b2bce8 100644
--- a/features/steps/project/snippets.rb
+++ b/features/steps/project/snippets.rb
@@ -23,7 +23,7 @@ class Spinach::Features::ProjectSnippets < Spinach::FeatureSteps
end
step 'I click link "New snippet"' do
- page.within '.breadcrumbs' do
+ page.within '.nav-controls' do
first(:link, "New snippet").click
end
end
diff --git a/spec/features/dashboard/issues_filter_spec.rb b/spec/features/dashboard/issues_filter_spec.rb
index ebc3d196118..facb67ae787 100644
--- a/spec/features/dashboard/issues_filter_spec.rb
+++ b/spec/features/dashboard/issues_filter_spec.rb
@@ -50,7 +50,7 @@ feature 'Dashboard Issues filtering', :js do
it 'updates atom feed link' do
visit_issues(milestone_title: '', assignee_id: user.id)
- link = find('.breadcrumbs a[title="Subscribe"]')
+ link = find('.nav-controls a[title="Subscribe"]')
params = CGI.parse(URI.parse(link[:href]).query)
auto_discovery_link = find('link[type="application/atom+xml"]', visible: false)
auto_discovery_params = CGI.parse(URI.parse(auto_discovery_link[:href]).query)
diff --git a/spec/features/issues_spec.rb b/spec/features/issues_spec.rb
index 11db1105d91..5c284a1fe5f 100644
--- a/spec/features/issues_spec.rb
+++ b/spec/features/issues_spec.rb
@@ -577,7 +577,7 @@ describe 'Issues' do
it 'redirects to signin then back to new issue after signin' do
visit project_issues_path(project)
- page.within '.breadcrumbs' do
+ page.within '.nav-controls' do
click_link 'New issue'
end