Commit 711c4bec authored by Martin Wortschack's avatar Martin Wortschack
Browse files

Merge branch '20298-labels-management-is-not-accessible-when-issues-are-disabled' into 'master'

Display Labels item in sidebar when Issues are disabled

See merge request gitlab-org/gitlab!20817
parents 607beac3 54a234e0
......@@ -144,8 +144,16 @@
%strong.fly-out-top-item-name
= issue_tracker.title
 
- if (project_nav_tab? :labels) && !@project.issues_enabled?
= nav_link(controller: [:labels]) do
= link_to project_labels_path(@project), title: _('Labels'), class: 'shortcuts-labels qa-labels-items' do
.nav-icon-container
= sprite_icon('label')
%span.nav-item-name#js-onboarding-labels-link
= _('Labels')
- if project_nav_tab? :merge_requests
= nav_link(controller: @project.issues_enabled? ? :merge_requests : [:merge_requests, :labels, :milestones]) do
= nav_link(controller: @project.issues_enabled? ? :merge_requests : [:merge_requests, :milestones]) do
= link_to project_merge_requests_path(@project), class: 'shortcuts-merge_requests', data: { qa_selector: 'merge_requests_link' } do
.nav-icon-container
= sprite_icon('git-merge')
......
---
title: Display Labels item in sidebar when Issues are disabled
merge_request: 20817
author:
type: fixed
......@@ -41,7 +41,7 @@ describe 'Edit Project Settings' do
end
 
context 'When external issue tracker is enabled and issues enabled on project settings' do
it 'does not hide issues tab' do
it 'does not hide issues tab and hides labels tab' do
allow_next_instance_of(Project) do |instance|
allow(instance).to receive(:external_issue_tracker).and_return(JiraService.new)
end
......@@ -49,11 +49,12 @@ describe 'Edit Project Settings' do
visit project_path(project)
 
expect(page).to have_selector('.shortcuts-issues')
expect(page).not_to have_selector('.shortcuts-labels')
end
end
 
context 'When external issue tracker is enabled and issues disabled on project settings' do
it 'hides issues tab' do
it 'hides issues tab and show labels tab' do
project.issues_enabled = false
project.save!
allow_next_instance_of(Project) do |instance|
......@@ -63,6 +64,7 @@ describe 'Edit Project Settings' do
visit project_path(project)
 
expect(page).not_to have_selector('.shortcuts-issues')
expect(page).to have_selector('.shortcuts-labels')
end
end
 
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment