Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
3ef1e766
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,发现更多精彩内容 >>
提交
3ef1e766
编写于
12月 20, 2016
作者:
F
Filipa Lacerda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix broken test
Changes after review
上级
4b9bd188
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
16 deletion
+22
-16
app/assets/javascripts/mini_pipeline_graph_dropdown.js.es6
app/assets/javascripts/mini_pipeline_graph_dropdown.js.es6
+13
-8
app/views/projects/ci/pipelines/_pipeline.html.haml
app/views/projects/ci/pipelines/_pipeline.html.haml
+4
-6
spec/features/projects/pipelines/pipelines_spec.rb
spec/features/projects/pipelines/pipelines_spec.rb
+4
-1
spec/models/ci/stage_spec.rb
spec/models/ci/stage_spec.rb
+1
-1
未找到文件。
app/assets/javascripts/mini_pipeline_graph_dropdown.js.es6
浏览文件 @
3ef1e766
/* eslint-disable no-new */
/* global Flash */
/* global Flash */
/**
/**
...
@@ -30,8 +31,8 @@
...
@@ -30,8 +31,8 @@
bindEvents() {
bindEvents() {
const dropdownButtonSelector = 'button.js-builds-dropdown-button';
const dropdownButtonSelector = 'button.js-builds-dropdown-button';
$(this.container).off('click', dropdownButtonSelector, this.getBuildsList)
;
$(this.container).off('click', dropdownButtonSelector, this.getBuildsList)
$(this.container)
.on('click', dropdownButtonSelector, this.getBuildsList);
.on('click', dropdownButtonSelector, this.getBuildsList);
}
}
/**
/**
...
@@ -55,21 +56,25 @@
...
@@ -55,21 +56,25 @@
* @return {Promise}
* @return {Promise}
*/
*/
getBuildsList(e) {
getBuildsList(e) {
const endpoint = e.currentTarget.dataset.stageEndpoint;
const button = e.currentTarget;
const endpoint = button.dataset.stageEndpoint;
return $.ajax({
return $.ajax({
dataType: 'json',
dataType: 'json',
type: 'GET',
type: 'GET',
url: endpoint,
url: endpoint,
beforeSend: () => {
beforeSend: () => {
this.renderBuildsList(
e.currentTarget
, '');
this.renderBuildsList(
button
, '');
this.toggleLoading(
e.currentTarget
);
this.toggleLoading(
button
);
},
},
success: (data) => {
success: (data) => {
this.toggleLoading(e.currentTarget);
this.toggleLoading(button);
this.renderBuildsList(e.currentTarget, data.html);
this.renderBuildsList(button, data.html);
},
error: () => {
this.toggleLoading(button);
new Flash('An error occurred while fetching the builds.', 'alert');
},
},
error: () => new Flash('An error occurred while fetching the builds.', 'alert'),
});
});
}
}
...
...
app/views/projects/ci/pipelines/_pipeline.html.haml
浏览文件 @
3ef1e766
...
@@ -44,17 +44,15 @@
...
@@ -44,17 +44,15 @@
-
pipeline
.
stages
.
each
do
|
stage
|
-
pipeline
.
stages
.
each
do
|
stage
|
-
if
stage
.
status
-
if
stage
.
status
-
detailed_status
=
stage
.
detailed_status
(
current_user
)
-
detailed_status
=
stage
.
detailed_status
(
current_user
)
-
klass
=
"has-tooltip ci-status-icon ci-status-icon-
#{
detailed_status
.
group
}
"
-
icon_status
=
"
#{
detailed_status
.
icon
}
_borderless"
-
icon_status
=
"
#{
detailed_status
.
icon
}
_borderless"
-
icon_status_klass
=
"ci-status-icon ci-status-icon-
#{
detailed_status
.
group
}
"
-
status_klass
=
"ci-status-icon ci-status-icon-
#{
detailed_status
.
group
}
"
-
tooltip
=
"
#{
stage
.
name
}
:
#{
detailed_status
.
label
||
'not found'
}
"
.stage-container.mini-pipeline-graph
.stage-container.mini-pipeline-graph
.dropdown.inline.build-content
.dropdown.inline.build-content
%button
.has-tooltip.builds-dropdown.js-builds-dropdown-button
{
type:
'button'
,
data:
{
toggle:
'dropdown'
,
title:
tooltip
,
placement:
'top'
,
"stage-endpoint"
=>
stage_namespace_project_pipeline_path
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
pipeline
,
stage:
stage
.
name
)}}
%button
.has-tooltip.builds-dropdown.js-builds-dropdown-button
{
type:
'button'
,
data:
{
toggle:
'dropdown'
,
title:
"#{stage.name}: #{detailed_status.label}"
,
placement:
'top'
,
"stage-endpoint"
=>
stage_namespace_project_pipeline_path
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
pipeline
,
stage:
stage
.
name
)}}
%span
{
class:
klass
}
%span
.has-tooltip
{
class:
status_
klass
}
%span
.mini-pipeline-graph-icon-container
%span
.mini-pipeline-graph-icon-container
%span
{
class:
icon_
status_klass
}=
custom_icon
(
icon_status
)
%span
{
class:
status_klass
}=
custom_icon
(
icon_status
)
=
icon
(
'caret-down'
,
class:
'dropdown-caret'
)
=
icon
(
'caret-down'
,
class:
'dropdown-caret'
)
.js-builds-dropdown-container
.js-builds-dropdown-container
...
...
spec/features/projects/pipelines/pipelines_spec.rb
浏览文件 @
3ef1e766
...
@@ -74,7 +74,10 @@ describe "Pipelines", feature: true, js:true do
...
@@ -74,7 +74,10 @@ describe "Pipelines", feature: true, js:true do
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
before
{
visit
namespace_project_pipelines_path
(
project
.
namespace
,
project
)
}
it
{
expect
(
page
).
to
have_link
(
'Manual build'
)
}
it
do
find
(
'.js-pipeline-dropdown-manual-actions'
).
click
expect
(
page
).
to
have_link
(
'Manual build'
)
end
context
'when playing'
do
context
'when playing'
do
...
...
spec/models/ci/stage_spec.rb
浏览文件 @
3ef1e766
...
@@ -36,7 +36,7 @@ describe Ci::Stage, models: true do
...
@@ -36,7 +36,7 @@ describe Ci::Stage, models: true do
subject
{
stage
.
statuses_count
}
subject
{
stage
.
statuses_count
}
it
"statuses only from current stage"
do
it
"
counts
statuses only from current stage"
do
is_expected
.
to
eq
(
1
)
is_expected
.
to
eq
(
1
)
end
end
end
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录