Commit 2803fb8d authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch '231391-create-a-left-sidebar-nav-item-for-epic-boards-under-epics' into 'master'

Epic Boards - Add Boards navigation item under Epics

See merge request gitlab-org/gitlab!51856
parents c44be2dc 56ea6b12
# frozen_string_literal: true
class Groups::EpicBoardsController < Groups::BoardsController
include BoardsActions
before_action :authorize_read_board!, only: [:index]
def authorize_read_board!
access_denied! unless Feature.enabled?(:epic_boards, group) && can?(current_user, :read_epic_board, group)
end
end
- return unless group_sidebar_link?(:epics)
- epics_count = group_epics_count(state: 'opened')
- epics_items = ['epics#show', 'epics#index', 'roadmap#show']
- epics_items = ['epics#show', 'epics#index', 'epic_boards#index', 'epic_boards#show', 'roadmap#show']
= nav_link(path: epics_items) do
= link_to group_epics_path(group), class: 'qa-group-epics-link' do
......@@ -20,6 +20,11 @@
= link_to group_epics_path(group), title: 'List' do
%span= _('List')
- if Feature.enabled?(:epic_boards, @group)
= nav_link(path: ['epic_boards#index', 'epic_boards#show'], html_options: { class: "home" }) do
= link_to group_epic_boards_path(group), title: 'Boards' do
%span= _('Boards')
= nav_link(path: 'roadmap#show', html_options: { class: 'home' }) do
= link_to group_roadmap_path(group), title: 'Roadmap' do
%span= _('Roadmap')
......@@ -138,6 +138,8 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
end
end
resources :epic_boards, only: [:index]
namespace :security do
resource :dashboard, only: [:show], controller: :dashboard
resources :vulnerabilities, only: [:index]
......
......@@ -66,6 +66,7 @@ RSpec.describe 'Group navbar' do
context 'when epics are available' do
before do
stub_licensed_features(epics: true)
stub_feature_flags(epic_boards: false)
insert_after_nav_item(
_('Group overview'),
......@@ -84,6 +85,28 @@ RSpec.describe 'Group navbar' do
it_behaves_like 'verified navigation bar'
end
context 'when epics and epic boards are available' do
before do
stub_licensed_features(epics: true)
insert_after_nav_item(
_('Group overview'),
new_nav_item: {
nav_item: _('Epics'),
nav_sub_items: [
_('List'),
_('Boards'),
_('Roadmap')
]
}
)
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
context 'when the logged in user is the owner' do
before do
group.add_owner(user)
......
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