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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
2308ab7a
Commit
2308ab7a
authored
Mar 27, 2018
by
Elias Werberich
Committed by
Douwe Maan
Mar 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'Assigned Issues' and 'Assigned Merge Requests' as dashboard user choices
parent
463fe406
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
9 deletions
+48
-9
app/controllers/root_controller.rb
app/controllers/root_controller.rb
+4
-0
app/helpers/preferences_helper.rb
app/helpers/preferences_helper.rb
+8
-6
app/models/user.rb
app/models/user.rb
+1
-1
changelogs/unreleased/dashboard-view-user-choices-issues-merge-requests.yml
...sed/dashboard-view-user-choices-issues-merge-requests.yml
+5
-0
doc/user/profile/preferences.md
doc/user/profile/preferences.md
+3
-1
spec/controllers/root_controller_spec.rb
spec/controllers/root_controller_spec.rb
+24
-0
spec/helpers/preferences_helper_spec.rb
spec/helpers/preferences_helper_spec.rb
+3
-1
No files found.
app/controllers/root_controller.rb
View file @
2308ab7a
...
...
@@ -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
...
...
app/helpers/preferences_helper.rb
View file @
2308ab7a
...
...
@@ -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
...
...
app/models/user.rb
View file @
2308ab7a
...
...
@@ -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.
...
...
changelogs/unreleased/dashboard-view-user-choices-issues-merge-requests.yml
0 → 100644
View file @
2308ab7a
---
title
:
Add 'Assigned Issues' and 'Assigned Merge Requests' as dashboard view choices for users
merge_request
:
17860
author
:
Elias Werberich
type
:
added
doc/user/profile/preferences.md
View file @
2308ab7a
...
...
@@ -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
...
...
@@ -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
...
...
spec/controllers/root_controller_spec.rb
View file @
2308ab7a
...
...
@@ -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
...
...
spec/helpers/preferences_helper_spec.rb
View file @
2308ab7a
...
...
@@ -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
...
...
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