summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnabel Dunstone Gray <annabel.m.gray@gmail.com>2019-01-22 17:42:11 +0000
committerAnnabel Dunstone Gray <annabel.m.gray@gmail.com>2019-01-22 17:42:11 +0000
commitf9099b17edf86a99c0dd203ccfb8e72a0a2e25ba (patch)
tree4824b94eb9ce5e358412ec62665f5e5cd1ef7463
parent30c141c99018eefd7992149e6ce4d4ffdac066a4 (diff)
parentfe823be926ece8f73b06dc6528221306431ff895 (diff)
downloadgitlab-ce-f9099b17edf86a99c0dd203ccfb8e72a0a2e25ba.tar.gz
Merge branch 'fix/56558-move-primary-button' into 'master'
fix(labels): Move the primary button out of breadcrumbs and into the project section Closes #56558 See merge request gitlab-org/gitlab-ce!24516
-rw-r--r--app/views/groups/labels/index.html.haml7
-rw-r--r--app/views/projects/labels/index.html.haml7
-rw-r--r--app/views/shared/labels/_nav.html.haml4
-rw-r--r--changelogs/unreleased/fix-56558-move-primary-button.yml5
-rw-r--r--qa/qa/page/label/index.rb2
-rw-r--r--spec/features/projects/labels/update_prioritization_spec.rb2
6 files changed, 13 insertions, 14 deletions
diff --git a/app/views/groups/labels/index.html.haml b/app/views/groups/labels/index.html.haml
index 4df3d831942..5cf3193bc62 100644
--- a/app/views/groups/labels/index.html.haml
+++ b/app/views/groups/labels/index.html.haml
@@ -6,15 +6,10 @@
- subscribed = params[:subscribed]
- labels_or_filters = @labels.exists? || search.present? || subscribed.present?
-- if @labels.present? && can_admin_label
- - content_for(:header_content) do
- .nav-controls
- = link_to _('New label'), new_group_label_path(@group), class: "btn btn-success"
-
- if labels_or_filters
#promote-label-modal
%div{ class: container_class }
- = render 'shared/labels/nav'
+ = render 'shared/labels/nav', labels_or_filters: labels_or_filters, can_admin_label: can_admin_label
.labels-container.prepend-top-5
- if @labels.any?
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml
index 56b06374d6d..bb7c297ba1f 100644
--- a/app/views/projects/labels/index.html.haml
+++ b/app/views/projects/labels/index.html.haml
@@ -5,15 +5,10 @@
- subscribed = params[:subscribed]
- labels_or_filters = @labels.exists? || @prioritized_labels.exists? || search.present? || subscribed.present?
-- if labels_or_filters && can_admin_label
- - content_for(:header_content) do
- .nav-controls
- = link_to _('New label'), new_project_label_path(@project), class: "btn btn-success qa-label-create-new"
-
- if labels_or_filters
#promote-label-modal
%div{ class: container_class }
- = render 'shared/labels/nav'
+ = render 'shared/labels/nav', labels_or_filters: labels_or_filters, can_admin_label: can_admin_label
.labels-container.prepend-top-10
- if can_admin_label
diff --git a/app/views/shared/labels/_nav.html.haml b/app/views/shared/labels/_nav.html.haml
index 98572db738b..e69246dd0eb 100644
--- a/app/views/shared/labels/_nav.html.haml
+++ b/app/views/shared/labels/_nav.html.haml
@@ -18,3 +18,7 @@
%button.btn.btn-default{ type: "submit", "aria-label" => _('Submit search') }
= icon("search")
= render 'shared/labels/sort_dropdown'
+ - if labels_or_filters && can_admin_label && @project
+ = link_to _('New label'), new_project_label_path(@project), class: "btn btn-success qa-label-create-new"
+ - if labels_or_filters && can_admin_label && @group
+ = link_to _('New label'), new_group_label_path(@group), class: "btn btn-success qa-label-create-new"
diff --git a/changelogs/unreleased/fix-56558-move-primary-button.yml b/changelogs/unreleased/fix-56558-move-primary-button.yml
new file mode 100644
index 00000000000..4dcc896b327
--- /dev/null
+++ b/changelogs/unreleased/fix-56558-move-primary-button.yml
@@ -0,0 +1,5 @@
+---
+title: Moved primary button for labels to follow the design patterns used on rest of the site
+merge_request:
+author: Martin Hobert
+type: fixed
diff --git a/qa/qa/page/label/index.rb b/qa/qa/page/label/index.rb
index 9344371a0b6..97ce8f0eba5 100644
--- a/qa/qa/page/label/index.rb
+++ b/qa/qa/page/label/index.rb
@@ -2,7 +2,7 @@ module QA
module Page
module Label
class Index < Page::Base
- view 'app/views/projects/labels/index.html.haml' do
+ view 'app/views/shared/labels/_nav.html.haml' do
element :label_create_new
end
diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb
index 055a0c83a11..d36f043f880 100644
--- a/spec/features/projects/labels/update_prioritization_spec.rb
+++ b/spec/features/projects/labels/update_prioritization_spec.rb
@@ -125,7 +125,7 @@ describe 'Prioritize labels' do
wait_for_requests
end
- page.within('.breadcrumbs-container') do
+ page.within('.top-area') do
expect(page).to have_link('New label')
end
end