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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1fb2c1ca
Commit
1fb2c1ca
authored
Sep 01, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds tooltip for Auto DevOps badge in pipeline table
parent
6c021a9a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
25 deletions
+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
No files found.
app/assets/javascripts/pipelines/components/pipeline_url.vue
View file @
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
{
export
default
{
props
:
{
pipeline
:
{
type
:
Object
,
...
...
@@ -14,13 +15,20 @@ export default {
},
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
View file @
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
View file @
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
View file @
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
View file @
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
'
);
});
});
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