Commit eda8c53a authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'ac-usage-quotas-global-features' into 'master'

Show Usage Quotas regardless of namespace subscription

Closes #12142

See merge request gitlab-org/gitlab-ee!14135
parents 39d845ec 11637592
...@@ -13,7 +13,7 @@ class Groups::UsageQuotasController < Groups::ApplicationController ...@@ -13,7 +13,7 @@ class Groups::UsageQuotasController < Groups::ApplicationController
private private
def verify_usage_quotas_enabled! def verify_usage_quotas_enabled!
render_404 unless @group.feature_available?(:usage_quotas) render_404 unless License.feature_available?(:usage_quotas)
render_404 if @group.has_parent? render_404 if @group.has_parent?
end end
end end
...@@ -189,6 +189,7 @@ class License < ApplicationRecord ...@@ -189,6 +189,7 @@ class License < ApplicationRecord
object_storage object_storage
repository_size_limit repository_size_limit
custom_project_templates custom_project_templates
usage_quotas
].freeze ].freeze
validate :valid_license validate :valid_license
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
%span %span
Audit Events Audit Events
- if @group.feature_available?(:usage_quotas) - if License.feature_available?(:usage_quotas)
= nav_link(path: 'usage_quota#index') do = nav_link(path: 'usage_quota#index') do
= link_to group_usage_quotas_path(@group), title: s_('UsageQuota|Usage Quotas') do = link_to group_usage_quotas_path(@group), title: s_('UsageQuota|Usage Quotas') do
%span %span
......
---
title: Show Usage Quotas regardless of namespace subscription
merge_request: 14135
author:
type: fixed
...@@ -19,6 +19,20 @@ describe 'Groups > Usage Quotas' do ...@@ -19,6 +19,20 @@ describe 'Groups > Usage Quotas' do
end end
end end
context 'when checking namespace plan' do
before do
stub_application_setting_on_object(group, should_check_namespace_plan: true)
end
it 'is linked within the group settings dropdown' do
visit edit_group_path(group)
page.within('.nav-sidebar') do
expect(page).to have_link('Usage Quotas')
end
end
end
context 'when usage_quotas is not available' do context 'when usage_quotas is not available' do
before do before do
stub_licensed_features(usage_quotas: false) stub_licensed_features(usage_quotas: false)
......
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