Commit c3a98d8f authored by Elias Werberich's avatar Elias Werberich

Implementing 'Groups View' and 'TODOs View' as options for dashboard preferences.

Fixes #14585.
parent 5a460c37
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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.
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment