2017-09-10 17:25:29 +05:30
< script >
2019-02-15 15:39:39 +05:30
import { GlLink , GlTooltipDirective } from '@gitlab/ui' ;
import _ from 'underscore' ;
import { _ _ , sprintf } from '~/locale' ;
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue' ;
import popover from '~/vue_shared/directives/popover' ;
const popoverTitle = sprintf (
_ . escape (
_ _ (
` This pipeline makes use of a predefined CI/CD configuration enabled by %{strongStart}Auto DevOps.%{strongEnd} ` ,
) ,
) ,
{ strongStart : '<b>' , strongEnd : '</b>' } ,
false ,
) ;
2017-09-10 17:25:29 +05:30
2018-11-08 19:23:39 +05:30
export default {
components : {
2019-02-15 15:39:39 +05:30
UserAvatarLink ,
GlLink ,
2018-11-08 19:23:39 +05:30
} ,
directives : {
2019-02-15 15:39:39 +05:30
GlTooltip : GlTooltipDirective ,
2018-11-08 19:23:39 +05:30
popover ,
} ,
props : {
pipeline : {
type : Object ,
required : true ,
2017-09-10 17:25:29 +05:30
} ,
2018-11-08 19:23:39 +05:30
autoDevopsHelpPath : {
type : String ,
required : true ,
2017-09-10 17:25:29 +05:30
} ,
2018-11-08 19:23:39 +05:30
} ,
computed : {
user ( ) {
return this . pipeline . user ;
2018-03-17 18:26:18 +05:30
} ,
2018-11-08 19:23:39 +05:30
popoverOptions ( ) {
return {
html : true ,
trigger : 'focus' ,
placement : 'top' ,
title : ` <div class="autodevops-title">
2019-02-15 15:39:39 +05:30
$ { popoverTitle }
2018-03-17 18:26:18 +05:30
< / div > ` ,
2018-11-08 19:23:39 +05:30
content : ` <a
2018-03-17 18:26:18 +05:30
class = "autodevops-link"
href = "${this.autoDevopsHelpPath}"
target = "_blank"
rel = "noopener noreferrer nofollow" >
2019-02-15 15:39:39 +05:30
$ { _ . escape ( _ _ ( 'Learn more about Auto DevOps' ) ) }
2018-03-17 18:26:18 +05:30
< / a > ` ,
2018-11-08 19:23:39 +05:30
} ;
2018-03-17 18:26:18 +05:30
} ,
2018-11-08 19:23:39 +05:30
} ,
} ;
2017-09-10 17:25:29 +05:30
< / script >
< template >
2019-07-31 22:56:46 +05:30
< div class = "table-section section-10 d-none d-sm-none d-md-block pipeline-tags" >
2019-09-30 21:07:59 +05:30
< gl-link :href = "pipeline.path" class = "js-pipeline-url-link js-onboarding-pipeline-item" >
2018-03-17 18:26:18 +05:30
< span class = "pipeline-id" > # { { pipeline . id } } < / span >
2019-02-15 15:39:39 +05:30
< / gl-link >
2017-09-10 17:25:29 +05:30
< div class = "label-container" >
< span
2018-11-08 19:23:39 +05:30
v - if = "pipeline.flags.latest"
2019-02-15 15:39:39 +05:30
v - gl - tooltip
2019-12-04 20:38:33 +05:30
: title = "__('Latest pipeline for the most recent commit on this branch')"
2018-11-08 19:23:39 +05:30
class = "js-pipeline-url-latest badge badge-success"
2019-02-15 15:39:39 +05:30
>
{ { _ _ ( 'latest' ) } }
2017-09-10 17:25:29 +05:30
< / span >
< span
2018-11-08 19:23:39 +05:30
v - if = "pipeline.flags.yaml_errors"
2019-02-15 15:39:39 +05:30
v - gl - tooltip
2018-11-08 19:23:39 +05:30
: title = "pipeline.yaml_errors"
2019-02-15 15:39:39 +05:30
class = "js-pipeline-url-yaml badge badge-danger"
>
{ { _ _ ( 'yaml invalid' ) } }
2017-09-10 17:25:29 +05:30
< / span >
2018-03-17 18:26:18 +05:30
< span
2018-11-08 19:23:39 +05:30
v - if = "pipeline.flags.failure_reason"
2019-02-15 15:39:39 +05:30
v - gl - tooltip
2018-11-08 19:23:39 +05:30
: title = "pipeline.failure_reason"
2019-02-15 15:39:39 +05:30
class = "js-pipeline-url-failure badge badge-danger"
>
{ { _ _ ( 'error' ) } }
2018-03-17 18:26:18 +05:30
< / span >
2019-02-15 15:39:39 +05:30
< gl-link
2018-03-17 18:26:18 +05:30
v - if = "pipeline.flags.auto_devops"
2018-12-05 23:21:45 +05:30
v - popover = "popoverOptions"
2018-03-17 18:26:18 +05:30
tabindex = "0"
2018-11-08 19:23:39 +05:30
class = "js-pipeline-url-autodevops badge badge-info autodevops-badge"
2019-02-15 15:39:39 +05:30
role = "button"
2019-09-30 21:07:59 +05:30
> { { _ _ ( 'Auto DevOps' ) } } < / g l - l i n k
2019-02-15 15:39:39 +05:30
>
< span v-if = "pipeline.flags.stuck" class="js-pipeline-url-stuck badge badge-warning" >
{ { _ _ ( 'stuck' ) } }
< / span >
2018-12-23 12:14:25 +05:30
< span
2019-07-07 11:18:12 +05:30
v - if = "pipeline.flags.detached_merge_request_pipeline"
2019-02-15 15:39:39 +05:30
v - gl - tooltip
2019-10-12 21:52:04 +05:30
: title = "
_ _ (
2019-12-04 20:38:33 +05:30
'Pipelines for merge requests are configured. A detached pipeline runs in the context of the merge request, and not against the merged result. Learn more on the documentation for Pipelines for Merged Results.' ,
2019-10-12 21:52:04 +05:30
)
"
2019-07-07 11:18:12 +05:30
class = "js-pipeline-url-detached badge badge-info"
2019-02-15 15:39:39 +05:30
>
2019-07-07 11:18:12 +05:30
{ { _ _ ( 'detached' ) } }
2018-12-23 12:14:25 +05:30
< / span >
2017-09-10 17:25:29 +05:30
< / div >
< / div >
< / template >