Commit 0b67a824 authored by Phil Hughes's avatar Phil Hughes

Merge branch '217955-package-group-sidebar-stay-collapsed' into 'master'

Enable active class on package group sidebar

See merge request gitlab-org/gitlab!34518
parents 1c369790 e1ac81fc
- if group_container_registry_nav? - 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 = link_to group_container_registries_path(@group), title: _('Container Registry') do
.nav-icon-container .nav-icon-container
= sprite_icon('package') = sprite_icon('package')
%span.nav-item-name %span.nav-item-name
= _('Packages & Registries') = _('Packages & Registries')
%ul.sidebar-sub-level-items %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 = link_to group_container_registries_path(@group), title: _('Container Registry') do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Packages & Registries') = _('Packages & Registries')
%li.divider.fly-out-top-item %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 = link_to group_container_registries_path(@group), title: _('Container Registry') do
%span= _('Container Registry') %span= _('Container Registry')
- packages_link = group_packages_list_nav? ? group_packages_path(@group) : group_container_registries_path(@group) - packages_link = group_packages_list_nav? ? group_packages_path(@group) : group_container_registries_path(@group)
- if group_packages_nav? - 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 = link_to packages_link, title: _('Packages') do
.nav-icon-container .nav-icon-container
= sprite_icon('package') = sprite_icon('package')
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
= link_to group_packages_path(@group), title: _('Packages') do = link_to group_packages_path(@group), title: _('Packages') do
%span= _('Package Registry') %span= _('Package Registry')
- if group_container_registry_nav? - 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 = link_to group_container_registries_path(@group), title: _('Container Registry') do
%span= _('Container Registry') %span= _('Container Registry')
- if group_dependency_proxy_nav? - 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 ...@@ -35,6 +35,11 @@ RSpec.describe 'Group Dependency Proxy' do
visit path visit path
end 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 it 'toggles defaults to enabled' do
page.within('.js-dependency-proxy-toggle-area') do page.within('.js-dependency-proxy-toggle-area') do
expect(find('.js-project-feature-toggle-input', visible: false).value).to eq('true') expect(find('.js-project-feature-toggle-input', visible: false).value).to eq('true')
......
...@@ -39,11 +39,16 @@ RSpec.describe 'Group Packages' do ...@@ -39,11 +39,16 @@ RSpec.describe 'Group Packages' do
end end
end end
context 'when there are packages', :js do context 'when feature is available', :js do
before do before do
visit_group_packages visit_group_packages
end 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 context 'when there are packages' do
let_it_be(:second_project) { create(:project, name: 'second-project', group: group) } 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') } 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 @@ RSpec.describe 'Container Registry', :js do ...@@ -24,6 +24,13 @@ RSpec.describe 'Container Registry', :js do
expect(page).to have_title _('Container Registry') expect(page).to have_title _('Container Registry')
end 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 context 'when there are no image repositories' do
it 'list page has no container title' do it 'list page has no container title' do
visit_container_registry 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