Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
e097812f
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,发现更多精彩内容 >>
提交
e097812f
编写于
5月 03, 2015
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9234 from dsander/group-milestones-by-title
Group milestones by title in the dashboard and all other issue views
上级
644b4c97
e6ee8d0e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
33 deletion
+11
-33
CHANGELOG
CHANGELOG
+1
-0
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+0
-25
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+3
-2
app/helpers/milestones_helper.rb
app/helpers/milestones_helper.rb
+2
-1
app/views/shared/_issuable_filter.html.haml
app/views/shared/_issuable_filter.html.haml
+2
-2
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+2
-2
spec/finders/issues_finder_spec.rb
spec/finders/issues_finder_spec.rb
+1
-1
未找到文件。
CHANGELOG
浏览文件 @
e097812f
...
...
@@ -25,6 +25,7 @@ v 7.11.0 (unreleased)
- Don't crash when an MR from a fork has a cross-reference comment from the target project on of its commits.
- Include commit comments in MR from a forked project.
- Fix adding new group members from admin area
- Group milestones by title in the dashboard and all other issue views.
- Add default project and snippet visibility settings to the admin web UI.
- Show incompatible projects in Google Code import status (Stan Hu)
- Fix bug where commit data would not appear in some subdirectories (Stan Hu)
...
...
app/controllers/application_controller.rb
浏览文件 @
e097812f
...
...
@@ -287,40 +287,15 @@ class ApplicationController < ActionController::Base
@filter_params
end
def
set_filter_values
(
collection
)
assignee_id
=
@filter_params
[
:assignee_id
]
author_id
=
@filter_params
[
:author_id
]
milestone_id
=
@filter_params
[
:milestone_id
]
@sort
=
@filter_params
[
:sort
]
@assignees
=
User
.
where
(
id:
collection
.
pluck
(
:assignee_id
))
@authors
=
User
.
where
(
id:
collection
.
pluck
(
:author_id
))
@milestones
=
Milestone
.
where
(
id:
collection
.
pluck
(
:milestone_id
))
if
assignee_id
.
present?
&&
!
assignee_id
.
to_i
.
zero?
@assignee
=
@assignees
.
find_by
(
id:
assignee_id
)
end
if
author_id
.
present?
&&
!
author_id
.
to_i
.
zero?
@author
=
@authors
.
find_by
(
id:
author_id
)
end
if
milestone_id
.
present?
&&
!
milestone_id
.
to_i
.
zero?
@milestone
=
@milestones
.
find_by
(
id:
milestone_id
)
end
end
def
get_issues_collection
set_filters_params
issues
=
IssuesFinder
.
new
.
execute
(
current_user
,
@filter_params
)
set_filter_values
(
issues
)
issues
end
def
get_merge_requests_collection
set_filters_params
merge_requests
=
MergeRequestsFinder
.
new
.
execute
(
current_user
,
@filter_params
)
set_filter_values
(
merge_requests
)
merge_requests
end
...
...
app/finders/issuable_finder.rb
浏览文件 @
e097812f
...
...
@@ -113,8 +113,9 @@ class IssuableFinder
end
def
by_milestone
(
items
)
if
params
[
:milestone_id
].
present?
items
=
items
.
where
(
milestone_id:
(
params
[
:milestone_id
]
==
NONE
?
nil
:
params
[
:milestone_id
]))
if
params
[
:milestone_title
].
present?
milestone_ids
=
(
params
[
:milestone_title
]
==
NONE
?
nil
:
Milestone
.
where
(
title:
params
[
:milestone_title
]).
pluck
(
:id
))
items
=
items
.
where
(
milestone_id:
milestone_ids
)
end
items
...
...
app/helpers/milestones_helper.rb
浏览文件 @
e097812f
...
...
@@ -28,6 +28,7 @@ module MilestonesHelper
Milestone
.
where
(
project_id:
@projects
)
end
.
active
options_from_collection_for_select
(
milestones
,
'id'
,
'title'
,
params
[
:milestone_id
])
grouped_milestones
=
Milestones
::
GroupService
.
new
(
milestones
).
execute
options_from_collection_for_select
(
grouped_milestones
,
'title'
,
'title'
,
params
[
:milestone_title
])
end
end
app/views/shared/_issuable_filter.html.haml
浏览文件 @
e097812f
...
...
@@ -15,7 +15,7 @@
#{
state_filters_text_for
(
:all
,
@project
)
}
.issues-details-filters
=
form_tag
page_filter_path
(
without:
[
:assignee_id
,
:author_id
,
:milestone_
id
,
:label_name
]),
method: :get
,
class:
'filter-form'
do
=
form_tag
page_filter_path
(
without:
[
:assignee_id
,
:author_id
,
:milestone_
title
,
:label_name
]),
method: :get
,
class:
'filter-form'
do
-
if
controller
.
controller_name
==
'issues'
.check-all-holder
=
check_box_tag
"check_all_issues"
,
nil
,
false
,
...
...
@@ -31,7 +31,7 @@
placeholder:
'Author'
,
class:
'trigger-submit'
,
any_user:
true
,
first_user:
true
)
.filter-item.inline.milestone-filter
=
select_tag
(
'milestone_
id
'
,
projects_milestones_options
,
class:
"select2 trigger-submit"
,
prompt:
'Milestone'
)
=
select_tag
(
'milestone_
title
'
,
projects_milestones_options
,
class:
"select2 trigger-submit"
,
prompt:
'Milestone'
)
-
if
@project
.filter-item.inline.labels-filter
...
...
spec/features/issues_spec.rb
浏览文件 @
e097812f
...
...
@@ -95,7 +95,7 @@ describe 'Issues', feature: true do
let
(
:issue
)
{
@issue
}
it
'should allow filtering by issues with no specified milestone'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
milestone_
id
:
IssuableFinder
::
NONE
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
milestone_
title
:
IssuableFinder
::
NONE
)
expect
(
page
).
not_to
have_content
'foobar'
expect
(
page
).
to
have_content
'barbaz'
...
...
@@ -103,7 +103,7 @@ describe 'Issues', feature: true do
end
it
'should allow filtering by a specified milestone'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
milestone_
id:
issue
.
milestone
.
id
)
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
milestone_
title:
issue
.
milestone
.
title
)
expect
(
page
).
to
have_content
'foobar'
expect
(
page
).
not_to
have_content
'barbaz'
...
...
spec/finders/issues_finder_spec.rb
浏览文件 @
e097812f
...
...
@@ -43,7 +43,7 @@ describe IssuesFinder do
end
it
'should filter by milestone id'
do
params
=
{
scope:
"all"
,
milestone_
id:
milestone
.
id
,
state:
'opened'
}
params
=
{
scope:
"all"
,
milestone_
title:
milestone
.
title
,
state:
'opened'
}
issues
=
IssuesFinder
.
new
.
execute
(
user
,
params
)
expect
(
issues
).
to
eq
([
issue1
])
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录