Skip to content
Snippets Groups Projects
Commit 2308ab7a authored by Elias Werberich's avatar Elias Werberich Committed by Douwe Maan
Browse files

'Assigned Issues' and 'Assigned Merge Requests' as dashboard user choices

parent 463fe406
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -42,6 +42,10 @@ class RootController < Dashboard::ProjectsController
redirect_to(dashboard_groups_path)
when 'todos'
redirect_to(dashboard_todos_path)
when 'issues'
redirect_to(issues_dashboard_path(assignee_id: current_user.id))
when 'merge_requests'
redirect_to(merge_requests_dashboard_path(assignee_id: current_user.id))
end
end
 
Loading
Loading
Loading
Loading
@@ -9,12 +9,14 @@ module PreferencesHelper
 
# Maps `dashboard` values to more user-friendly option text
DASHBOARD_CHOICES = {
projects: 'Your Projects (default)',
stars: 'Starred Projects',
project_activity: "Your Projects' Activity",
starred_project_activity: "Starred Projects' Activity",
groups: "Your Groups",
todos: "Your Todos"
projects: _("Your Projects (default)"),
stars: _("Starred Projects"),
project_activity: _("Your Projects' Activity"),
starred_project_activity: _("Starred Projects' Activity"),
groups: _("Your Groups"),
todos: _("Your Todos"),
issues: _("Assigned Issues"),
merge_requests: _("Assigned Merge Requests")
}.with_indifferent_access.freeze
 
# Returns an Array usable by a select field for more user-friendly option text
Loading
Loading
Loading
Loading
@@ -187,7 +187,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, :groups, :todos]
enum dashboard: [:projects, :stars, :project_activity, :starred_project_activity, :groups, :todos, :issues, :merge_requests]
 
# User's Project preference
# Note: When adding an option, it MUST go on the end of the array.
Loading
Loading
---
title: Add 'Assigned Issues' and 'Assigned Merge Requests' as dashboard view choices for users
merge_request: 17860
author: Elias Werberich
type: added
Loading
Loading
@@ -41,7 +41,7 @@ select few, the amount of activity on the default Dashboard page can be
overwhelming. Changing this setting allows you to redefine what your default
dashboard will be.
 
You have 6 options here that you can use for your default dashboard view:
You have 8 options here that you can use for your default dashboard view:
 
- Your projects (default)
- Starred projects
Loading
Loading
@@ -49,6 +49,8 @@ You have 6 options here that you can use for your default dashboard view:
- Starred projects' activity
- Your groups
- Your [Todos]
- Assigned Issues
- Assigned Merge Requests
 
### Project home page content
 
Loading
Loading
Loading
Loading
@@ -90,6 +90,30 @@ describe RootController do
end
end
 
context 'who has customized their dashboard setting for assigned issues' do
before do
user.dashboard = 'issues'
end
it 'redirects to their assigned issues' do
get :index
expect(response).to redirect_to issues_dashboard_path(assignee_id: user.id)
end
end
context 'who has customized their dashboard setting for assigned merge requests' do
before do
user.dashboard = 'merge_requests'
end
it 'redirects to their assigned merge requests' do
get :index
expect(response).to redirect_to merge_requests_dashboard_path(assignee_id: user.id)
end
end
context 'who uses the default dashboard setting' do
it 'renders the default dashboard' do
get :index
Loading
Loading
Loading
Loading
@@ -21,7 +21,9 @@ describe PreferencesHelper do
["Your Projects' Activity", 'project_activity'],
["Starred Projects' Activity", 'starred_project_activity'],
["Your Groups", 'groups'],
["Your Todos", 'todos']
["Your Todos", 'todos'],
["Assigned Issues", 'issues'],
["Assigned Merge Requests", 'merge_requests']
]
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment