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

113 lines
3 KiB
Vue
Raw Normal View History

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
:title="__('Latest pipeline for 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') }}</gl-link
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-07-07 11:18:12 +05:30
:title="__('This pipeline is run on the source branch')"
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>