提交 2850efcd 编写于 作者: R Rémy Coutable

Merge branch '35191-prioritized-labels-for-non-member' into 'master'

Remove help message about prioritized labels for non-members

Closes #35191

See merge request !12912
- @no_container = true - @no_container = true
- page_title "Labels" - page_title "Labels"
- hide_class = '' - hide_class = ''
- can_admin_label = can?(current_user, :admin_label, @project)
- if show_new_nav? && can?(current_user, :admin_label, @project) - if show_new_nav? && can?(current_user, :admin_label, @project)
- content_for :breadcrumbs_extra do - content_for :breadcrumbs_extra do
...@@ -12,15 +13,17 @@ ...@@ -12,15 +13,17 @@
%div{ class: container_class } %div{ class: container_class }
.top-area.adjust .top-area.adjust
.nav-text .nav-text
Labels can be applied to issues and merge requests. Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging. Labels can be applied to issues and merge requests.
- if can_admin_label
Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging.
.nav-controls{ class: ("visible-xs" if show_new_nav?) } - if can_admin_label
- if can?(current_user, :admin_label, @project) .nav-controls{ class: ("visible-xs" if show_new_nav?) }
= link_to new_project_label_path(@project), class: "btn btn-new" do = link_to new_project_label_path(@project), class: "btn btn-new" do
New label New label
.labels .labels
- if can?(current_user, :admin_label, @project) - if can_admin_label
-# Only show it in the first page -# Only show it in the first page
- hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1') - hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
.prioritized-labels{ class: ('hide' if hide) } .prioritized-labels{ class: ('hide' if hide) }
...@@ -33,7 +36,7 @@ ...@@ -33,7 +36,7 @@
- if @labels.present? - if @labels.present?
.other-labels .other-labels
- if can?(current_user, :admin_label, @project) - if can_admin_label
%h5{ class: ('hide' if hide) } Other Labels %h5{ class: ('hide' if hide) } Other Labels
%ul.content-list.manage-labels-list.js-other-labels %ul.content-list.manage-labels-list.js-other-labels
= render partial: 'shared/label', subject: @project, collection: @labels, as: :label = render partial: 'shared/label', subject: @project, collection: @labels, as: :label
......
---
title: Remove help message about prioritized labels for non-members
merge_request: 12912
author: Takuya Noguchi
...@@ -114,6 +114,12 @@ feature 'Prioritize labels', feature: true do ...@@ -114,6 +114,12 @@ feature 'Prioritize labels', feature: true do
expect(page.all('li').last).to have_content('bug') expect(page.all('li').last).to have_content('bug')
end end
end end
it 'shows a help message about prioritized labels' do
visit project_labels_path(project)
expect(page).to have_content 'Star a label'
end
end end
context 'as a guest' do context 'as a guest' do
...@@ -128,6 +134,7 @@ feature 'Prioritize labels', feature: true do ...@@ -128,6 +134,7 @@ feature 'Prioritize labels', feature: true do
expect(page).to have_content 'wontfix' expect(page).to have_content 'wontfix'
expect(page).to have_content 'feature' expect(page).to have_content 'feature'
expect(page).not_to have_css('.prioritized-labels') expect(page).not_to have_css('.prioritized-labels')
expect(page).not_to have_content 'Star a label'
end end
end end
...@@ -139,6 +146,7 @@ feature 'Prioritize labels', feature: true do ...@@ -139,6 +146,7 @@ feature 'Prioritize labels', feature: true do
expect(page).to have_content 'wontfix' expect(page).to have_content 'wontfix'
expect(page).to have_content 'feature' expect(page).to have_content 'feature'
expect(page).not_to have_css('.prioritized-labels') expect(page).not_to have_css('.prioritized-labels')
expect(page).not_to have_content 'Star a label'
end end
end end
end end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册