Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b696e7d3
Commit
b696e7d3
authored
Jun 22, 2021
by
Scott Stern
Committed by
Heinrich Lee Yu
Jun 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change route for iterations at the group level in right sidebar
parent
f67f17a8
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
5 deletions
+60
-5
ee/app/helpers/ee/groups_helper.rb
ee/app/helpers/ee/groups_helper.rb
+6
-2
ee/app/helpers/ee/nav_helper.rb
ee/app/helpers/ee/nav_helper.rb
+7
-1
ee/app/views/layouts/nav/sidebar/_group_iterations_link.html.haml
...iews/layouts/nav/sidebar/_group_iterations_link.html.haml
+3
-2
ee/spec/helpers/ee/groups_helper_spec.rb
ee/spec/helpers/ee/groups_helper_spec.rb
+21
-0
ee/spec/helpers/ee/nav_helper_spec.rb
ee/spec/helpers/ee/nav_helper_spec.rb
+23
-0
No files found.
ee/app/helpers/ee/groups_helper.rb
View file @
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
...
...
ee/app/helpers/ee/nav_helper.rb
View file @
b696e7d3
...
@@ -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
ee/app/views/layouts/nav/sidebar/_group_iterations_link.html.haml
View file @
b696e7d3
-
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'
)
ee/spec/helpers/ee/groups_helper_spec.rb
View file @
b696e7d3
...
@@ -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
...
...
ee/spec/helpers/ee/nav_helper_spec.rb
0 → 100644
View file @
b696e7d3
# 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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment