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
This commit is contained in:
Phil Hughes 2018-12-07 13:47:27 +00:00
commit 61d91f640b
3 changed files with 21 additions and 1 deletions

View File

@ -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"

View File

@ -0,0 +1,5 @@
---
title: Show primary button when all labels are prioritized
merge_request: 23648
author: George Tsiolis
type: other

View File

@ -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)