Commit 11637592 authored by Alessio Caiazza's avatar Alessio Caiazza Committed by Mayra Cabrera

Promote usage_quotas to a global feature

That page allow to sell additional CI minutes and should available
regardless of the namespace subscription.
parent 39d845ec
......@@ -13,7 +13,7 @@ class Groups::UsageQuotasController < Groups::ApplicationController
private
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?
end
end
......@@ -189,6 +189,7 @@ class License < ApplicationRecord
object_storage
repository_size_limit
custom_project_templates
usage_quotas
].freeze
validate :valid_license
......
......@@ -22,7 +22,7 @@
%span
Audit Events
- if @group.feature_available?(:usage_quotas)
- if License.feature_available?(:usage_quotas)
= nav_link(path: 'usage_quota#index') do
= link_to group_usage_quotas_path(@group), title: s_('UsageQuota|Usage Quotas') do
%span
......
---
title: Show Usage Quotas regardless of namespace subscription
merge_request: 14135
author:
type: fixed
......@@ -19,6 +19,20 @@ describe 'Groups > Usage Quotas' do
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
before do
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