Commit 54a234e0 authored by Florie Guibert's avatar Florie Guibert Committed by Martin Wortschack

Display Labels item in sidebar when Issues are disabled

parent 607beac3
......@@ -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
......
Markdown is supported
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