Commit c1698f41 authored by Nick Kipling's avatar Nick Kipling

Improving packages navigation in project sidebar

Removed Registry from sidebar
Created new Packages top level item
Added Container Registry into packages
Updated tests to support new layout
parent 9cffa428
......@@ -274,19 +274,6 @@
= render_if_exists 'layouts/nav/sidebar/project_feature_flags_link'
- if project_nav_tab? :container_registry
= nav_link(controller: %w[projects/registry/repositories]) do
= link_to project_container_registry_index_path(@project), class: 'shortcuts-container-registry' do
.nav-icon-container
= sprite_icon('disk')
%span.nav-item-name
= _('Registry')
%ul.sidebar-sub-level-items.is-fly-out-only
= nav_link(controller: %w[projects/registry/repositories], html_options: { class: "fly-out-top-item" } ) do
= link_to project_container_registry_index_path(@project) do
%strong.fly-out-top-item-name
= _('Registry')
= render_if_exists 'layouts/nav/sidebar/project_packages_link'
- if project_nav_tab? :wiki
......
- if project_nav_tab? :container_registry
= nav_link controller: :repositories do
= link_to project_container_registry_index_path(@project) do
.nav-icon-container
= sprite_icon('package')
%span.nav-item-name
= _('Packages')
%ul.sidebar-sub-level-items
= nav_link(controller: :repositories, html_options: { class: "fly-out-top-item" } ) do
= link_to project_container_registry_index_path(@project) do
%strong.fly-out-top-item-name
= _('Packages')
%li.divider.fly-out-top-item
= nav_link controller: :repositories do
= link_to project_container_registry_index_path(@project), class: 'shortcuts-container-registry', title: _('Container Registry') do
%span= _('Container Registry')
......@@ -7276,6 +7276,9 @@ msgstr ""
msgid "Owner"
msgstr ""
msgid "Packages"
msgstr ""
msgid "Page not found"
msgstr ""
......@@ -8772,9 +8775,6 @@ msgstr ""
msgid "Register with two-factor app"
msgstr ""
msgid "Registry"
msgstr ""
msgid "Related Deployed Jobs"
msgstr ""
......
......@@ -21,7 +21,7 @@ describe 'layouts/nav/sidebar/_project' do
end
end
describe 'container registry tab' do
describe 'packages tab' do
before do
stub_container_registry_config(enabled: true)
......@@ -31,24 +31,17 @@ describe 'layouts/nav/sidebar/_project' do
.and_return('projects/registry/repositories')
end
it 'has both Registry and Repository tabs' do
render
expect(rendered).to have_text 'Repository'
expect(rendered).to have_text 'Registry'
end
it 'highlights sidebar item and flyout' do
render
expect(rendered).to have_css('.sidebar-top-level-items > li.active', count: 1)
expect(rendered).to have_css('.is-fly-out-only > li.active', count: 1)
expect(rendered).to have_css('.sidebar-sub-level-items > li.fly-out-top-item.active', count: 1)
end
it 'highlights container registry tab' do
render
expect(rendered).to have_css('.sidebar-top-level-items > li.active', text: 'Registry')
expect(rendered).to have_css('.sidebar-sub-level-items > li:not(.fly-out-top-item).active', text: 'Container Registry')
end
end
......
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