Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
6bcf316e
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,发现更多精彩内容 >>
提交
6bcf316e
编写于
5月 09, 2017
作者:
B
Bryce Johnson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Pass docsUrl to pipeline schedules callout component.
上级
f737a079
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
37 addition
and
11 deletion
+37
-11
app/assets/javascripts/pipeline_schedules/components/pipeline_schedules_callout.js
...peline_schedules/components/pipeline_schedules_callout.js
+8
-4
app/assets/javascripts/pipeline_schedules/pipeline_schedules_index_bundle.js
...pts/pipeline_schedules/pipeline_schedules_index_bundle.js
+9
-6
app/views/projects/pipeline_schedules/index.html.haml
app/views/projects/pipeline_schedules/index.html.haml
+1
-1
changelogs/unreleased/pipeline-schedules-callout-docs-url.yml
...gelogs/unreleased/pipeline-schedules-callout-docs-url.yml
+4
-0
spec/javascripts/pipeline_schedules/pipeline_schedule_callout_spec.js
...ipts/pipeline_schedules/pipeline_schedule_callout_spec.js
+15
-0
未找到文件。
app/assets/javascripts/pipeline_schedules/components/pipeline_schedules_callout.js
浏览文件 @
6bcf316e
...
...
@@ -4,8 +4,10 @@ import illustrationSvg from '../icons/intro_illustration.svg';
const
cookieKey
=
'
pipeline_schedules_callout_dismissed
'
;
export
default
{
name
:
'
PipelineSchedulesCallout
'
,
data
()
{
return
{
docsUrl
:
document
.
getElementById
(
'
pipeline-schedules-callout
'
).
dataset
.
docsUrl
,
illustrationSvg
,
calloutDismissed
:
Cookies
.
get
(
cookieKey
)
===
'
true
'
,
};
...
...
@@ -28,13 +30,15 @@ export default {
<div class="svg-container" v-html="illustrationSvg"></div>
<div class="user-callout-copy">
<h4>Scheduling Pipelines</h4>
<p>
The pipelines schedule runs pipelines in the future, repeatedly, for specific branches or tags.
<p>
The pipelines schedule runs pipelines in the future, repeatedly, for specific branches or tags.
Those scheduled pipelines will inherit limited project access based on their associated user.
</p>
<p> Learn more in the
<!-- FIXME -->
<a href="random.com">pipeline schedules documentation</a>.
<a
:href="docsUrl"
target="_blank"
rel="nofollow">pipeline schedules documentation</a>. <!-- oneline to prevent extra space before period -->
</p>
</div>
</div>
...
...
app/assets/javascripts/pipeline_schedules/pipeline_schedules_index_bundle.js
浏览文件 @
6bcf316e
import
Vue
from
'
vue
'
;
import
PipelineSchedulesCallout
from
'
./components/pipeline_schedules_callout
'
;
const
PipelineSchedulesCalloutComponent
=
Vue
.
extend
(
PipelineSchedulesCallout
);
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
new
PipelineSchedulesCalloutComponent
()
.
$mount
(
'
#scheduling-pipelines-callout
'
);
});
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
new
Vue
({
el
:
'
#pipeline-schedules-callout
'
,
components
:
{
'
pipeline-schedules-callout
'
:
PipelineSchedulesCallout
,
},
render
(
createElement
)
{
return
createElement
(
'
pipeline-schedules-callout
'
);
},
}));
app/views/projects/pipeline_schedules/index.html.haml
浏览文件 @
6bcf316e
...
...
@@ -6,7 +6,7 @@
=
render
"projects/pipelines/head"
%div
{
class:
container_class
}
#
scheduling-pipelines-callout
#
pipeline-schedules-callout
{
data:
{
docs_url:
help_page_path
(
'ci/pipeline_schedules'
)
}
}
.top-area
-
schedule_path_proc
=
->
(
scope
)
{
pipeline_schedules_path
(
@project
,
scope:
scope
)
}
=
render
"tabs"
,
schedule_path_proc:
schedule_path_proc
,
all_schedules:
@all_schedules
,
scope:
@scope
...
...
changelogs/unreleased/pipeline-schedules-callout-docs-url.yml
0 → 100644
浏览文件 @
6bcf316e
---
title
:
Pass docsUrl to pipeline schedules callout component.
merge_request
:
!1126
author
:
spec/javascripts/pipeline_schedules/pipeline_schedule_callout_spec.js
浏览文件 @
6bcf316e
...
...
@@ -4,8 +4,15 @@ import PipelineSchedulesCallout from '~/pipeline_schedules/components/pipeline_s
const
PipelineSchedulesCalloutComponent
=
Vue
.
extend
(
PipelineSchedulesCallout
);
const
cookieKey
=
'
pipeline_schedules_callout_dismissed
'
;
const
docsUrl
=
'
help/ci/scheduled_pipelines
'
;
describe
(
'
Pipeline Schedule Callout
'
,
()
=>
{
beforeEach
(()
=>
{
setFixtures
(
`
<div id='pipeline-schedules-callout' data-docs-url=
${
docsUrl
}
></div>
`
);
});
describe
(
'
independent of cookies
'
,
()
=>
{
beforeEach
(()
=>
{
this
.
calloutComponent
=
new
PipelineSchedulesCalloutComponent
().
$mount
();
...
...
@@ -18,6 +25,10 @@ describe('Pipeline Schedule Callout', () => {
it
(
'
correctly sets illustrationSvg
'
,
()
=>
{
expect
(
this
.
calloutComponent
.
illustrationSvg
).
toContain
(
'
<svg
'
);
});
it
(
'
correctly sets docsUrl
'
,
()
=>
{
expect
(
this
.
calloutComponent
.
docsUrl
).
toContain
(
docsUrl
);
});
});
describe
(
`when
${
cookieKey
}
cookie is set`
,
()
=>
{
...
...
@@ -61,6 +72,10 @@ describe('Pipeline Schedule Callout', () => {
expect
(
this
.
calloutComponent
.
$el
.
outerHTML
).
toContain
(
'
runs pipelines in the future
'
);
});
it
(
'
renders the documentation url
'
,
()
=>
{
expect
(
this
.
calloutComponent
.
$el
.
outerHTML
).
toContain
(
docsUrl
);
});
it
(
'
updates calloutDismissed when close button is clicked
'
,
(
done
)
=>
{
this
.
calloutComponent
.
$el
.
querySelector
(
'
#dismiss-callout-btn
'
).
click
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录