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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
c3a98d8f
Commit
c3a98d8f
authored
Mar 24, 2016
by
Elias Werberich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementing 'Groups View' and 'TODOs View' as options for dashboard preferences.
Fixes #14585.
parent
5a460c37
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
3 deletions
+35
-3
CHANGELOG
CHANGELOG
+2
-0
app/controllers/root_controller.rb
app/controllers/root_controller.rb
+4
-0
app/helpers/preferences_helper.rb
app/helpers/preferences_helper.rb
+3
-1
app/models/user.rb
app/models/user.rb
+1
-1
spec/controllers/root_controller_spec.rb
spec/controllers/root_controller_spec.rb
+22
-0
spec/helpers/preferences_helper_spec.rb
spec/helpers/preferences_helper_spec.rb
+3
-1
No files found.
CHANGELOG
View file @
c3a98d8f
...
...
@@ -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
...
...
app/controllers/root_controller.rb
View file @
c3a98d8f
...
...
@@ -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
...
...
app/helpers/preferences_helper.rb
View file @
c3a98d8f
...
...
@@ -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
...
...
app/models/user.rb
View file @
c3a98d8f
...
...
@@ -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.
...
...
spec/controllers/root_controller_spec.rb
View file @
c3a98d8f
...
...
@@ -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
...
...
spec/helpers/preferences_helper_spec.rb
View file @
c3a98d8f
...
...
@@ -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
...
...
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