gitlab-org--gitlab-foss/app/assets/javascripts/pipelines/components/pipeline_url.vue

106 lines
2.6 KiB
Vue
Raw Normal View History

<script>
2018-06-27 10:28:05 -04:00
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';
2018-06-27 10:28:05 -04:00
export default {
components: {
userAvatarLink,
},
directives: {
tooltip,
popover,
},
props: {
pipeline: {
type: Object,
required: true,
2018-01-04 19:18:35 -05:00
},
2018-06-27 10:28:05 -04:00
autoDevopsHelpPath: {
type: String,
required: true,
2018-01-04 19:18:35 -05:00
},
2018-06-27 10:28:05 -04:00
},
computed: {
user() {
return this.pipeline.user;
},
2018-06-27 10:28:05 -04:00
popoverOptions() {
return {
html: true,
trigger: 'focus',
placement: 'top',
title: `<div class="autodevops-title">
This pipeline makes use of a predefined CI/CD configuration enabled by <b>Auto DevOps.</b>
</div>`,
2018-06-27 10:28:05 -04:00
content: `<a
class="autodevops-link"
href="${this.autoDevopsHelpPath}"
target="_blank"
rel="noopener noreferrer nofollow">
Learn more about Auto DevOps
</a>`,
2018-06-27 10:28:05 -04:00
};
},
2018-06-27 10:28:05 -04:00
},
};
</script>
<template>
2018-04-09 17:36:25 -04:00
<div class="table-section section-15 d-none d-sm-none d-md-block pipeline-tags">
<a
:href="pipeline.path"
class="js-pipeline-url-link">
2018-01-04 19:18:35 -05:00
<span class="pipeline-id">#{{ pipeline.id }}</span>
</a>
<span>by</span>
<user-avatar-link
v-if="user"
:link-href="pipeline.user.path"
:img-src="pipeline.user.avatar_url"
:tooltip-text="pipeline.user.name"
2018-06-11 05:49:47 -04:00
class="js-pipeline-url-user"
/>
<span
v-if="!user"
class="js-pipeline-url-api api">
API
</span>
<div class="label-container">
<span
v-tooltip
2018-06-11 05:49:47 -04:00
v-if="pipeline.flags.latest"
2018-05-22 12:03:52 -04:00
class="js-pipeline-url-latest badge badge-success"
title="Latest pipeline for this branch">
latest
</span>
<span
v-tooltip
2018-06-11 05:49:47 -04:00
v-if="pipeline.flags.yaml_errors"
:title="pipeline.yaml_errors"
class="js-pipeline-url-yaml badge badge-danger">
yaml invalid
</span>
<span
v-tooltip
2018-06-11 05:49:47 -04:00
v-if="pipeline.flags.failure_reason"
:title="pipeline.failure_reason"
class="js-pipeline-url-failure badge badge-danger">
error
</span>
<a
2018-06-11 05:49:47 -04:00
v-popover="popoverOptions"
v-if="pipeline.flags.auto_devops"
tabindex="0"
2018-05-22 12:03:52 -04:00
class="js-pipeline-url-autodevops badge badge-info autodevops-badge"
role="button">
Auto DevOps
</a>
<span
v-if="pipeline.flags.stuck"
2018-05-22 12:03:52 -04:00
class="js-pipeline-url-stuck badge badge-warning">
stuck
</span>
</div>
</div>
</template>