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
6217bd23
Commit
6217bd23
authored
Jun 29, 2017
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return 404 when Contribution Analytics feature is not available
See gitlab-ee#2579
parent
f363f16e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
0 deletions
+32
-0
app/controllers/ee/groups/application_controller.rb
app/controllers/ee/groups/application_controller.rb
+18
-0
app/controllers/groups/analytics_controller.rb
app/controllers/groups/analytics_controller.rb
+1
-0
app/controllers/groups/application_controller.rb
app/controllers/groups/application_controller.rb
+1
-0
changelogs/unreleased-ee/tc-namespace-license-checks--contribution-analytics.yml
...e/tc-namespace-license-checks--contribution-analytics.yml
+4
-0
spec/controllers/groups/analytics_controller_spec.rb
spec/controllers/groups/analytics_controller_spec.rb
+8
-0
No files found.
app/controllers/ee/groups/application_controller.rb
0 → 100644
View file @
6217bd23
module
EE
module
Groups
module
ApplicationController
def
check_group_feature_available!
(
feature
)
render_404
unless
group
.
feature_available?
(
feature
)
end
def
method_missing
(
method_sym
,
*
arguments
,
&
block
)
case
method_sym
.
to_s
when
/\Acheck_group_(.*)_available!\z/
check_group_feature_available!
(
$1
.
to_sym
)
else
super
end
end
end
end
end
app/controllers/groups/analytics_controller.rb
View file @
6217bd23
class
Groups::AnalyticsController
<
Groups
::
ApplicationController
before_action
:group
before_action
:check_group_contribution_analytics_available!
layout
'group'
...
...
app/controllers/groups/application_controller.rb
View file @
6217bd23
class
Groups::ApplicationController
<
ApplicationController
include
RoutableActions
prepend
EE
::
Groups
::
ApplicationController
layout
'group'
...
...
changelogs/unreleased-ee/tc-namespace-license-checks--contribution-analytics.yml
0 → 100644
View file @
6217bd23
---
title
:
Add namespace license checks for Contribution Analytics
merge_request
:
2302
author
:
spec/controllers/groups/analytics_controller_spec.rb
View file @
6217bd23
...
...
@@ -39,6 +39,14 @@ describe Groups::AnalyticsController do
create_push_event
(
user3
,
project
)
end
it
'returns 404 when feature is not available'
do
stub_licensed_features
(
contribution_analytics:
false
)
get
:show
,
group_id:
group
.
path
expect
(
response
).
to
have_http_status
(
404
)
end
it
'sets instance variables properly'
do
get
:show
,
group_id:
group
.
path
...
...
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