Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
1fb2c1ca
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,发现更多精彩内容 >>
提交
1fb2c1ca
编写于
9月 01, 2017
作者:
F
Filipa Lacerda
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adds tooltip for Auto DevOps badge in pipeline table
上级
6c021a9a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
92 addition
and
25 deletion
+92
-25
app/assets/javascripts/pipelines/components/pipeline_url.vue
app/assets/javascripts/pipelines/components/pipeline_url.vue
+37
-24
app/assets/javascripts/vue_shared/directives/popover.js
app/assets/javascripts/vue_shared/directives/popover.js
+24
-0
app/assets/stylesheets/pages/commits.scss
app/assets/stylesheets/pages/commits.scss
+1
-1
app/assets/stylesheets/pages/pipelines.scss
app/assets/stylesheets/pages/pipelines.scss
+9
-0
spec/javascripts/pipelines/pipeline_url_spec.js
spec/javascripts/pipelines/pipeline_url_spec.js
+21
-0
未找到文件。
app/assets/javascripts/pipelines/components/pipeline_url.vue
浏览文件 @
1fb2c1ca
<
script
>
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
userAvatarLink
from
'
../../vue_shared/components/user_avatar/user_avatar_link.vue
'
;
import
tooltip
from
'
../../vue_shared/directives/tooltip
'
;
import
popover
from
'
../../vue_shared/directives/popover
'
;
export
default
{
props
:
{
pipeline
:
{
type
:
Object
,
required
:
true
,
export
default
{
props
:
{
pipeline
:
{
type
:
Object
,
required
:
true
,
},
},
},
components
:
{
userAvatarLink
,
},
directives
:
{
tooltip
,
},
computed
:
{
user
()
{
return
this
.
pipeline
.
user
;
components
:
{
userAvatarLink
,
},
},
};
directives
:
{
tooltip
,
popover
,
},
computed
:
{
user
()
{
return
this
.
pipeline
.
user
;
},
autoDevOpsTitle
()
{
return
'
<div class="autodevops-title">This pipeline makes use of a predefined CI/CD configuration enabled by <b>Auto DevOps.</b></div>
'
;
},
autoDevOpsContent
()
{
return
'
<a class="autodevops-link" href="">Learn more about Auto DevOps</a>
'
;
},
},
};
</
script
>
<
template
>
<div
class=
"table-section section-15 hidden-xs hidden-sm"
>
...
...
@@ -57,13 +65,18 @@ export default {
:title=
"pipeline.yaml_errors"
>
yaml invalid
</span>
<
span
<
a
v-if=
"pipeline.flags.auto_devops"
v-tooltip
class=
"label label-info"
title=
"Pipeline was configured by Auto DevOps"
>
class=
"js-pipeline-url-autodevops label label-info"
v-popover:html
tabindex=
"0"
role=
"button"
data-trigger=
"focus"
data-placement=
"top"
:title=
"autoDevOpsTitle"
:data-content=
"autoDevOpsContent"
>
Auto DevOps
</
span
>
</
a
>
<span
v-if=
"pipeline.flags.stuck"
class=
"js-pipeline-url-stuck label label-warning"
>
...
...
app/assets/javascripts/vue_shared/directives/popover.js
0 → 100644
浏览文件 @
1fb2c1ca
/**
* Helper to user bootstrap popover in vue.js.
* Follow docs for html attributes: https://getbootstrap.com/docs/3.3/javascript/#static-popover
*
* @example
* import popover from 'vue_shared/directives/popover.js';
* {
* directives: [popover]
* }
* <a v-popover>popover</a>
*/
export
default
{
bind
(
el
,
binding
)
{
const
renderHTML
=
binding
.
arg
===
'
html
'
;
$
(
el
).
popover
({
html
:
renderHTML
,
});
},
unbind
(
el
)
{
$
(
el
).
popover
(
'
destroy
'
);
},
};
app/assets/stylesheets/pages/commits.scss
浏览文件 @
1fb2c1ca
...
...
@@ -220,7 +220,7 @@
.commit
,
.generic_commit_status
{
a
,
a
:not
(
.label
)
:not
(
.autodevops-link
)
,
button
{
color
:
$gl-text-color
;
vertical-align
:
baseline
;
...
...
app/assets/stylesheets/pages/pipelines.scss
浏览文件 @
1fb2c1ca
...
...
@@ -931,3 +931,12 @@ button.mini-pipeline-graph-dropdown-toggle {
.pipelines-container
.top-area
.nav-controls
>
.btn
:last-child
{
float
:
none
;
}
.autodevops-title
{
font-weight
:
$gl-font-weight-normal
;
line-height
:
1
.5
;
}
.autodevops-link
{
color
:
$gl-link-color
;
}
spec/javascripts/pipelines/pipeline_url_spec.js
浏览文件 @
1fb2c1ca
...
...
@@ -98,4 +98,25 @@ describe('Pipeline Url Component', () => {
expect
(
component
.
$el
.
querySelector
(
'
.js-pipeline-url-yaml
'
).
textContent
).
toContain
(
'
yaml invalid
'
);
expect
(
component
.
$el
.
querySelector
(
'
.js-pipeline-url-stuck
'
).
textContent
).
toContain
(
'
stuck
'
);
});
it
(
'
should render a badge for autodevops
'
,
()
=>
{
const
component
=
new
PipelineUrlComponent
({
propsData
:
{
pipeline
:
{
id
:
1
,
path
:
'
foo
'
,
flags
:
{
latest
:
true
,
yaml_errors
:
true
,
stuck
:
true
,
auto_devops
:
true
,
},
},
},
}).
$mount
();
expect
(
component
.
$el
.
querySelector
(
'
.js-pipeline-url-autodevops
'
).
textContent
.
trim
(),
).
toEqual
(
'
Auto DevOps
'
);
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录