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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
5b698082
Commit
5b698082
authored
Apr 05, 2017
by
Sean McGivern
Committed by
Rémy Coutable
Apr 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename user cohorts -> cohorts
parent
0d7645e1
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 @
5b698082
...
@@ -366,7 +366,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
...
@@ -366,7 +366,7 @@ const ShortcutsBlob = require('./shortcuts_blob');
new
Admin
();
new
Admin
();
switch
(
path
[
1
])
{
switch
(
path
[
1
])
{
case
'
application_settings
'
:
case
'
application_settings
'
:
case
'
user_
cohorts
'
:
case
'
cohorts
'
:
new
gl
.
ApplicationSettings
();
new
gl
.
ApplicationSettings
();
break
;
break
;
case
'
groups
'
:
case
'
groups
'
:
...
...
app/controllers/admin/
user_
cohorts_controller.rb
→
app/controllers/admin/cohorts_controller.rb
View file @
5b698082
class
Admin::
User
CohortsController
<
Admin
::
ApplicationController
class
Admin::CohortsController
<
Admin
::
ApplicationController
def
index
def
index
if
ApplicationSetting
.
current
.
usage_ping_enabled
if
ApplicationSetting
.
current
.
usage_ping_enabled
@cohorts
=
Rails
.
cache
.
fetch
(
'
user_
cohorts'
,
expires_in:
1
.
day
)
do
@cohorts
=
Rails
.
cache
.
fetch
(
'cohorts'
,
expires_in:
1
.
day
)
do
User
CohortsService
.
new
.
execute
CohortsService
.
new
.
execute
end
end
end
end
end
end
...
...
app/services/
user_
cohorts_service.rb
→
app/services/cohorts_service.rb
View file @
5b698082
class
User
CohortsService
class
CohortsService
MONTHS_INCLUDED
=
12
MONTHS_INCLUDED
=
12
# Get a hash that looks like:
# 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 @
5b698082
File moved
app/views/admin/
user_
cohorts/_usage_ping.html.haml
→
app/views/admin/cohorts/_usage_ping.html.haml
View file @
5b698082
File moved
app/views/admin/
user_
cohorts/index.html.haml
→
app/views/admin/cohorts/index.html.haml
View file @
5b698082
File moved
app/views/admin/dashboard/_head.html.haml
View file @
5b698082
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
=
link_to
admin_runners_path
,
title:
'Runners'
do
=
link_to
admin_runners_path
,
title:
'Runners'
do
%span
%span
Runners
Runners
=
nav_link
path:
'
user_
cohorts#index'
do
=
nav_link
path:
'cohorts#index'
do
=
link_to
admin_
user_cohorts_path
,
title:
'User c
ohorts'
do
=
link_to
admin_
cohorts_path
,
title:
'C
ohorts'
do
%span
%span
User c
ohorts
C
ohorts
config/routes/admin.rb
View file @
5b698082
...
@@ -106,7 +106,7 @@ namespace :admin do
...
@@ -106,7 +106,7 @@ namespace :admin do
end
end
end
end
resources
:
user_
cohorts
,
only: :index
resources
:cohorts
,
only: :index
resources
:builds
,
only: :index
do
resources
:builds
,
only: :index
do
collection
do
collection
do
...
...
spec/services/
user_
cohorts_service_spec.rb
→
spec/services/cohorts_service_spec.rb
View file @
5b698082
require
'spec_helper'
require
'spec_helper'
describe
User
CohortsService
do
describe
CohortsService
do
describe
'#execute'
do
describe
'#execute'
do
def
month_start
(
months_ago
)
def
month_start
(
months_ago
)
months_ago
.
months
.
ago
.
beginning_of_month
.
to_date
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