Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
ea8bd204
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ea8bd204
编写于
3月 26, 2016
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature--preferences-dashboard-groups' of
https://gitlab.com/eliasw/gitlab-ce
上级
c44de4f2
c3a98d8f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
35 addition
and
3 deletion
+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
未找到文件。
CHANGELOG
浏览文件 @
ea8bd204
...
@@ -5,6 +5,8 @@ v 8.7.0 (unreleased)
...
@@ -5,6 +5,8 @@ v 8.7.0 (unreleased)
- Make HTTP(s) label consistent on clone bar (Stan Hu)
- Make HTTP(s) label consistent on clone bar (Stan Hu)
- Fix avatar stretching by providing a cropping feature
- Fix avatar stretching by providing a cropping feature
- Add links to CI setup documentation from project settings and builds pages
- Add links to CI setup documentation from project settings and builds pages
- 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)
v 8.6.2 (unreleased)
- Comments on confidential issues don't show up in activity feed to non-members
- Comments on confidential issues don't show up in activity feed to non-members
...
...
app/controllers/root_controller.rb
浏览文件 @
ea8bd204
...
@@ -26,6 +26,10 @@ class RootController < Dashboard::ProjectsController
...
@@ -26,6 +26,10 @@ class RootController < Dashboard::ProjectsController
redirect_to
activity_dashboard_path
redirect_to
activity_dashboard_path
when
'starred_project_activity'
when
'starred_project_activity'
redirect_to
activity_dashboard_path
(
filter:
'starred'
)
redirect_to
activity_dashboard_path
(
filter:
'starred'
)
when
'groups'
redirect_to
dashboard_groups_path
when
'todos'
redirect_to
dashboard_todos_path
else
else
return
return
end
end
...
...
app/helpers/preferences_helper.rb
浏览文件 @
ea8bd204
...
@@ -12,7 +12,9 @@ module PreferencesHelper
...
@@ -12,7 +12,9 @@ module PreferencesHelper
projects:
'Your Projects (default)'
,
projects:
'Your Projects (default)'
,
stars:
'Starred Projects'
,
stars:
'Starred Projects'
,
project_activity:
"Your Projects' Activity"
,
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
}.
with_indifferent_access
.
freeze
# Returns an Array usable by a select field for more user-friendly option text
# Returns an Array usable by a select field for more user-friendly option text
...
...
app/models/user.rb
浏览文件 @
ea8bd204
...
@@ -184,7 +184,7 @@ class User < ActiveRecord::Base
...
@@ -184,7 +184,7 @@ class User < ActiveRecord::Base
# User's Dashboard preference
# User's Dashboard preference
# Note: When adding an option, it MUST go on the end of the array.
# 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
# User's Project preference
# Note: When adding an option, it MUST go on the end of the array.
# Note: When adding an option, it MUST go on the end of the array.
...
...
spec/controllers/root_controller_spec.rb
浏览文件 @
ea8bd204
...
@@ -43,6 +43,28 @@ describe RootController do
...
@@ -43,6 +43,28 @@ describe RootController do
end
end
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
context
'who uses the default dashboard setting'
do
it
'renders the default dashboard'
do
it
'renders the default dashboard'
do
get
:index
get
:index
...
...
spec/helpers/preferences_helper_spec.rb
浏览文件 @
ea8bd204
...
@@ -19,7 +19,9 @@ describe PreferencesHelper do
...
@@ -19,7 +19,9 @@ describe PreferencesHelper do
[
'Your Projects (default)'
,
'projects'
],
[
'Your Projects (default)'
,
'projects'
],
[
'Starred Projects'
,
'stars'
],
[
'Starred Projects'
,
'stars'
],
[
"Your Projects' Activity"
,
'project_activity'
],
[
"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
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录