Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
6bcf316e
Commit
6bcf316e
authored
May 09, 2017
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass docsUrl to pipeline schedules callout component.
parent
f737a079
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
11 deletions
+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
No files found.
app/assets/javascripts/pipeline_schedules/components/pipeline_schedules_callout.js
View file @
6bcf316e
...
@@ -4,8 +4,10 @@ import illustrationSvg from '../icons/intro_illustration.svg';
...
@@ -4,8 +4,10 @@ import illustrationSvg from '../icons/intro_illustration.svg';
const
cookieKey
=
'
pipeline_schedules_callout_dismissed
'
;
const
cookieKey
=
'
pipeline_schedules_callout_dismissed
'
;
export
default
{
export
default
{
name
:
'
PipelineSchedulesCallout
'
,
data
()
{
data
()
{
return
{
return
{
docsUrl
:
document
.
getElementById
(
'
pipeline-schedules-callout
'
).
dataset
.
docsUrl
,
illustrationSvg
,
illustrationSvg
,
calloutDismissed
:
Cookies
.
get
(
cookieKey
)
===
'
true
'
,
calloutDismissed
:
Cookies
.
get
(
cookieKey
)
===
'
true
'
,
};
};
...
@@ -33,8 +35,10 @@ export default {
...
@@ -33,8 +35,10 @@ export default {
Those scheduled pipelines will inherit limited project access based on their associated user.
Those scheduled pipelines will inherit limited project access based on their associated user.
</p>
</p>
<p> Learn more in the
<p> Learn more in the
<!-- FIXME -->
<a
<a href="random.com">pipeline schedules documentation</a>.
:href="docsUrl"
target="_blank"
rel="nofollow">pipeline schedules documentation</a>. <!-- oneline to prevent extra space before period -->
</p>
</p>
</div>
</div>
</div>
</div>
...
...
app/assets/javascripts/pipeline_schedules/pipeline_schedules_index_bundle.js
View file @
6bcf316e
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
PipelineSchedulesCallout
from
'
./components/pipeline_schedules_callout
'
;
import
PipelineSchedulesCallout
from
'
./components/pipeline_schedules_callout
'
;
const
PipelineSchedulesCalloutComponent
=
Vue
.
extend
(
PipelineSchedulesCallout
);
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
new
Vue
({
el
:
'
#pipeline-schedules-callout
'
,
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
components
:
{
new
PipelineSchedulesCalloutComponent
()
'
pipeline-schedules-callout
'
:
PipelineSchedulesCallout
,
.
$mount
(
'
#scheduling-pipelines-callout
'
);
},
});
render
(
createElement
)
{
return
createElement
(
'
pipeline-schedules-callout
'
);
},
}));
app/views/projects/pipeline_schedules/index.html.haml
View file @
6bcf316e
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
=
render
"projects/pipelines/head"
=
render
"projects/pipelines/head"
%div
{
class:
container_class
}
%div
{
class:
container_class
}
#
scheduling-pipelines-callout
#
pipeline-schedules-callout
{
data:
{
docs_url:
help_page_path
(
'ci/pipeline_schedules'
)
}
}
.top-area
.top-area
-
schedule_path_proc
=
->
(
scope
)
{
pipeline_schedules_path
(
@project
,
scope:
scope
)
}
-
schedule_path_proc
=
->
(
scope
)
{
pipeline_schedules_path
(
@project
,
scope:
scope
)
}
=
render
"tabs"
,
schedule_path_proc:
schedule_path_proc
,
all_schedules:
@all_schedules
,
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
View file @
6bcf316e
---
title
:
Pass docsUrl to pipeline schedules callout component.
merge_request
:
!1126
author
:
spec/javascripts/pipeline_schedules/pipeline_schedule_callout_spec.js
View file @
6bcf316e
...
@@ -4,8 +4,15 @@ import PipelineSchedulesCallout from '~/pipeline_schedules/components/pipeline_s
...
@@ -4,8 +4,15 @@ import PipelineSchedulesCallout from '~/pipeline_schedules/components/pipeline_s
const
PipelineSchedulesCalloutComponent
=
Vue
.
extend
(
PipelineSchedulesCallout
);
const
PipelineSchedulesCalloutComponent
=
Vue
.
extend
(
PipelineSchedulesCallout
);
const
cookieKey
=
'
pipeline_schedules_callout_dismissed
'
;
const
cookieKey
=
'
pipeline_schedules_callout_dismissed
'
;
const
docsUrl
=
'
help/ci/scheduled_pipelines
'
;
describe
(
'
Pipeline Schedule Callout
'
,
()
=>
{
describe
(
'
Pipeline Schedule Callout
'
,
()
=>
{
beforeEach
(()
=>
{
setFixtures
(
`
<div id='pipeline-schedules-callout' data-docs-url=
${
docsUrl
}
></div>
`
);
});
describe
(
'
independent of cookies
'
,
()
=>
{
describe
(
'
independent of cookies
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
this
.
calloutComponent
=
new
PipelineSchedulesCalloutComponent
().
$mount
();
this
.
calloutComponent
=
new
PipelineSchedulesCalloutComponent
().
$mount
();
...
@@ -18,6 +25,10 @@ describe('Pipeline Schedule Callout', () => {
...
@@ -18,6 +25,10 @@ describe('Pipeline Schedule Callout', () => {
it
(
'
correctly sets illustrationSvg
'
,
()
=>
{
it
(
'
correctly sets illustrationSvg
'
,
()
=>
{
expect
(
this
.
calloutComponent
.
illustrationSvg
).
toContain
(
'
<svg
'
);
expect
(
this
.
calloutComponent
.
illustrationSvg
).
toContain
(
'
<svg
'
);
});
});
it
(
'
correctly sets docsUrl
'
,
()
=>
{
expect
(
this
.
calloutComponent
.
docsUrl
).
toContain
(
docsUrl
);
});
});
});
describe
(
`when
${
cookieKey
}
cookie is set`
,
()
=>
{
describe
(
`when
${
cookieKey
}
cookie is set`
,
()
=>
{
...
@@ -61,6 +72,10 @@ describe('Pipeline Schedule Callout', () => {
...
@@ -61,6 +72,10 @@ describe('Pipeline Schedule Callout', () => {
expect
(
this
.
calloutComponent
.
$el
.
outerHTML
).
toContain
(
'
runs pipelines in the future
'
);
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
)
=>
{
it
(
'
updates calloutDismissed when close button is clicked
'
,
(
done
)
=>
{
this
.
calloutComponent
.
$el
.
querySelector
(
'
#dismiss-callout-btn
'
).
click
();
this
.
calloutComponent
.
$el
.
querySelector
(
'
#dismiss-callout-btn
'
).
click
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment