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
babf37d6
Commit
babf37d6
authored
Apr 01, 2021
by
Nicolò Maria Mezzopera
Committed by
Vitali Tatarintev
Apr 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add infrastructure registry to sidebar
- source - tests - test helper
parent
52ab1ffd
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
63 additions
and
12 deletions
+63
-12
app/assets/javascripts/pages/projects/packages/infrastructure_registry/index/index.js
.../projects/packages/infrastructure_registry/index/index.js
+3
-0
app/controllers/projects/packages/infrastructure_registry_controller.rb
...s/projects/packages/infrastructure_registry_controller.rb
+9
-0
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+4
-0
app/views/layouts/nav/sidebar/_project_packages_link.html.haml
...iews/layouts/nav/sidebar/_project_packages_link.html.haml
+6
-2
app/views/projects/packages/infrastructure_registry/index.html.haml
...projects/packages/infrastructure_registry/index.html.haml
+10
-0
config/feature_flags/development/infrastructure_registry_page.yml
...eature_flags/development/infrastructure_registry_page.yml
+8
-0
config/routes/project.rb
config/routes/project.rb
+2
-0
ee/spec/features/projects/navbar_spec.rb
ee/spec/features/projects/navbar_spec.rb
+3
-5
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/features/groups/navbar_spec.rb
spec/features/groups/navbar_spec.rb
+2
-2
spec/features/projects/navbar_spec.rb
spec/features/projects/navbar_spec.rb
+3
-1
spec/support/helpers/navbar_structure_helper.rb
spec/support/helpers/navbar_structure_helper.rb
+10
-2
No files found.
app/assets/javascripts/pages/projects/packages/infrastructure_registry/index/index.js
0 → 100644
View file @
babf37d6
import
initPackageList
from
'
~/packages/list/packages_list_app_bundle
'
;
initPackageList
();
app/controllers/projects/packages/infrastructure_registry_controller.rb
0 → 100644
View file @
babf37d6
# frozen_string_literal: true
module
Projects
module
Packages
class
InfrastructureRegistryController
<
Projects
::
ApplicationController
feature_category
:infrastructure_as_code
end
end
end
app/helpers/projects_helper.rb
View file @
babf37d6
...
@@ -410,6 +410,10 @@ module ProjectsHelper
...
@@ -410,6 +410,10 @@ module ProjectsHelper
nav_tabs
<<
:container_registry
nav_tabs
<<
:container_registry
end
end
if
Feature
.
enabled?
(
:infrastructure_registry_page
)
nav_tabs
<<
:infrastructure_registry
end
# Pipelines feature is tied to presence of builds
# Pipelines feature is tied to presence of builds
if
can?
(
current_user
,
:read_build
,
project
)
if
can?
(
current_user
,
:read_build
,
project
)
nav_tabs
<<
:pipelines
nav_tabs
<<
:pipelines
...
...
app/views/layouts/nav/sidebar/_project_packages_link.html.haml
View file @
babf37d6
-
packages_link
=
project_nav_tab?
(
:packages
)
?
project_packages_path
(
@project
)
:
project_container_registry_index_path
(
@project
)
-
packages_link
=
project_nav_tab?
(
:packages
)
?
project_packages_path
(
@project
)
:
project_container_registry_index_path
(
@project
)
-
if
(
project_nav_tab?
(
:packages
)
||
project_nav_tab?
(
:container_registry
))
-
if
(
project_nav_tab?
(
:packages
)
||
project_nav_tab?
(
:container_registry
))
=
nav_link
controller:
[
:packages
,
:repositories
]
do
=
nav_link
controller:
[
:packages
,
:repositories
,
:infrastructure_registry
]
do
=
link_to
packages_link
,
data:
{
qa_selector:
'packages_link'
}
do
=
link_to
packages_link
,
data:
{
qa_selector:
'packages_link'
}
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:
[
:packages
,
:repositories
,
:infrastructure_registry
],
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 & Registries'
)
=
_
(
'Packages & Registries'
)
...
@@ -21,3 +21,7 @@
...
@@ -21,3 +21,7 @@
=
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
%span
=
_
(
'Container Registry'
)
%span
=
_
(
'Container Registry'
)
-
if
project_nav_tab?
:infrastructure_registry
=
nav_link
controller: :infrastructure_registry
do
=
link_to
project_infrastructure_registry_index_path
(
@project
),
title:
_
(
'Infrastructure Registry'
)
do
%span
=
_
(
'Infrastructure Registry'
)
app/views/projects/packages/infrastructure_registry/index.html.haml
0 → 100644
View file @
babf37d6
-
page_title
_
(
"Infrastructure Registry"
)
-
@content_class
=
"limit-container-width"
unless
fluid_layout
.row
.col-12
#js-vue-packages-list
{
data:
{
resource_id:
@project
.
id
,
page_type:
'project'
,
empty_list_help_url:
help_page_path
(
'user/packages/package_registry/index'
),
empty_list_illustration:
image_path
(
'illustrations/no-packages.svg'
),
package_help_url:
help_page_path
(
'user/packages/index'
)
}
}
config/feature_flags/development/infrastructure_registry_page.yml
0 → 100644
View file @
babf37d6
---
name
:
infrastructure_registry_page
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57338
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/326460
milestone
:
'
13.11'
type
:
development
group
:
group::package
default_enabled
:
false
config/routes/project.rb
View file @
babf37d6
...
@@ -50,6 +50,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
...
@@ -50,6 +50,8 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
end
end
end
end
resources
:infrastructure_registry
,
only:
[
:index
],
module: :packages
resources
:jobs
,
only:
[
:index
,
:show
],
constraints:
{
id:
/\d+/
}
do
resources
:jobs
,
only:
[
:index
,
:show
],
constraints:
{
id:
/\d+/
}
do
collection
do
collection
do
resources
:artifacts
,
only:
[]
do
resources
:artifacts
,
only:
[]
do
...
...
ee/spec/features/projects/navbar_spec.rb
View file @
babf37d6
...
@@ -12,6 +12,8 @@ RSpec.describe 'Project navbar' do
...
@@ -12,6 +12,8 @@ RSpec.describe 'Project navbar' do
before
do
before
do
insert_package_nav
(
_
(
'Operations'
))
insert_package_nav
(
_
(
'Operations'
))
insert_infrastructure_registry_nav
stub_config
(
registry:
{
enabled:
false
})
project
.
add_maintainer
(
user
)
project
.
add_maintainer
(
user
)
sign_in
(
user
)
sign_in
(
user
)
...
@@ -67,11 +69,7 @@ RSpec.describe 'Project navbar' do
...
@@ -67,11 +69,7 @@ RSpec.describe 'Project navbar' do
before
do
before
do
stub_config
(
registry:
{
enabled:
true
})
stub_config
(
registry:
{
enabled:
true
})
insert_after_sub_nav_item
(
insert_container_nav
_
(
'Package Registry'
),
within:
_
(
'Packages & Registries'
),
new_sub_nav_item_name:
_
(
'Container Registry'
)
)
visit
project_path
(
project
)
visit
project_path
(
project
)
end
end
...
...
locale/gitlab.pot
View file @
babf37d6
...
@@ -16488,6 +16488,9 @@ msgstr ""
...
@@ -16488,6 +16488,9 @@ msgstr ""
msgid "Information about additional Pages templates and how to install them can be found in our %{pages_getting_started_guide}."
msgid "Information about additional Pages templates and how to install them can be found in our %{pages_getting_started_guide}."
msgstr ""
msgstr ""
msgid "Infrastructure Registry"
msgstr ""
msgid "Inherited"
msgid "Inherited"
msgstr ""
msgstr ""
...
...
spec/features/groups/navbar_spec.rb
View file @
babf37d6
...
@@ -68,7 +68,7 @@ RSpec.describe 'Group navbar' do
...
@@ -68,7 +68,7 @@ RSpec.describe 'Group navbar' do
before
do
before
do
stub_config
(
registry:
{
enabled:
true
})
stub_config
(
registry:
{
enabled:
true
})
insert_container_nav
(
_
(
'Kubernetes'
))
insert_container_nav
visit
group_path
(
group
)
visit
group_path
(
group
)
end
end
...
@@ -80,7 +80,7 @@ RSpec.describe 'Group navbar' do
...
@@ -80,7 +80,7 @@ RSpec.describe 'Group navbar' do
before
do
before
do
stub_config
(
dependency_proxy:
{
enabled:
true
})
stub_config
(
dependency_proxy:
{
enabled:
true
})
insert_dependency_proxy_nav
(
_
(
'Dependency Proxy'
))
insert_dependency_proxy_nav
visit
group_path
(
group
)
visit
group_path
(
group
)
end
end
...
...
spec/features/projects/navbar_spec.rb
View file @
babf37d6
...
@@ -13,6 +13,8 @@ RSpec.describe 'Project navbar' do
...
@@ -13,6 +13,8 @@ RSpec.describe 'Project navbar' do
before
do
before
do
insert_package_nav
(
_
(
'Operations'
))
insert_package_nav
(
_
(
'Operations'
))
insert_infrastructure_registry_nav
stub_config
(
registry:
{
enabled:
false
})
project
.
add_maintainer
(
user
)
project
.
add_maintainer
(
user
)
sign_in
(
user
)
sign_in
(
user
)
...
@@ -60,7 +62,7 @@ RSpec.describe 'Project navbar' do
...
@@ -60,7 +62,7 @@ RSpec.describe 'Project navbar' do
before
do
before
do
stub_config
(
registry:
{
enabled:
true
})
stub_config
(
registry:
{
enabled:
true
})
insert_container_nav
(
_
(
'Operations'
))
insert_container_nav
visit
project_path
(
project
)
visit
project_path
(
project
)
end
end
...
...
spec/support/helpers/navbar_structure_helper.rb
View file @
babf37d6
...
@@ -29,7 +29,7 @@ module NavbarStructureHelper
...
@@ -29,7 +29,7 @@ module NavbarStructureHelper
)
)
end
end
def
insert_container_nav
(
within
)
def
insert_container_nav
insert_after_sub_nav_item
(
insert_after_sub_nav_item
(
_
(
'Package Registry'
),
_
(
'Package Registry'
),
within:
_
(
'Packages & Registries'
),
within:
_
(
'Packages & Registries'
),
...
@@ -37,11 +37,19 @@ module NavbarStructureHelper
...
@@ -37,11 +37,19 @@ module NavbarStructureHelper
)
)
end
end
def
insert_dependency_proxy_nav
(
within
)
def
insert_dependency_proxy_nav
insert_after_sub_nav_item
(
insert_after_sub_nav_item
(
_
(
'Package Registry'
),
_
(
'Package Registry'
),
within:
_
(
'Packages & Registries'
),
within:
_
(
'Packages & Registries'
),
new_sub_nav_item_name:
_
(
'Dependency Proxy'
)
new_sub_nav_item_name:
_
(
'Dependency Proxy'
)
)
)
end
end
def
insert_infrastructure_registry_nav
insert_after_sub_nav_item
(
_
(
'Package Registry'
),
within:
_
(
'Packages & Registries'
),
new_sub_nav_item_name:
_
(
'Infrastructure Registry'
)
)
end
end
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