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
e19429b9
Commit
e19429b9
authored
May 14, 2021
by
Francisco Javier López
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move group Labels menu item to Group information menu
parent
c6a85564
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
14 deletions
+27
-14
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+3
-1
app/helpers/nav_helper.rb
app/helpers/nav_helper.rb
+8
-1
app/views/layouts/nav/sidebar/_group.html.haml
app/views/layouts/nav/sidebar/_group.html.haml
+9
-3
spec/features/groups/navbar_spec.rb
spec/features/groups/navbar_spec.rb
+1
-7
spec/helpers/nav_helper_spec.rb
spec/helpers/nav_helper_spec.rb
+4
-0
spec/support/shared_contexts/navbar_structure_context.rb
spec/support/shared_contexts/navbar_structure_context.rb
+2
-2
No files found.
app/helpers/groups_helper.rb
View file @
e19429b9
...
@@ -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
...
...
app/helpers/nav_helper.rb
View file @
e19429b9
...
@@ -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
...
...
app/views/layouts/nav/sidebar/_group.html.haml
View file @
e19429b9
...
@@ -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
...
...
spec/features/groups/navbar_spec.rb
View file @
e19429b9
...
@@ -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'
)
]
]
},
},
...
...
spec/helpers/nav_helper_spec.rb
View file @
e19429b9
...
@@ -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
...
...
spec/support/shared_contexts/navbar_structure_context.rb
View file @
e19429b9
...
@@ -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'
)
]
]
},
},
...
...
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