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
b7abc7eb
Commit
b7abc7eb
authored
Mar 26, 2021
by
Angelo Gulina
Committed by
Jan Provaznik
Mar 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add controller path to helper to display active state
parent
c3228bff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletion
+18
-1
ee/app/helpers/admin/navbar_helper.rb
ee/app/helpers/admin/navbar_helper.rb
+4
-0
ee/app/views/layouts/nav/sidebar/_licenses_link.html.haml
ee/app/views/layouts/nav/sidebar/_licenses_link.html.haml
+1
-1
ee/changelogs/unreleased/ag-325650-admin-license-nav-bar-does-not-display-active-status.yml
...-admin-license-nav-bar-does-not-display-active-status.yml
+5
-0
ee/spec/helpers/admin/navbar_helper_spec.rb
ee/spec/helpers/admin/navbar_helper_spec.rb
+8
-0
No files found.
ee/app/helpers/admin/navbar_helper.rb
View file @
b7abc7eb
...
...
@@ -2,6 +2,10 @@
module
Admin
module
NavbarHelper
def
navbar_controller_path
cloud_license_enabled?
?
'admin/cloud_licenses'
:
'admin/licenses'
end
def
navbar_item_name
cloud_license_enabled?
?
_
(
'Cloud License'
)
:
_
(
'License'
)
end
...
...
ee/app/views/layouts/nav/sidebar/_licenses_link.html.haml
View file @
b7abc7eb
=
nav_link
(
controller:
controller
)
do
=
nav_link
(
controller:
navbar_controller_path
)
do
=
link_to
navbar_item_path
,
class:
"qa-link-license-menu"
do
.nav-icon-container
=
sprite_icon
(
'license'
)
...
...
ee/changelogs/unreleased/ag-325650-admin-license-nav-bar-does-not-display-active-status.yml
0 → 100644
View file @
b7abc7eb
---
title
:
Fix active state for license link in navigation bar
merge_request
:
57214
author
:
type
:
fixed
ee/spec/helpers/admin/navbar_helper_spec.rb
View file @
b7abc7eb
...
...
@@ -10,6 +10,10 @@ RSpec.describe Admin::NavbarHelper do
stub_application_setting
(
cloud_license_enabled:
true
)
end
it
'returns the correct controller path'
do
expect
(
helper
.
navbar_controller_path
).
to
eq
(
'admin/cloud_licenses'
)
end
it
'returns the correct navbar item name'
do
expect
(
helper
.
navbar_item_name
).
to
eq
(
'Cloud License'
)
end
...
...
@@ -24,6 +28,10 @@ RSpec.describe Admin::NavbarHelper do
stub_application_setting
(
cloud_license_enabled:
false
)
end
it
'returns the correct controller path'
do
expect
(
helper
.
navbar_controller_path
).
to
eq
(
'admin/licenses'
)
end
it
'returns the correct navbar item name'
do
expect
(
helper
.
navbar_item_name
).
to
eq
(
'License'
)
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