Commit b4f6148f authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch '23315-feature-flag-entity' into 'master'

Add project and group to feature flag check

See merge request gitlab-org/gitlab!25894
parents 304a69bb 22c19861
...@@ -17,7 +17,7 @@ module Groups ...@@ -17,7 +17,7 @@ module Groups
serializer = ContainerRepositoriesSerializer serializer = ContainerRepositoriesSerializer
.new(current_user: current_user) .new(current_user: current_user)
if Feature.enabled?(:vue_container_registry_explorer) if Feature.enabled?(:vue_container_registry_explorer, group)
render json: serializer.with_pagination(request, response) render json: serializer.with_pagination(request, response)
.represent_read_only(@images) .represent_read_only(@images)
else else
......
...@@ -17,7 +17,7 @@ module Projects ...@@ -17,7 +17,7 @@ module Projects
serializer = ContainerRepositoriesSerializer serializer = ContainerRepositoriesSerializer
.new(project: project, current_user: current_user) .new(project: project, current_user: current_user)
if Feature.enabled?(:vue_container_registry_explorer) if Feature.enabled?(:vue_container_registry_explorer, project.group)
render json: serializer.with_pagination(request, response).represent(@images) render json: serializer.with_pagination(request, response).represent(@images)
else else
render json: serializer.represent(@images) render json: serializer.represent(@images)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%section %section
.row.registry-placeholder.prepend-bottom-10 .row.registry-placeholder.prepend-bottom-10
.col-12 .col-12
- if Feature.enabled?(:vue_container_registry_explorer, @project) - if Feature.enabled?(:vue_container_registry_explorer, @project.group)
#js-container-registry{ data: { endpoint: project_container_registry_index_path(@project), #js-container-registry{ data: { endpoint: project_container_registry_index_path(@project),
project_path: @project.full_path, project_path: @project.full_path,
"help_page_path" => help_page_path('user/packages/container_registry/index'), "help_page_path" => help_page_path('user/packages/container_registry/index'),
......
...@@ -93,7 +93,7 @@ describe Groups::Registry::RepositoriesController do ...@@ -93,7 +93,7 @@ describe Groups::Registry::RepositoriesController do
context 'with :vue_container_registry_explorer feature flag disabled' do context 'with :vue_container_registry_explorer feature flag disabled' do
before do before do
stub_feature_flags(vue_container_registry_explorer: false) stub_feature_flags(vue_container_registry_explorer: { enabled: false, thing: group })
end end
it 'has the correct response schema' do it 'has the correct response schema' do
......
...@@ -88,7 +88,7 @@ describe Projects::Registry::RepositoriesController do ...@@ -88,7 +88,7 @@ describe Projects::Registry::RepositoriesController do
context 'with :vue_container_registry_explorer feature flag disabled' do context 'with :vue_container_registry_explorer feature flag disabled' do
before do before do
stub_feature_flags(vue_container_registry_explorer: false) stub_feature_flags(vue_container_registry_explorer: { enabled: false, thing: project.group })
stub_container_registry_tags(repository: project.full_path, stub_container_registry_tags(repository: project.full_path,
tags: %w[rc1 latest]) tags: %w[rc1 latest])
end end
......
...@@ -19,7 +19,7 @@ describe 'Container Registry', :js do ...@@ -19,7 +19,7 @@ describe 'Container Registry', :js do
describe 'Registry explorer is off' do describe 'Registry explorer is off' do
before do before do
stub_feature_flags(vue_container_registry_explorer: false) stub_feature_flags(vue_container_registry_explorer: { enabled: false, thing: project.group })
end end
it 'has a page title set' do it 'has a page title set' do
......
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