Commit 2f195eb2 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch...

Merge branch '199428-update-the-main-left-side-navigation-for-the-package-area-to-better-reflect-the-product' into 'master'

Update Package sidebar links copy

See merge request gitlab-org/gitlab!30712
parents 3c76afc5 28964dcd
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
.nav-icon-container .nav-icon-container
= sprite_icon('package') = sprite_icon('package')
%span.nav-item-name %span.nav-item-name
= _('Packages') = _('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: [:packages, :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') = _('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/container_registries') do
= link_to group_container_registries_path(@group), title: _('Container Registry') do = link_to group_container_registries_path(@group), title: _('Container Registry') do
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
.nav-icon-container .nav-icon-container
= sprite_icon('package') = sprite_icon('package')
%span.nav-item-name %span.nav-item-name
= _('Packages') = _('Packages & Registries')
%ul.sidebar-sub-level-items %ul.sidebar-sub-level-items
= nav_link(controller: :repositories, html_options: { class: "fly-out-top-item" } ) do = nav_link(controller: :repositories, html_options: { class: "fly-out-top-item" } ) do
= link_to project_container_registry_index_path(@project) do = link_to project_container_registry_index_path(@project) do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Packages') = _('Packages & Registries')
%li.divider.fly-out-top-item %li.divider.fly-out-top-item
= nav_link controller: :repositories do = nav_link controller: :repositories do
= link_to project_container_registry_index_path(@project), class: 'shortcuts-container-registry', title: _('Container Registry') do = link_to project_container_registry_index_path(@project), class: 'shortcuts-container-registry', title: _('Container Registry') do
......
---
title: Update sidebar packages name
merge_request: 30712
author:
type: changed
...@@ -6,17 +6,17 @@ ...@@ -6,17 +6,17 @@
.nav-icon-container .nav-icon-container
= sprite_icon('package') = sprite_icon('package')
%span.nav-item-name %span.nav-item-name
= _('Packages') = _('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: [:packages, :repositories], html_options: { class: "fly-out-top-item" } ) do
= link_to packages_link, title: _('Packages') do = link_to packages_link, title: _('Packages & Registries') do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Packages') = _('Packages & Registries')
%li.divider.fly-out-top-item %li.divider.fly-out-top-item
- if group_packages_list_nav? - if group_packages_list_nav?
= nav_link(controller: 'groups/packages') do = nav_link(controller: 'groups/packages') do
= link_to group_packages_path(@group), title: _('Packages') do = link_to group_packages_path(@group), title: _('Packages') do
%span= _('List') %span= _('Package Registry')
- if group_container_registry_nav? - if group_container_registry_nav?
= nav_link(controller: 'groups/container_registries') do = nav_link(controller: 'groups/container_registries') do
= link_to group_container_registries_path(@group), title: _('Container Registry') do = link_to group_container_registries_path(@group), title: _('Container Registry') do
......
...@@ -6,17 +6,17 @@ ...@@ -6,17 +6,17 @@
.nav-icon-container .nav-icon-container
= sprite_icon('package') = sprite_icon('package')
%span.nav-item-name %span.nav-item-name
= _('Packages') = _('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: [:packages, :repositories], html_options: { class: "fly-out-top-item" } ) do
= link_to packages_link do = link_to packages_link do
%strong.fly-out-top-item-name %strong.fly-out-top-item-name
= _('Packages') = _('Packages & Registries')
%li.divider.fly-out-top-item %li.divider.fly-out-top-item
- if project_nav_tab? :packages - if project_nav_tab? :packages
= nav_link controller: :packages do = nav_link controller: :packages do
= link_to project_packages_path(@project), title: _('Packages') do = link_to project_packages_path(@project), title: _('Package Registry') do
%span= _('List') %span= _('Package Registry')
- if project_nav_tab? :container_registry - if project_nav_tab? :container_registry
= nav_link controller: :repositories do = nav_link controller: :repositories do
= link_to project_container_registry_index_path(@project), class: 'shortcuts-container-registry', title: _('Container Registry') do = link_to project_container_registry_index_path(@project), class: 'shortcuts-container-registry', title: _('Container Registry') do
......
...@@ -141,4 +141,39 @@ describe 'Group navbar' do ...@@ -141,4 +141,39 @@ describe 'Group navbar' do
it_behaves_like 'verified navigation bar' it_behaves_like 'verified navigation bar'
end end
context 'when packages are available' do
before do
stub_config(packages: { enabled: true }, registry: { enabled: false })
stub_licensed_features(packages: true)
insert_after_nav_item(
_('Kubernetes'),
new_nav_item: {
nav_item: _('Packages & Registries'),
nav_sub_items: [_('Package Registry')]
}
)
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
context 'when container registry is available' do
before do
stub_config(registry: { enabled: true })
insert_after_sub_nav_item(
_('Package Registry'),
within: _('Packages & Registries'),
new_sub_nav_item_name: _('Container Registry')
)
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
end
end end
...@@ -61,16 +61,14 @@ describe 'Project navbar' do ...@@ -61,16 +61,14 @@ describe 'Project navbar' do
context 'when packages are available' do context 'when packages are available' do
before do before do
allow(Gitlab.config.packages).to receive(:enabled).and_return(true) stub_config(packages: { enabled: true }, registry: { enabled: false })
stub_licensed_features(packages: true) stub_licensed_features(packages: true)
insert_after_nav_item( insert_after_nav_item(
_('Operations'), _('Operations'),
new_nav_item: { new_nav_item: {
nav_item: _('Packages'), nav_item: _('Packages & Registries'),
nav_sub_items: [ nav_sub_items: [_('Package Registry')]
_('List')
]
} }
) )
...@@ -78,6 +76,22 @@ describe 'Project navbar' do ...@@ -78,6 +76,22 @@ describe 'Project navbar' do
end end
it_behaves_like 'verified navigation bar' it_behaves_like 'verified navigation bar'
context 'when container registry is available' do
before do
stub_config(registry: { enabled: true })
insert_after_sub_nav_item(
_('Package Registry'),
within: _('Packages & Registries'),
new_sub_nav_item_name: _('Container Registry')
)
visit project_path(project)
end
it_behaves_like 'verified navigation bar'
end
end end
context 'when requirements is available' do context 'when requirements is available' do
......
...@@ -224,6 +224,9 @@ describe 'layouts/nav/sidebar/_project' do ...@@ -224,6 +224,9 @@ describe 'layouts/nav/sidebar/_project' do
describe 'Packages' do describe 'Packages' do
let(:user) { create(:user) } let(:user) { create(:user) }
let_it_be(:package_menu_name) { 'Packages & Registries' }
let_it_be(:package_entry_name) { 'Package Registry' }
before do before do
project.team.add_developer(user) project.team.add_developer(user)
sign_in(user) sign_in(user)
...@@ -234,13 +237,13 @@ describe 'layouts/nav/sidebar/_project' do ...@@ -234,13 +237,13 @@ describe 'layouts/nav/sidebar/_project' do
it 'packages link is visible' do it 'packages link is visible' do
render render
expect(rendered).to have_link('Packages', href: project_packages_path(project)) expect(rendered).to have_link(package_menu_name, href: project_packages_path(project))
end end
it 'packages list link is visible' do it 'packages list link is visible' do
render render
expect(rendered).to have_link('List', href: project_packages_path(project)) expect(rendered).to have_link(package_entry_name, href: project_packages_path(project))
end end
it 'container registry link is visible' do it 'container registry link is visible' do
...@@ -258,19 +261,19 @@ describe 'layouts/nav/sidebar/_project' do ...@@ -258,19 +261,19 @@ describe 'layouts/nav/sidebar/_project' do
it 'packages list link is not visible' do it 'packages list link is not visible' do
render render
expect(rendered).not_to have_link('List', href: project_packages_path(project)) expect(rendered).not_to have_link(package_entry_name, href: project_packages_path(project))
end end
it 'top level packages link links to container registry' do it 'top level packages link links to container registry' do
render render
expect(rendered).to have_link('Packages', href: project_container_registry_index_path(project)) expect(rendered).to have_link(package_menu_name, href: project_container_registry_index_path(project))
end end
it 'packages top level and container registry links are visible' do it 'packages top level and container registry links are visible' do
render render
expect(rendered).to have_link('Packages', href: project_container_registry_index_path(project)) expect(rendered).to have_link(package_menu_name, href: project_container_registry_index_path(project))
expect(rendered).to have_link('Container Registry', href: project_container_registry_index_path(project)) expect(rendered).to have_link('Container Registry', href: project_container_registry_index_path(project))
end end
end end
...@@ -283,8 +286,8 @@ describe 'layouts/nav/sidebar/_project' do ...@@ -283,8 +286,8 @@ describe 'layouts/nav/sidebar/_project' do
it 'packages top level and list link are visible' do it 'packages top level and list link are visible' do
render render
expect(rendered).to have_link('Packages', href: project_packages_path(project)) expect(rendered).to have_link(package_menu_name, href: project_packages_path(project))
expect(rendered).to have_link('List', href: project_packages_path(project)) expect(rendered).to have_link(package_entry_name, href: project_packages_path(project))
end end
it 'container registry link is not visible' do it 'container registry link is not visible' do
...@@ -303,7 +306,7 @@ describe 'layouts/nav/sidebar/_project' do ...@@ -303,7 +306,7 @@ describe 'layouts/nav/sidebar/_project' do
it 'packages top level item is not visible' do it 'packages top level item is not visible' do
render render
expect(rendered).not_to have_link('Packages', href: project_packages_path(project)) expect(rendered).not_to have_link(package_menu_name, href: project_packages_path(project))
end end
end end
end end
......
...@@ -14800,6 +14800,9 @@ msgstr "" ...@@ -14800,6 +14800,9 @@ msgstr ""
msgid "Packages" msgid "Packages"
msgstr "" msgstr ""
msgid "Packages & Registries"
msgstr ""
msgid "Page not found" msgid "Page not found"
msgstr "" msgstr ""
......
...@@ -20,4 +20,21 @@ describe 'Group navbar' do ...@@ -20,4 +20,21 @@ describe 'Group navbar' do
visit group_path(group) visit group_path(group)
end end
end end
context 'when container registry is available' do
before do
stub_config(registry: { enabled: true })
insert_after_nav_item(
_('Kubernetes'),
new_nav_item: {
nav_item: _('Packages & Registries'),
nav_sub_items: [_('Container Registry')]
}
)
visit group_path(group)
end
it_behaves_like 'verified navigation bar'
end
end end
...@@ -42,7 +42,7 @@ describe 'Project navbar' do ...@@ -42,7 +42,7 @@ describe 'Project navbar' do
context 'when pages are available' do context 'when pages are available' do
before do before do
allow(Gitlab.config.pages).to receive(:enabled).and_return(true) stub_config(pages: { enabled: true })
insert_after_sub_nav_item( insert_after_sub_nav_item(
_('Operations'), _('Operations'),
...@@ -55,4 +55,21 @@ describe 'Project navbar' do ...@@ -55,4 +55,21 @@ describe 'Project navbar' do
it_behaves_like 'verified navigation bar' it_behaves_like 'verified navigation bar'
end end
context 'when container registry is available' do
before do
stub_config(registry: { enabled: true })
insert_after_nav_item(
_('Operations'),
new_nav_item: {
nav_item: _('Packages & Registries'),
nav_sub_items: [_('Container Registry')]
}
)
visit project_path(project)
end
it_behaves_like 'verified navigation bar'
end
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