Commit b135718b authored by Coung Ngo's avatar Coung Ngo

Fix sidebar Iterations link logic

Change to show Iterations link when user can :read_iterations
and add :project_iterations feature flag to wrap incremental
code changes
parent ce5ef00f
- return unless License.feature_available?(:iterations)
- return unless Feature.enabled?(:group_iterations, @group, default_enabled: true)
- return unless Feature.enabled?(:project_iterations, @project.group, default_enabled: false)
- return unless can?(current_user, :read_iteration, @project)
= nav_link(controller: :iterations) do
= link_to project_iterations_path(@project), title: _('Iterations') do
......
---
title: Add iteration page within projects
merge_request: 37715
author:
type: added
......@@ -11,7 +11,7 @@ RSpec.describe 'Project navbar' do
let_it_be(:project) { create(:project, :repository) }
before do
stub_feature_flags(group_iterations: false)
stub_feature_flags(project_iterations: false)
insert_package_nav(_('Operations'))
......@@ -103,7 +103,7 @@ RSpec.describe 'Project navbar' do
context 'when iterations is available' do
before do
stub_licensed_features(iterations: true)
stub_feature_flags(group_iterations: true)
stub_feature_flags(project_iterations: true)
insert_after_sub_nav_item(
_('Milestones'),
......
......@@ -260,9 +260,9 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
stub_licensed_features(iterations: true)
end
context 'with group iterations feature flag enabled' do
context 'with project_iterations feature flag enabled' do
before do
stub_feature_flags(group_iterations: true)
stub_feature_flags(project_iterations: true)
end
it 'is visible' do
......@@ -272,9 +272,9 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
end
end
context 'with iterations feature flag disabled' do
context 'with project_iterations feature flag disabled' do
before do
stub_feature_flags(group_iterations: false)
stub_feature_flags(project_iterations: false)
end
it 'is not visible' do
......
......@@ -12,7 +12,7 @@ RSpec.describe 'Project navbar' do
let_it_be(:project) { create(:project, :repository) }
before do
stub_feature_flags(group_iterations: false)
stub_feature_flags(project_iterations: false)
insert_package_nav(_('Operations'))
......
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