Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
ea7bf7ed
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 搜索 >>
未验证
提交
ea7bf7ed
编写于
12月 22, 2016
作者:
J
jurre
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Show a custom WIP help message for MR's with WIP commits
上级
e59623e7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
70 addition
and
2 deletion
+70
-2
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+1
-1
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+2
-1
app/views/shared/issuable/form/_title.html.haml
app/views/shared/issuable/form/_title.html.haml
+4
-0
spec/features/merge_requests/wip_message_spec.rb
spec/features/merge_requests/wip_message_spec.rb
+63
-0
未找到文件。
app/views/projects/merge_requests/_new_submit.html.haml
浏览文件 @
ea7bf7ed
...
...
@@ -11,7 +11,7 @@
=
link_to
'Change branches'
,
mr_change_branches_path
(
@merge_request
)
%hr
=
form_for
[
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@merge_request
],
html:
{
class:
'merge-request-form form-horizontal common-note-form js-requires-input js-quick-submit'
}
do
|
f
|
=
render
'shared/issuable/form'
,
f:
f
,
issuable:
@merge_request
=
render
'shared/issuable/form'
,
f:
f
,
issuable:
@merge_request
,
commits:
@commits
=
f
.
hidden_field
:source_project_id
=
f
.
hidden_field
:source_branch
=
f
.
hidden_field
:target_project_id
...
...
app/views/shared/issuable/_form.html.haml
浏览文件 @
ea7bf7ed
-
form
=
local_assigns
.
fetch
(
:f
)
-
commits
=
local_assigns
[
:commits
]
-
project
=
@target_project
||
@project
=
form_errors
(
issuable
)
...
...
@@ -14,7 +15,7 @@
=
form
.
label
:title
,
class:
'control-label'
=
render
'shared/issuable/form/template_selector'
,
issuable:
issuable
=
render
'shared/issuable/form/title'
,
issuable:
issuable
,
form:
form
=
render
'shared/issuable/form/title'
,
issuable:
issuable
,
form:
form
,
has_wip_commits:
commits
&&
commits
.
detect
(
&
:work_in_progress?
)
=
render
'shared/issuable/form/description'
,
issuable:
issuable
,
form:
form
...
...
app/views/shared/issuable/form/_title.html.haml
浏览文件 @
ea7bf7ed
-
issuable
=
local_assigns
.
fetch
(
:issuable
)
-
has_wip_commits
=
local_assigns
.
fetch
(
:has_wip_commits
)
-
form
=
local_assigns
.
fetch
(
:form
)
-
no_issuable_templates
=
issuable_templates
(
issuable
).
empty?
-
div_class
=
no_issuable_templates
?
'col-sm-10'
:
'col-sm-7 col-lg-8'
...
...
@@ -18,6 +19,9 @@
%strong
Work In Progress
merge request to be merged when it's ready.
.js-no-wip-explanation
-
if
has_wip_commits
It looks like you have some WIP commits in this branch.
%br
%a
.js-toggle-wip
{
href:
''
,
tabindex:
-
1
}
Start the title with
%code
WIP:
...
...
spec/features/merge_requests/wip_message_spec.rb
0 → 100644
浏览文件 @
ea7bf7ed
require
'spec_helper'
feature
'Work In Progress help message'
,
feature:
true
do
let!
(
:project
)
{
create
(
:project
,
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
}
let!
(
:user
)
{
create
(
:user
)
}
before
do
project
.
team
<<
[
user
,
:master
]
login_as
(
user
)
end
context
'with WIP commits'
do
it
'shows a specific WIP hint'
do
visit
new_namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request:
{
source_project_id:
project
.
id
,
target_project_id:
project
.
id
,
source_branch:
'wip'
,
target_branch:
'master'
}
)
within_wip_explanation
do
expect
(
page
).
to
have_text
(
'It looks like you have some WIP commits in this branch'
)
end
end
end
context
'without WIP commits'
do
it
'shows the regular WIP message'
do
visit
new_namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request:
{
source_project_id:
project
.
id
,
target_project_id:
project
.
id
,
source_branch:
'fix'
,
target_branch:
'master'
}
)
within_wip_explanation
do
expect
(
page
).
not_to
have_text
(
'It looks like you have some WIP commits in this branch'
)
expect
(
page
).
to
have_text
(
"Start the title with WIP: to prevent a Work In Progress merge \
request from being merged before it's ready"
)
end
end
end
def
within_wip_explanation
(
&
block
)
page
.
within
'.js-no-wip-explanation'
do
yield
end
end
end
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录