diff options
author | Sean McGivern <sean@gitlab.com> | 2017-04-05 13:24:15 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-04-14 16:20:55 +0300 |
commit | 5b698082323e019e47b5c739cdec0300b521340b (patch) | |
tree | 49e53d856dc00849b9757993cd83128d0ec1e642 /app | |
parent | 0d7645e1b0312ea0a78401a835785422cc01660d (diff) |
Rename user cohorts -> cohorts
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/dispatcher.js | 2 | ||||
-rw-r--r-- | app/controllers/admin/cohorts_controller.rb | 9 | ||||
-rw-r--r-- | app/controllers/admin/user_cohorts_controller.rb | 9 | ||||
-rw-r--r-- | app/services/cohorts_service.rb (renamed from app/services/user_cohorts_service.rb) | 2 | ||||
-rw-r--r-- | app/views/admin/cohorts/_cohorts_table.html.haml (renamed from app/views/admin/user_cohorts/_cohorts_table.html.haml) | 0 | ||||
-rw-r--r-- | app/views/admin/cohorts/_usage_ping.html.haml (renamed from app/views/admin/user_cohorts/_usage_ping.html.haml) | 0 | ||||
-rw-r--r-- | app/views/admin/cohorts/index.html.haml (renamed from app/views/admin/user_cohorts/index.html.haml) | 0 | ||||
-rw-r--r-- | app/views/admin/dashboard/_head.html.haml | 6 |
8 files changed, 14 insertions, 14 deletions
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js index 6c94975d851..a0afffb6635 100644 --- a/app/assets/javascripts/dispatcher.js +++ b/app/assets/javascripts/dispatcher.js @@ -366,7 +366,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': diff --git a/app/controllers/admin/cohorts_controller.rb b/app/controllers/admin/cohorts_controller.rb new file mode 100644 index 00000000000..947afe3a028 --- /dev/null +++ b/app/controllers/admin/cohorts_controller.rb @@ -0,0 +1,9 @@ +class Admin::CohortsController < Admin::ApplicationController + def index + if ApplicationSetting.current.usage_ping_enabled + @cohorts = Rails.cache.fetch('cohorts', expires_in: 1.day) do + CohortsService.new.execute + end + end + end +end diff --git a/app/controllers/admin/user_cohorts_controller.rb b/app/controllers/admin/user_cohorts_controller.rb deleted file mode 100644 index 1d9e3547807..00000000000 --- a/app/controllers/admin/user_cohorts_controller.rb +++ /dev/null @@ -1,9 +0,0 @@ -class Admin::UserCohortsController < Admin::ApplicationController - def index - if ApplicationSetting.current.usage_ping_enabled - @cohorts = Rails.cache.fetch('user_cohorts', expires_in: 1.day) do - UserCohortsService.new.execute - end - end - end -end diff --git a/app/services/user_cohorts_service.rb b/app/services/cohorts_service.rb index c7909bb9e07..e7f8a50605f 100644 --- a/app/services/user_cohorts_service.rb +++ b/app/services/cohorts_service.rb @@ -1,4 +1,4 @@ -class UserCohortsService +class CohortsService MONTHS_INCLUDED = 12 # Get a hash that looks like: diff --git a/app/views/admin/user_cohorts/_cohorts_table.html.haml b/app/views/admin/cohorts/_cohorts_table.html.haml index a322ea9e5db..a322ea9e5db 100644 --- a/app/views/admin/user_cohorts/_cohorts_table.html.haml +++ b/app/views/admin/cohorts/_cohorts_table.html.haml diff --git a/app/views/admin/user_cohorts/_usage_ping.html.haml b/app/views/admin/cohorts/_usage_ping.html.haml index a95f81a7f49..a95f81a7f49 100644 --- a/app/views/admin/user_cohorts/_usage_ping.html.haml +++ b/app/views/admin/cohorts/_usage_ping.html.haml diff --git a/app/views/admin/user_cohorts/index.html.haml b/app/views/admin/cohorts/index.html.haml index dddcbd834f7..dddcbd834f7 100644 --- a/app/views/admin/user_cohorts/index.html.haml +++ b/app/views/admin/cohorts/index.html.haml diff --git a/app/views/admin/dashboard/_head.html.haml b/app/views/admin/dashboard/_head.html.haml index 0c2e5efc052..163bd5662b0 100644 --- a/app/views/admin/dashboard/_head.html.haml +++ b/app/views/admin/dashboard/_head.html.haml @@ -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 cohorts' do + = nav_link path: 'cohorts#index' do + = link_to admin_cohorts_path, title: 'Cohorts' do %span - User cohorts + Cohorts |