Commit 4f058f87 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'ss/change-route-group-iterations' into 'master'

Change route for iterations at the group level in right sidebar

See merge request gitlab-org/gitlab!63799
parents ba854e13 b696e7d3
...@@ -143,9 +143,13 @@ module EE ...@@ -143,9 +143,13 @@ module EE
links << :productivity_analytics links << :productivity_analytics
end end
if ::Feature.enabled?(:group_iterations, @group, default_enabled: true) && @group.licensed_feature_available?(:iterations) && can?(current_user, :read_iteration, @group) if ::Feature.enabled?(:group_iterations, @group, default_enabled: true) && @group.licensed_feature_available?(:iterations)
if ::Feature.enabled?(:iteration_cadences, @group, default_enabled: :yaml) && can?(current_user, :read_iteration_cadence, @group)
links << :iteration_cadences
elsif can?(current_user, :read_iteration, @group)
links << :iterations links << :iterations
end end
end
if ::Feature.enabled?(:group_ci_cd_analytics_page, @group, default_enabled: true) && @group.licensed_feature_available?(:group_ci_cd_analytics) && can?(current_user, :view_group_ci_cd_analytics, @group) if ::Feature.enabled?(:group_ci_cd_analytics_page, @group, default_enabled: true) && @group.licensed_feature_available?(:group_ci_cd_analytics) && can?(current_user, :view_group_ci_cd_analytics, @group)
links << :group_ci_cd_analytics links << :group_ci_cd_analytics
......
...@@ -32,7 +32,13 @@ module EE ...@@ -32,7 +32,13 @@ module EE
end end
def iterations_sub_menu_controllers def iterations_sub_menu_controllers
['iterations#index', 'iterations#show'] paths = ['iterations#index', 'iterations#show']
if ::Feature.enabled?(:iteration_cadences, @group, default_enabled: :yaml)
paths << 'iteration_cadences#index'
end
paths
end end
end end
end end
- if group_sidebar_link?(:iterations) - if group_sidebar_link?(:iteration_cadences) || group_sidebar_link?(:iterations)
- iterations_path = Feature.enabled?(:iteration_cadences, @group, default_enabled: :yaml) ? group_iteration_cadences_path(@group) : group_iterations_path(@group)
= nav_link(path: iterations_sub_menu_controllers) do = nav_link(path: iterations_sub_menu_controllers) do
= link_to group_iterations_path(@group), data: { qa_selector: 'group_iterations_link' } do = link_to iterations_path, data: { qa_selector: 'group_iterations_link' } do
%span %span
= _('Iterations') = _('Iterations')
...@@ -102,6 +102,27 @@ RSpec.describe GroupsHelper do ...@@ -102,6 +102,27 @@ RSpec.describe GroupsHelper do
expect(helper.group_sidebar_links).not_to include(:group_ci_cd_analytics) expect(helper.group_sidebar_links).not_to include(:group_ci_cd_analytics)
end end
end end
context 'when iterations is available' do
before do
stub_licensed_features(iterations: true)
stub_feature_flags(iteration_cadences: false)
end
it 'shows iterations link' do
expect(helper.group_sidebar_links).to include(:iterations)
end
context 'when iteration_cadences is available' do
before do
stub_feature_flags(iteration_cadences: true)
end
it 'shows iterations link' do
expect(helper.group_sidebar_links).to include(:iteration_cadences)
end
end
end
end end
describe '#render_setting_to_allow_project_access_token_creation?' do describe '#render_setting_to_allow_project_access_token_creation?' do
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe NavHelper do
describe '#iterations_sub_menu_controllers' do
context 'when :iteration_cadences is turned on' do
it 'includes iteration_cadences#index path in the list' do
expect(helper.iterations_sub_menu_controllers).to include('iteration_cadences#index')
end
end
context 'when :iteration_cadences is NOT turned on' do
before do
stub_feature_flags(iteration_cadences: false)
end
it 'includes iteration_cadences#index path in the list' do
expect(helper.iterations_sub_menu_controllers).not_to include('iteration_cadences#index')
end
end
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