Move group Labels menu item to Group information menu

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