Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
dac9b421
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,体验更适合开发者的 AI 搜索 >>
提交
dac9b421
编写于
5月 19, 2016
作者:
F
Felipe Artur
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix outer join when filtering milestones
上级
45e516b8
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
15 addition
and
10 deletion
+15
-10
CHANGELOG
CHANGELOG
+1
-0
app/finders/issuable_finder.rb
app/finders/issuable_finder.rb
+2
-2
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+2
-0
spec/features/issues/filter_by_milestone_spec.rb
spec/features/issues/filter_by_milestone_spec.rb
+4
-4
spec/features/issues_spec.rb
spec/features/issues_spec.rb
+2
-0
spec/features/merge_requests/filter_by_milestone_spec.rb
spec/features/merge_requests/filter_by_milestone_spec.rb
+4
-4
未找到文件。
CHANGELOG
浏览文件 @
dac9b421
...
...
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.9.0 (unreleased)
- Redesign navigation for project pages
- Use gitlab-shell v3.0.0
- Fix issues filter when ordering by milestone
v 8.8.2 (unreleased)
- Fix Error 500 when accessing application settings due to nil disabled OAuth sign-in sources
...
...
app/finders/issuable_finder.rb
浏览文件 @
dac9b421
...
...
@@ -250,12 +250,12 @@ class IssuableFinder
def
by_milestone
(
items
)
if
milestones?
if
filter_by_no_milestone?
items
=
items
.
where
(
milestone_id:
[
-
1
,
nil
])
items
=
items
.
left_joins_milestones
.
where
(
milestone_id:
[
-
1
,
nil
])
elsif
filter_by_upcoming_milestone?
upcoming_ids
=
Milestone
.
upcoming_ids_by_projects
(
projects
)
items
=
items
.
left_joins_milestones
.
where
(
milestone_id:
upcoming_ids
)
else
items
=
items
.
left_joins_milestones
.
where
(
milestones:
{
title:
params
[
:milestone_title
]
}
)
items
=
items
.
with_milestone
(
params
[
:milestone_title
]
)
if
projects
items
=
items
.
where
(
milestones:
{
project_id:
projects
})
...
...
app/models/concerns/issuable.rb
浏览文件 @
dac9b421
...
...
@@ -31,6 +31,7 @@ module Issuable
scope
:unassigned
,
->
{
where
(
"assignee_id IS NULL"
)
}
scope
:of_projects
,
->
(
ids
)
{
where
(
project_id:
ids
)
}
scope
:of_milestones
,
->
(
ids
)
{
where
(
milestone_id:
ids
)
}
scope
:with_milestone
,
->
(
title
)
{
left_joins_milestones
.
where
(
milestones:
{
title:
title
})
}
scope
:opened
,
->
{
with_state
(
:opened
,
:reopened
)
}
scope
:only_opened
,
->
{
with_state
(
:opened
)
}
scope
:only_reopened
,
->
{
with_state
(
:reopened
)
}
...
...
@@ -45,6 +46,7 @@ module Issuable
scope
:references_project
,
->
{
references
(
:project
)
}
scope
:non_archived
,
->
{
join_project
.
where
(
projects:
{
archived:
false
})
}
delegate
:name
,
:email
,
to: :author
,
...
...
spec/features/issues/filter_by_milestone_spec.rb
浏览文件 @
dac9b421
...
...
@@ -15,14 +15,14 @@ feature 'Issue filtering by Milestone', feature: true do
end
context
'filters by upcoming milestone'
,
js:
true
do
it
'should show issues with no expiry'
do
it
'should
not
show issues with no expiry'
do
create
(
:issue
,
project:
project
)
create
(
:issue
,
project:
project
,
milestone:
milestone
)
visit_issues
(
project
)
filter_by_milestone
(
Milestone
::
Upcoming
.
title
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
0
)
end
it
'should show issues in future'
do
...
...
@@ -36,7 +36,7 @@ feature 'Issue filtering by Milestone', feature: true do
expect
(
page
).
to
have_css
(
'.issue'
,
count:
1
)
end
it
'should show issues in past'
do
it
'should
not
show issues in past'
do
milestone
=
create
(
:milestone
,
project:
project
,
due_date:
Date
.
yesterday
)
create
(
:issue
,
project:
project
)
create
(
:issue
,
project:
project
,
milestone:
milestone
)
...
...
@@ -44,7 +44,7 @@ feature 'Issue filtering by Milestone', feature: true do
visit_issues
(
project
)
filter_by_milestone
(
Milestone
::
Upcoming
.
title
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
2
)
expect
(
page
).
to
have_css
(
'.issue'
,
count:
0
)
end
end
...
...
spec/features/issues_spec.rb
浏览文件 @
dac9b421
...
...
@@ -185,12 +185,14 @@ describe 'Issues', feature: true do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
sort:
sort_value_recently_created
)
expect
(
first_issue
).
to
include
(
'baz'
)
expect
(
last_issue
).
to
include
(
'foo'
)
end
it
'sorts by oldest'
do
visit
namespace_project_issues_path
(
project
.
namespace
,
project
,
sort:
sort_value_oldest_created
)
expect
(
first_issue
).
to
include
(
'foo'
)
expect
(
last_issue
).
to
include
(
'baz'
)
end
it
'sorts by most recently updated'
do
...
...
spec/features/merge_requests/filter_by_milestone_spec.rb
浏览文件 @
dac9b421
...
...
@@ -21,14 +21,14 @@ feature 'Merge Request filtering by Milestone', feature: true do
end
context
'filters by upcoming milestone'
,
js:
true
do
it
'should show issues with no expiry'
do
it
'should
not
show issues with no expiry'
do
create
(
:merge_request
,
:with_diffs
,
source_project:
project
)
create
(
:merge_request
,
:simple
,
source_project:
project
,
milestone:
milestone
)
visit_merge_requests
(
project
)
filter_by_milestone
(
Milestone
::
Upcoming
.
title
)
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
2
)
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
0
)
end
it
'should show issues in future'
do
...
...
@@ -42,7 +42,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
1
)
end
it
'should show issues in past'
do
it
'should
not
show issues in past'
do
milestone
=
create
(
:milestone
,
project:
project
,
due_date:
Date
.
yesterday
)
create
(
:merge_request
,
:with_diffs
,
source_project:
project
)
create
(
:merge_request
,
:simple
,
source_project:
project
,
milestone:
milestone
)
...
...
@@ -50,7 +50,7 @@ feature 'Merge Request filtering by Milestone', feature: true do
visit_merge_requests
(
project
)
filter_by_milestone
(
Milestone
::
Upcoming
.
title
)
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
2
)
expect
(
page
).
to
have_css
(
'.merge-request'
,
count:
0
)
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录