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
3d230454
Commit
3d230454
authored
Apr 05, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename user cohorts -> cohorts
parent
06a2baa3
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
7 deletions
+16
-7
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+1
-1
app/controllers/admin/cohorts_controller.rb
app/controllers/admin/cohorts_controller.rb
+9
-0
app/services/cohorts_service.rb
app/services/cohorts_service.rb
+1
-1
app/views/admin/cohorts/_cohorts_table.html.haml
app/views/admin/cohorts/_cohorts_table.html.haml
+0
-0
app/views/admin/cohorts/_usage_ping.html.haml
app/views/admin/cohorts/_usage_ping.html.haml
+0
-0
app/views/admin/cohorts/index.html.haml
app/views/admin/cohorts/index.html.haml
+0
-0
app/views/admin/dashboard/_head.html.haml
app/views/admin/dashboard/_head.html.haml
+3
-3
config/routes/admin.rb
config/routes/admin.rb
+1
-1
spec/services/cohorts_service_spec.rb
spec/services/cohorts_service_spec.rb
+1
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
3d230454
...
...
@@ -363,7 +363,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
new
Admin
();
switch
(
path
[
1
])
{
case
'
application_settings
'
:
case
'
user_
cohorts
'
:
case
'
cohorts
'
:
new
gl
.
ApplicationSettings
();
break
;
case
'
groups
'
:
...
...
app/controllers/admin/
user_
cohorts_controller.rb
→
app/controllers/admin/cohorts_controller.rb
View file @
3d230454
class
Admin::
User
CohortsController
<
Admin
::
ApplicationController
class
Admin::CohortsController
<
Admin
::
ApplicationController
def
index
if
ApplicationSetting
.
current
.
usage_ping_enabled
@cohorts
=
Rails
.
cache
.
fetch
(
'
user_
cohorts'
,
expires_in:
1
.
day
)
do
User
CohortsService
.
new
.
execute
@cohorts
=
Rails
.
cache
.
fetch
(
'cohorts'
,
expires_in:
1
.
day
)
do
CohortsService
.
new
.
execute
end
end
end
...
...
app/services/
user_
cohorts_service.rb
→
app/services/cohorts_service.rb
View file @
3d230454
class
User
CohortsService
class
CohortsService
MONTHS_INCLUDED
=
12
# Get a hash that looks like:
...
...
app/views/admin/
user_
cohorts/_cohorts_table.html.haml
→
app/views/admin/cohorts/_cohorts_table.html.haml
View file @
3d230454
File moved
app/views/admin/
user_
cohorts/_usage_ping.html.haml
→
app/views/admin/cohorts/_usage_ping.html.haml
View file @
3d230454
File moved
app/views/admin/
user_
cohorts/index.html.haml
→
app/views/admin/cohorts/index.html.haml
View file @
3d230454
File moved
app/views/admin/dashboard/_head.html.haml
View file @
3d230454
...
...
@@ -27,7 +27,7 @@
=
link_to
admin_runners_path
,
title:
'Runners'
do
%span
Runners
=
nav_link
path:
'
user_
cohorts#index'
do
=
link_to
admin_
user_cohorts_path
,
title:
'User c
ohorts'
do
=
nav_link
path:
'cohorts#index'
do
=
link_to
admin_
cohorts_path
,
title:
'C
ohorts'
do
%span
User c
ohorts
C
ohorts
config/routes/admin.rb
View file @
3d230454
...
...
@@ -133,7 +133,7 @@ namespace :admin do
end
end
resources
:
user_
cohorts
,
only: :index
resources
:cohorts
,
only: :index
resources
:builds
,
only: :index
do
collection
do
...
...
spec/services/
user_
cohorts_service_spec.rb
→
spec/services/cohorts_service_spec.rb
View file @
3d230454
require
'spec_helper'
describe
User
CohortsService
do
describe
CohortsService
do
describe
'#execute'
do
def
month_start
(
months_ago
)
months_ago
.
months
.
ago
.
beginning_of_month
.
to_date
...
...
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