Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
580220c6
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,发现更多精彩内容 >>
提交
580220c6
编写于
12月 21, 2016
作者:
A
Alfredo Sumaran
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'backport-mr-widget-ci-js' into 'master'
Backport moving MR widget CI JS out of script tag See merge request !8200
上级
f3f42f7b
27c613cb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
49 addition
and
24 deletion
+49
-24
app/assets/javascripts/merge_request_widget/ci_bundle.js.es6
app/assets/javascripts/merge_request_widget/ci_bundle.js.es6
+42
-0
app/views/projects/merge_requests/widget/open/_accept.html.haml
...ews/projects/merge_requests/widget/open/_accept.html.haml
+3
-18
app/views/projects/merge_requests/widget/open/_check.html.haml
...iews/projects/merge_requests/widget/open/_check.html.haml
+3
-6
config/application.rb
config/application.rb
+1
-0
未找到文件。
app/assets/javascripts/merge_request_widget/ci_bundle.js.es6
0 → 100644
浏览文件 @
580220c6
/* global merge_request_widget */
(() => {
$(() => {
/* TODO: This needs a better home, or should be refactored. It was previously contained
* in a script tag in app/views/projects/merge_requests/widget/open/_accept.html.haml,
* but Vue chokes on script tags and prevents their execution. So it was moved here
* temporarily.
* */
if ($('.accept-mr-form').length) {
$('.accept-mr-form').on('ajax:send', () => {
$('.accept-mr-form :input').disable();
});
$('.accept_merge_request').on('click', () => {
$('.js-merge-button').html('<i class="fa fa-spinner fa-spin"></i> Merge in progress');
});
$('.merge_when_build_succeeds').on('click', () => {
$('#merge_when_build_succeeds').val('1');
});
$('.js-merge-dropdown a').on('click', (e) => {
e.preventDefault();
$(this).closest('form').submit();
});
} else if ($('.rebase-in-progress').length) {
merge_request_widget.rebaseInProgress();
} else if ($('.rebase-mr-form').length) {
$('.rebase-mr-form').on('ajax:send', () => {
$('.rebase-mr-form :input').disable();
});
$('.js-rebase-button').on('click', () => {
$('.js-rebase-button').html("<i class='fa fa-spinner fa-spin'></i> Rebase in progress");
});
} else {
merge_request_widget.getMergeStatus();
}
});
})();
app/views/projects/merge_requests/widget/open/_accept.html.haml
浏览文件 @
580220c6
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_tag
(
'merge_request_widget/ci_bundle.js'
)
-
status_class
=
@pipeline
?
" ci-
#{
@pipeline
.
status
}
"
:
nil
=
form_for
[
:merge
,
@project
.
namespace
.
becomes
(
Namespace
),
@project
,
@merge_request
],
remote:
true
,
method: :post
,
html:
{
class:
'accept-mr-form js-quick-submit js-requires-input'
}
do
|
f
|
...
...
@@ -47,21 +50,3 @@
rows:
14
,
hint:
true
=
hidden_field_tag
:merge_when_build_succeeds
,
""
,
autocomplete:
"off"
:javascript
$
(
'
.accept-mr-form
'
).
on
(
'
ajax:send
'
,
function
()
{
$
(
"
.accept-mr-form :input
"
).
disable
();
});
$
(
'
.accept_merge_request
'
).
on
(
'
click
'
,
function
()
{
$
(
'
.js-merge-button
'
).
html
(
"
<i class='fa fa-spinner fa-spin'></i> Merge in progress
"
);
});
$
(
'
.merge_when_build_succeeds
'
).
on
(
'
click
'
,
function
()
{
$
(
"
#merge_when_build_succeeds
"
).
val
(
"
1
"
);
});
$
(
'
.js-merge-dropdown a
'
).
on
(
'
click
'
,
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
closest
(
"
form
"
).
submit
();
});
app/views/projects/merge_requests/widget/open/_check.html.haml
浏览文件 @
580220c6
-
content_for
:page_specific_javascripts
do
=
page_specific_javascript_tag
(
'merge_request_widget/ci_bundle.js'
)
%strong
=
icon
(
"spinner spin"
)
Checking ability to merge automatically
…
:javascript
$
(
function
()
{
merge_request_widget
.
getMergeStatus
();
});
config/application.rb
浏览文件 @
580220c6
...
...
@@ -96,6 +96,7 @@ module Gitlab
config
.
assets
.
precompile
<<
"profile/profile_bundle.js"
config
.
assets
.
precompile
<<
"protected_branches/protected_branches_bundle.js"
config
.
assets
.
precompile
<<
"diff_notes/diff_notes_bundle.js"
config
.
assets
.
precompile
<<
"merge_request_widget/ci_bundle.js"
config
.
assets
.
precompile
<<
"boards/boards_bundle.js"
config
.
assets
.
precompile
<<
"cycle_analytics/cycle_analytics_bundle.js"
config
.
assets
.
precompile
<<
"merge_conflicts/merge_conflicts_bundle.js"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录