summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-12-07 13:47:27 +0000
committerPhil Hughes <me@iamphill.com>2018-12-07 13:47:27 +0000
commit61d91f640b94d6e273dee502b77e723b599ab86c (patch)
tree5d38199ade46feb3410ba2be99e518529674a12a
parent25cd8fb5471ed32c6ce565e2a1027f591091f19f (diff)
parentf8fdf93ec94b1ad43141a1463a6793082750d86e (diff)
downloadgitlab-ce-61d91f640b94d6e273dee502b77e723b599ab86c.tar.gz
Merge branch 'gt-show-primary-button-when-all-labels-are-prioritized' into 'master'
Show primary button when all labels are prioritized Closes #54467 See merge request gitlab-org/gitlab-ce!23648
-rw-r--r--app/views/projects/labels/index.html.haml2
-rw-r--r--changelogs/unreleased/gt-show-primary-button-when-all-labels-are-prioritized.yml5
-rw-r--r--spec/features/projects/labels/update_prioritization_spec.rb15
3 files changed, 21 insertions, 1 deletions
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml
index 2c6484c2c99..56b06374d6d 100644
--- a/app/views/projects/labels/index.html.haml
+++ b/app/views/projects/labels/index.html.haml
@@ -5,7 +5,7 @@
- subscribed = params[:subscribed]
- labels_or_filters = @labels.exists? || @prioritized_labels.exists? || search.present? || subscribed.present?
-- if @labels.present? && can_admin_label
+- 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"
diff --git a/changelogs/unreleased/gt-show-primary-button-when-all-labels-are-prioritized.yml b/changelogs/unreleased/gt-show-primary-button-when-all-labels-are-prioritized.yml
new file mode 100644
index 00000000000..eed31950a76
--- /dev/null
+++ b/changelogs/unreleased/gt-show-primary-button-when-all-labels-are-prioritized.yml
@@ -0,0 +1,5 @@
+---
+title: Show primary button when all labels are prioritized
+merge_request: 23648
+author: George Tsiolis
+type: other
diff --git a/spec/features/projects/labels/update_prioritization_spec.rb b/spec/features/projects/labels/update_prioritization_spec.rb
index 996040fde02..055a0c83a11 100644
--- a/spec/features/projects/labels/update_prioritization_spec.rb
+++ b/spec/features/projects/labels/update_prioritization_spec.rb
@@ -115,6 +115,21 @@ describe 'Prioritize labels' do
end
end
+ it 'user can see a primary button when there are only prioritized labels', :js do
+ visit project_labels_path(project)
+
+ page.within('.other-labels') do
+ all('.js-toggle-priority').each do |el|
+ el.click
+ end
+ wait_for_requests
+ end
+
+ page.within('.breadcrumbs-container') do
+ expect(page).to have_link('New label')
+ end
+ end
+
it 'shows a help message about prioritized labels' do
visit project_labels_path(project)