Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a6cb7267
Commit
a6cb7267
authored
Jun 13, 2019
by
Alessio Caiazza
Committed by
Mayra Cabrera
Jun 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix group usage quota menu item
This feature is not related to @group.feature_available?(:audit_events)
parent
83572549
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
29 deletions
+46
-29
ee/app/controllers/groups/usage_quotas_controller.rb
ee/app/controllers/groups/usage_quotas_controller.rb
+4
-3
ee/app/models/license.rb
ee/app/models/license.rb
+1
-0
ee/app/views/groups/ee/_settings_nav.html.haml
ee/app/views/groups/ee/_settings_nav.html.haml
+2
-1
ee/app/views/groups/usage_quotas/index.html.haml
ee/app/views/groups/usage_quotas/index.html.haml
+1
-1
ee/changelogs/unreleased/nolith-master-patch-30947.yml
ee/changelogs/unreleased/nolith-master-patch-30947.yml
+5
-0
ee/spec/features/groups/usage_quotas_spec.rb
ee/spec/features/groups/usage_quotas_spec.rb
+33
-21
locale/gitlab.pot
locale/gitlab.pot
+0
-3
No files found.
ee/app/controllers/groups/usage_quotas_controller.rb
View file @
a6cb7267
...
...
@@ -2,7 +2,7 @@
class
Groups::UsageQuotasController
<
Groups
::
ApplicationController
before_action
:authorize_admin_group!
before_action
:v
alidate_shared_runner_minutes_support
!
before_action
:v
erify_usage_quotas_enabled
!
layout
'group_settings'
...
...
@@ -12,7 +12,8 @@ class Groups::UsageQuotasController < Groups::ApplicationController
private
def
validate_shared_runner_minutes_support!
render_404
unless
@group
.
shared_runner_minutes_supported?
def
verify_usage_quotas_enabled!
render_404
unless
@group
.
feature_available?
(
:usage_quotas
)
render_404
if
@group
.
has_parent?
end
end
ee/app/models/license.rb
View file @
a6cb7267
...
...
@@ -34,6 +34,7 @@ class License < ApplicationRecord
repository_mirrors
repository_size_limit
scoped_issue_board
usage_quotas
visual_review_app
]
.
freeze
...
...
ee/app/views/groups/ee/_settings_nav.html.haml
View file @
a6cb7267
...
...
@@ -22,10 +22,11 @@
%span
Audit Events
-
if
@group
.
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
=
s_
(
'UsageQuota|Usage
q
uotas'
)
=
s_
(
'UsageQuota|Usage
Q
uotas'
)
-
if
Gitlab
::
CurrentSettings
.
should_check_namespace_plan?
=
nav_link
(
path:
'billings#index'
)
do
...
...
ee/app/views/groups/usage_quotas/index.html.haml
View file @
a6cb7267
-
page_title
s_
(
"UsageQuota|Usage"
)
%h3
.page-title
=
s_
(
'UsageQuota|Usage
q
uotas'
)
=
s_
(
'UsageQuota|Usage
Q
uotas'
)
.row
.col-sm-6
...
...
ee/changelogs/unreleased/nolith-master-patch-30947.yml
0 → 100644
View file @
a6cb7267
---
title
:
Fix 'Group > Usage Quota' menu item
merge_request
:
14043
author
:
type
:
fixed
ee/spec/features/groups/usage_quotas_spec.rb
View file @
a6cb7267
...
...
@@ -10,17 +10,41 @@ describe 'Groups > Usage Quotas' do
sign_in
(
user
)
end
context
'with no quota'
do
let
(
:group
)
{
create
(
:group
,
:with_build_minutes
)
}
it
'is not linked within the group settings dropdown'
do
visit
group_path
(
group
)
shared_examples
'linked in group settings dropdown'
do
it
'is linked within the group settings dropdown'
do
visit
edit_group_path
(
group
)
page
.
within
(
'.nav-sidebar'
)
do
expect
(
page
).
not_to
have_selector
(
:link_or_button
,
'Pipeline Quota
'
)
expect
(
page
).
to
have_link
(
'Usage Quotas
'
)
end
end
context
'when usage_quotas is not available'
do
before
do
stub_licensed_features
(
usage_quotas:
false
)
end
it
'is not linked within the group settings dropdown'
do
visit
edit_group_path
(
group
)
page
.
within
(
'.nav-sidebar'
)
do
expect
(
page
).
not_to
have_link
(
'Usage Quotas'
)
end
end
it
'renders a 404'
do
visit_pipeline_quota_page
expect
(
page
).
to
have_http_status
(
:not_found
)
end
end
end
context
'with no quota'
do
let
(
:group
)
{
create
(
:group
,
:with_build_minutes
)
}
include_examples
'linked in group settings dropdown'
it
'shows correct group quota info'
do
visit_pipeline_quota_page
...
...
@@ -35,11 +59,7 @@ describe 'Groups > Usage Quotas' do
let
(
:group
)
{
create
(
:group
,
:with_not_used_build_minutes_limit
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
group
,
shared_runners_enabled:
false
)
}
it
'is linked within the group settings dropdown'
do
visit
edit_group_path
(
group
)
expect
(
page
).
to
have_link
(
'Usage Quotas'
)
end
include_examples
'linked in group settings dropdown'
it
'shows correct group quota info'
do
visit_pipeline_quota_page
...
...
@@ -58,11 +78,7 @@ describe 'Groups > Usage Quotas' do
context
'minutes under quota'
do
let
(
:group
)
{
create
(
:group
,
:with_not_used_build_minutes_limit
)
}
it
'is linked within the group settings tab'
do
visit
edit_group_path
(
group
)
expect
(
page
).
to
have_link
(
'Usage Quotas'
)
end
include_examples
'linked in group settings dropdown'
it
'shows correct group quota info'
do
visit_pipeline_quota_page
...
...
@@ -79,11 +95,7 @@ describe 'Groups > Usage Quotas' do
let
(
:group
)
{
create
(
:group
,
:with_used_build_minutes_limit
)
}
let!
(
:other_project
)
{
create
(
:project
,
namespace:
group
,
shared_runners_enabled:
false
)
}
it
'is linked within the group settings tab'
do
visit
edit_group_path
(
group
)
expect
(
page
).
to
have_link
(
'Usage Quotas'
)
end
include_examples
'linked in group settings dropdown'
it
'shows correct group quota and projects info'
do
visit_pipeline_quota_page
...
...
locale/gitlab.pot
View file @
a6cb7267
...
...
@@ -14460,9 +14460,6 @@ 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 ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment