Move group Labels menu item to Group information menu

parent c6a85564
......@@ -7,7 +7,9 @@ module GroupsHelper
groups#details
groups#activity
groups#subgroups
]
].tap do |paths|
paths << 'labels#index' if Feature.enabled?(:sidebar_refactor, current_user, default_enabled: :yaml)
end
end
def group_settings_nav_link_paths
......
......@@ -69,7 +69,14 @@ module NavHelper
end
def group_issues_sub_menu_items
%w(groups#issues labels#index milestones#index boards#index boards#show)
%w[
groups#issues
milestones#index
boards#index
boards#show
].tap do |paths|
paths << 'labels#index' if Feature.disabled?(:sidebar_refactor, current_user, default_enabled: :yaml)
end
end
private
......
......@@ -24,7 +24,7 @@
= group_information_title(@group)
%ul.sidebar-sub-level-items
= nav_link(path: ['groups#show', 'groups#details', 'groups#activity', 'groups#subgroups'], html_options: { class: "fly-out-top-item" } ) do
= nav_link(path: paths, html_options: { class: "fly-out-top-item" } ) do
= link_to group_path(@group) do
%strong.fly-out-top-item-name
= group_information_title(@group)
......@@ -42,6 +42,12 @@
%span
= _('Activity')
- if group_sidebar_link?(:labels) && Feature.enabled?(:sidebar_refactor, current_user, default_enabled: :yaml)
= nav_link(path: 'labels#index') do
= link_to group_labels_path(@group), title: _('Labels') do
%span
= _('Labels')
= render_if_exists "layouts/nav/ee/epic_link", group: @group
- if group_sidebar_link?(:issues)
......@@ -54,7 +60,7 @@
%span.badge.badge-pill.count= issues_count
%ul.sidebar-sub-level-items{ data: { qa_selector: 'group_issues_sidebar_submenu'} }
= nav_link(path: ['groups#issues', 'labels#index', 'milestones#index', 'iterations#index'], html_options: { class: "fly-out-top-item" } ) do
= nav_link(path: group_issues_sub_menu_items, html_options: { class: "fly-out-top-item" } ) do
= link_to issues_group_path(@group) do
%strong.fly-out-top-item-name
= _('Issues')
......@@ -72,7 +78,7 @@
%span
= boards_link_text
- if group_sidebar_link?(:labels)
- if group_sidebar_link?(:labels) && Feature.disabled?(:sidebar_refactor, current_user, default_enabled: :yaml)
= nav_link(path: 'labels#index') do
= link_to group_labels_path(@group), title: _('Labels') do
%span
......
......@@ -13,18 +13,12 @@ RSpec.describe 'Group navbar' do
let(:structure) do
[
{
nav_item: _('Group information'),
nav_sub_items: [
_('Activity')
]
},
group_information_nav_item,
{
nav_item: _('Issues'),
nav_sub_items: [
_('List'),
_('Board'),
_('Labels'),
_('Milestones')
]
},
......
......@@ -115,6 +115,10 @@ RSpec.describe NavHelper do
describe '.group_issues_sub_menu_items' do
subject { helper.group_issues_sub_menu_items }
before do
allow(helper).to receive(:current_user).and_return(nil)
end
it { is_expected.to all(be_a(String)) }
end
......
......@@ -181,7 +181,8 @@ RSpec.shared_context 'group navbar structure' do
{
nav_item: _('Group information'),
nav_sub_items: [
_('Activity')
_('Activity'),
_('Labels')
]
}
end
......@@ -194,7 +195,6 @@ RSpec.shared_context 'group navbar structure' do
nav_sub_items: [
_('List'),
_('Board'),
_('Labels'),
_('Milestones')
]
},
......
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