Commit 5f75472e authored by Filipa Lacerda's avatar Filipa Lacerda Committed by Mayra Cabrera

Updates Pipeline quota for Storage Quotas

Updates texts to accomodate for storage quotas
Creates a tab for pipeline quotas
Adds i18n
parent 7d9efc16
# frozen_string_literal: true
class Groups::PipelineQuotaController < Groups::ApplicationController
class Groups::UsageQuotasController < Groups::ApplicationController
before_action :authorize_admin_group!
before_action :validate_shared_runner_minutes_support!
......
......@@ -23,10 +23,10 @@
Audit Events
- if @group.shared_runners_enabled? && @group.shared_runners_minutes_limit_enabled?
= nav_link(path: 'pipeline_quota#index') do
= link_to group_pipeline_quota_path(@group), title: 'Pipelines quota' do
= nav_link(path: 'usage_quota#index') do
= link_to group_usage_quotas_path(@group), title: s_('UsageQuota|Usage Quotas') do
%span
Pipelines quota
= s_('UsageQuota|Usage quotas')
- if Gitlab::CurrentSettings.should_check_namespace_plan?
= nav_link(path: 'billings#index') do
......
- page_title "Pipelines quota"
%h3.page-title
Group pipelines quota
= link_to icon('question-circle'), help_page_path("user/admin_area/settings/continuous_integration", anchor: "shared-runners-build-minutes-quota"), target: '_blank'
.row
.col-sm-6
Monthly pipeline minutes usage across shared Runners for the
%strong= @group.name
group
.col-sm-6
%p.text-right
= link_to 'Buy additional minutes', EE::SUBSCRIPTIONS_PLANS_URL, target: '_blank', class: 'btn btn-inverted btn-success right text-right'
= render "namespaces/pipelines_quota/list",
locals: { namespace: @group, projects: @projects }
- page_title s_("UsageQuota|Usage")
%h3.page-title
= s_('UsageQuota|Usage quotas')
.row
.col-sm-6
= s_('UsageQuota|Usage of group resources across the projects in the %{strong_start}%{group_name}%{strong_end} group').html_safe % { strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe, group_name: @group.name }
.top-area.scrolling-tabs-container.inner-page-scroll-tabs
%ul.nav-links.scrolling-tabs.separator{ role: 'tablist' }
%li.nav-item
%a.nav-link.active#pipelines-quota{ href: 'pipelines-quota-tab', data: { toggle: 'tab' }, 'aria-controls': 'pipelines-quota-tab', 'aria-selected': true }
= s_('UsageQuota|Pipelines')
.nav-controls
= link_to s_('UsageQuota|Buy additional minutes'), EE::SUBSCRIPTIONS_PLANS_URL, target: '_blank', class: 'btn btn-inverted btn-success float-right'
.tab-content
.tab-pane.show.active#pipelines-quota-tab{ role: 'tabpanel' }
= render "namespaces/pipelines_quota/list",
locals: { namespace: @group, projects: @projects }
......@@ -7,18 +7,21 @@
%strong
- last_reset = namespace.shared_runners_seconds_last_reset
- if last_reset
Usage since
= s_('UsageQuota|Usage since')
= last_reset.strftime('%b %d, %Y')
- else
Current period usage
= s_('UsageQuota|Current period usage')
%div
= namespace_shared_runner_limits_quota(namespace)
minutes
= link_to icon('question-circle'), help_page_path('user/admin_area/settings/continuous_integration', anchor: 'shared-runners-build-minutes-quota'), target: '_blank', 'aria-label': _('Shared runners help link')
.col-sm-6.right
- if namespace.shared_runners_minutes_limit_enabled?
#{namespace_shared_runner_limits_percent_used(namespace)}% used
- else
Unlimited
= s_('UsageQuota|Unlimited')
= namespace_shared_runner_limits_progress_bar(namespace)
= render 'namespaces/pipelines_quota/extra_shared_runners_minutes_quota', namespace: namespace
......@@ -26,8 +29,10 @@
%table.table.pipeline-project-metrics
%thead
%tr
%th Project
%th Minutes
%th
= _('Project')
%th
= _('Minutes')
%tbody
- projects.each do |project|
......@@ -41,6 +46,7 @@
- if projects.blank?
%tr
%td{ colspan: 2 }
.nothing-here-block This group has no projects which use shared runners
.nothing-here-block
= s_('UsageQuota|This group has no projects which use shared runners')
= paginate projects, theme: "gitlab"
---
title: Updates Pipeline Quota page to accomodate for Storage Quotas
merge_request: 13139
author:
type: changed
......@@ -36,7 +36,7 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
resources :ldap_group_links, only: [:index, :create, :destroy]
resources :audit_events, only: [:index]
resources :pipeline_quota, only: [:index]
resources :usage_quotas, only: [:index]
resources :hooks, only: [:index, :create, :destroy], constraints: { id: /\d+/ } do
member do
......
require 'spec_helper'
describe 'Groups > Pipeline Quota' do
describe 'Groups > Usage Quotas' do
let(:user) { create(:user) }
let(:group) { create(:group) }
let!(:project) { create(:project, namespace: group, shared_runners_enabled: true) }
......@@ -38,7 +38,7 @@ describe 'Groups > Pipeline Quota' do
it 'is not linked within the group settings dropdown' do
visit edit_group_path(group)
expect(page).not_to have_link('Pipelines quota')
expect(page).not_to have_link('Usage Quotas')
end
it 'shows correct group quota info' do
......@@ -61,7 +61,7 @@ describe 'Groups > Pipeline Quota' do
it 'is linked within the group settings tab' do
visit edit_group_path(group)
expect(page).to have_link('Pipelines quota')
expect(page).to have_link('Usage Quotas')
end
it 'shows correct group quota info' do
......@@ -82,7 +82,7 @@ describe 'Groups > Pipeline Quota' do
it 'is linked within the group settings tab' do
visit edit_group_path(group)
expect(page).to have_link('Pipelines quota')
expect(page).to have_link('Usage Quotas')
end
it 'shows correct group quota and projects info' do
......@@ -125,6 +125,6 @@ describe 'Groups > Pipeline Quota' do
end
def visit_pipeline_quota_page
visit group_pipeline_quota_path(group)
visit group_usage_quotas_path(group)
end
end
......@@ -8066,6 +8066,9 @@ msgstr ""
msgid "Minimum capacity to be available before we schedule more mirrors preemptively."
msgstr ""
msgid "Minutes"
msgstr ""
msgid "Mirror a repository"
msgstr ""
......@@ -11423,6 +11426,9 @@ msgstr ""
msgid "Shared projects"
msgstr ""
msgid "Shared runners help link"
msgstr ""
msgid "SharedRunnersMinutesSettings|By resetting the pipeline minutes for this namespace, the currently used minutes will be set to zero."
msgstr ""
......@@ -13681,6 +13687,36 @@ msgstr ""
msgid "Usage statistics"
msgstr ""
msgid "UsageQuota|Buy additional minutes"
msgstr ""
msgid "UsageQuota|Current period usage"
msgstr ""
msgid "UsageQuota|Pipelines"
msgstr ""
msgid "UsageQuota|This group has no projects which use shared runners"
msgstr ""
msgid "UsageQuota|Unlimited"
msgstr ""
msgid "UsageQuota|Usage"
msgstr ""
msgid "UsageQuota|Usage Quotas"
msgstr ""
msgid "UsageQuota|Usage of group resources across the projects in the %{strong_start}%{group_name}%{strong_end} group"
msgstr ""
msgid "UsageQuota|Usage quotas"
msgstr ""
msgid "UsageQuota|Usage since"
msgstr ""
msgid "Use %{code_start}::%{code_end} to create a %{link_start}scoped label set%{link_end} (eg. %{code_start}priority::1%{code_end})"
msgstr ""
......
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