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
serializer = ContainerRepositoriesSerializer
.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)
.represent_read_only(@images)
else
......
......@@ -17,7 +17,7 @@ module Projects
serializer = ContainerRepositoriesSerializer
.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)
else
render json: serializer.represent(@images)
......
......@@ -4,7 +4,7 @@
%section
.row.registry-placeholder.prepend-bottom-10
.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),
project_path: @project.full_path,
"help_page_path" => help_page_path('user/packages/container_registry/index'),
......
......@@ -93,7 +93,7 @@ describe Groups::Registry::RepositoriesController do
context 'with :vue_container_registry_explorer feature flag disabled' do
before do
stub_feature_flags(vue_container_registry_explorer: false)
stub_feature_flags(vue_container_registry_explorer: { enabled: false, thing: group })
end
it 'has the correct response schema' do
......
......@@ -3,7 +3,7 @@
require 'spec_helper'
describe Projects::Registry::RepositoriesController do
let(:user) { create(:user) }
let(:user) { create(:user) }
let(:project) { create(:project, :private) }
before do
......@@ -88,7 +88,7 @@ describe Projects::Registry::RepositoriesController do
context 'with :vue_container_registry_explorer feature flag disabled' 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,
tags: %w[rc1 latest])
end
......
......@@ -19,7 +19,7 @@ describe 'Container Registry', :js do
describe 'Registry explorer is off' do
before do
stub_feature_flags(vue_container_registry_explorer: false)
stub_feature_flags(vue_container_registry_explorer: { enabled: false, thing: project.group })
end
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