summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG2
-rw-r--r--app/controllers/root_controller.rb4
-rw-r--r--app/helpers/preferences_helper.rb4
-rw-r--r--app/models/user.rb2
-rw-r--r--spec/controllers/root_controller_spec.rb22
-rw-r--r--spec/helpers/preferences_helper_spec.rb4
6 files changed, 35 insertions, 3 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 5d9f4961ef5..a283d267c2e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -4,6 +4,8 @@ v 8.7.0 (unreleased)
- Preserve time notes/comments have been updated at when moving issue
- Make HTTP(s) label consistent on clone bar (Stan Hu)
- Fix avatar stretching by providing a cropping feature
+ - Implement 'Groups View' as an option for dashboard preferences !3379 (Elias W.)
+ - Implement 'TODOs View' as an option for dashboard preferences !3379 (Elias W.)
v 8.6.2 (unreleased)
- Comments on confidential issues don't show up in activity feed to non-members
diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb
index ad04c646e1b..627be74a38f 100644
--- a/app/controllers/root_controller.rb
+++ b/app/controllers/root_controller.rb
@@ -26,6 +26,10 @@ class RootController < Dashboard::ProjectsController
redirect_to activity_dashboard_path
when 'starred_project_activity'
redirect_to activity_dashboard_path(filter: 'starred')
+ when 'groups'
+ redirect_to dashboard_groups_path
+ when 'todos'
+ redirect_to dashboard_todos_path
else
return
end
diff --git a/app/helpers/preferences_helper.rb b/app/helpers/preferences_helper.rb
index c73cb3028ee..c3832cf5d65 100644
--- a/app/helpers/preferences_helper.rb
+++ b/app/helpers/preferences_helper.rb
@@ -12,7 +12,9 @@ module PreferencesHelper
projects: 'Your Projects (default)',
stars: 'Starred Projects',
project_activity: "Your Projects' Activity",
- starred_project_activity: "Starred Projects' Activity"
+ starred_project_activity: "Starred Projects' Activity",
+ groups: "Your Groups",
+ todos: "Your Todos"
}.with_indifferent_access.freeze
# Returns an Array usable by a select field for more user-friendly option text
diff --git a/app/models/user.rb b/app/models/user.rb
index 9c315cfe966..128ddc2a694 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -184,7 +184,7 @@ class User < ActiveRecord::Base
# User's Dashboard preference
# Note: When adding an option, it MUST go on the end of the array.
- enum dashboard: [:projects, :stars, :project_activity, :starred_project_activity]
+ enum dashboard: [:projects, :stars, :project_activity, :starred_project_activity, :groups, :todos]
# User's Project preference
# Note: When adding an option, it MUST go on the end of the array.
diff --git a/spec/controllers/root_controller_spec.rb b/spec/controllers/root_controller_spec.rb
index 5a104ae7c99..b14d275f7fa 100644
--- a/spec/controllers/root_controller_spec.rb
+++ b/spec/controllers/root_controller_spec.rb
@@ -43,6 +43,28 @@ describe RootController do
end
end
+ context 'who has customized their dashboard setting for groups' do
+ before do
+ user.update_attribute(:dashboard, 'groups')
+ end
+
+ it 'redirects to their group list' do
+ get :index
+ expect(response).to redirect_to dashboard_groups_path
+ end
+ end
+
+ context 'who has customized their dashboard setting for todos' do
+ before do
+ user.update_attribute(:dashboard, 'todos')
+ end
+
+ it 'redirects to their todo list' do
+ get :index
+ expect(response).to redirect_to dashboard_todos_path
+ end
+ end
+
context 'who uses the default dashboard setting' do
it 'renders the default dashboard' do
get :index
diff --git a/spec/helpers/preferences_helper_spec.rb b/spec/helpers/preferences_helper_spec.rb
index e5df59c4fba..2f9291afc3f 100644
--- a/spec/helpers/preferences_helper_spec.rb
+++ b/spec/helpers/preferences_helper_spec.rb
@@ -19,7 +19,9 @@ describe PreferencesHelper do
['Your Projects (default)', 'projects'],
['Starred Projects', 'stars'],
["Your Projects' Activity", 'project_activity'],
- ["Starred Projects' Activity", 'starred_project_activity']
+ ["Starred Projects' Activity", 'starred_project_activity'],
+ ["Your Groups", 'groups'],
+ ["Your Todos", 'todos']
]
end
end