Commit e1ac81fc authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera Committed by Phil Hughes

Update package sidebar to display active

- ce sidebar
- ee sidebar
parent 9a2df659
- if group_container_registry_nav?
= nav_link(path: group_packages_nav_link_paths) do
= nav_link(controller: 'groups/registry/repositories') do
= link_to group_container_registries_path(@group), title: _('Container Registry') do
.nav-icon-container
= sprite_icon('package')
%span.nav-item-name
= _('Packages & Registries')
%ul.sidebar-sub-level-items
= nav_link(controller: [:packages, :repositories], html_options: { class: "fly-out-top-item" } ) do
= nav_link(controller: 'groups/registry/repositories', html_options: { class: "fly-out-top-item" } ) do
= link_to group_container_registries_path(@group), title: _('Container Registry') do
%strong.fly-out-top-item-name
= _('Packages & Registries')
%li.divider.fly-out-top-item
= nav_link(controller: 'groups/container_registries') do
= nav_link(controller: 'groups/registry/repositories') do
= link_to group_container_registries_path(@group), title: _('Container Registry') do
%span= _('Container Registry')
- packages_link = group_packages_list_nav? ? group_packages_path(@group) : group_container_registries_path(@group)
- if group_packages_nav?
= nav_link(path: group_packages_nav_link_paths) do
= nav_link(controller: ['groups/packages', 'groups/registry/repositories', 'groups/dependency_proxies']) do
= link_to packages_link, title: _('Packages') do
.nav-icon-container
= sprite_icon('package')
......@@ -18,7 +18,7 @@
= link_to group_packages_path(@group), title: _('Packages') do
%span= _('Package Registry')
- if group_container_registry_nav?
= nav_link(controller: 'groups/container_registries') do
= nav_link(controller: 'groups/registry/repositories') do
= link_to group_container_registries_path(@group), title: _('Container Registry') do
%span= _('Container Registry')
- if group_dependency_proxy_nav?
......
---
title: Enable active class on group packages sidebar navigation items
merge_request: 34518
author:
type: fixed
......@@ -35,6 +35,11 @@ RSpec.describe 'Group Dependency Proxy' do
visit path
end
it 'sidebar menu is open' do
sidebar = find('.nav-sidebar')
expect(sidebar).to have_link _('Dependency Proxy')
end
it 'toggles defaults to enabled' do
page.within('.js-dependency-proxy-toggle-area') do
expect(find('.js-project-feature-toggle-input', visible: false).value).to eq('true')
......
......@@ -39,11 +39,16 @@ RSpec.describe 'Group Packages' do
end
end
context 'when there are packages', :js do
context 'when feature is available', :js do
before do
visit_group_packages
end
it 'sidebar menu is open' do
sidebar = find('.nav-sidebar')
expect(sidebar).to have_link _('Package Registry')
end
context 'when there are packages' do
let_it_be(:second_project) { create(:project, name: 'second-project', group: group) }
let_it_be(:conan_package) { create(:conan_package, project: project, name: 'zzz', created_at: 1.day.ago, version: '1.0.0') }
......
......@@ -24,6 +24,13 @@ describe 'Container Registry', :js do
expect(page).to have_title _('Container Registry')
end
it 'sidebar menu is open' do
visit_container_registry
sidebar = find('.nav-sidebar')
expect(sidebar).to have_link _('Container Registry')
end
context 'when there are no image repositories' do
it 'list page has no container title' do
visit_container_registry
......
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