debian-mirror-gitlab/app/assets/javascripts/pipelines/components/pipeline_url.vue

106 lines
2.6 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2019-01-03 12:48:30 +05:30
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';
2017-09-10 17:25:29 +05:30
2018-11-08 19:23:39 +05:30
export default {
components: {
2019-01-03 12:48:30 +05:30
userAvatarLink,
2018-11-08 19:23:39 +05:30
},
directives: {
2019-01-03 12:48:30 +05:30
tooltip,
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">
2018-03-17 18:26:18 +05:30
This pipeline makes use of a predefined CI/CD configuration enabled by <b>Auto DevOps.</b>
</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">
Learn more about Auto DevOps
</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>
2018-11-08 19:23:39 +05:30
<div class="table-section section-15 d-none d-sm-none d-md-block pipeline-tags">
2019-01-03 12:48:30 +05:30
<a
:href="pipeline.path"
class="js-pipeline-url-link">
2018-03-17 18:26:18 +05:30
<span class="pipeline-id">#{{ pipeline.id }}</span>
2019-01-03 12:48:30 +05:30
</a>
2017-09-10 17:25:29 +05:30
<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-11-08 19:23:39 +05:30
class="js-pipeline-url-user"
2017-09-10 17:25:29 +05:30
/>
2019-01-03 12:48:30 +05:30
<span
v-if="!user"
class="js-pipeline-url-api api">
API
</span>
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-01-03 12:48:30 +05:30
v-tooltip
2018-11-08 19:23:39 +05:30
class="js-pipeline-url-latest badge badge-success"
2019-01-03 12:48:30 +05:30
title="Latest pipeline for this branch">
2017-09-10 17:25:29 +05:30
latest
</span>
<span
2018-11-08 19:23:39 +05:30
v-if="pipeline.flags.yaml_errors"
2019-01-03 12:48:30 +05:30
v-tooltip
2018-11-08 19:23:39 +05:30
:title="pipeline.yaml_errors"
2019-01-03 12:48:30 +05:30
class="js-pipeline-url-yaml badge badge-danger">
2017-09-10 17:25:29 +05:30
yaml invalid
</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-01-03 12:48:30 +05:30
v-tooltip
2018-11-08 19:23:39 +05:30
:title="pipeline.failure_reason"
2019-01-03 12:48:30 +05:30
class="js-pipeline-url-failure badge badge-danger">
2018-03-17 18:26:18 +05:30
error
</span>
2019-01-03 12:48:30 +05:30
<a
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-01-03 12:48:30 +05:30
role="button">
2018-03-17 18:26:18 +05:30
Auto DevOps
2019-01-03 12:48:30 +05:30
</a>
2018-12-23 12:14:25 +05:30
<span
2019-01-03 12:48:30 +05:30
v-if="pipeline.flags.stuck"
class="js-pipeline-url-stuck badge badge-warning">
stuck
2018-12-23 12:14:25 +05:30
</span>
2017-09-10 17:25:29 +05:30
</div>
</div>
</template>