debian-mirror-gitlab/app/assets/javascripts/jobs/components/erased_block.vue

44 lines
934 B
Vue
Raw Normal View History

2018-11-20 20:47:30 +05:30
<script>
2018-12-13 13:39:08 +05:30
import _ from 'underscore';
2019-02-13 22:33:31 +05:30
import { GlLink } from '@gitlab/ui';
2018-12-13 13:39:08 +05:30
import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
2018-11-20 20:47:30 +05:30
2018-12-13 13:39:08 +05:30
export default {
components: {
TimeagoTooltip,
GlLink,
},
props: {
user: {
type: Object,
required: false,
default: () => ({}),
2018-11-20 20:47:30 +05:30
},
2018-12-13 13:39:08 +05:30
erasedAt: {
type: String,
required: true,
2018-11-20 20:47:30 +05:30
},
2018-12-13 13:39:08 +05:30
},
computed: {
isErasedByUser() {
return !_.isEmpty(this.user);
2018-11-20 20:47:30 +05:30
},
2018-12-13 13:39:08 +05:30
},
};
2018-11-20 20:47:30 +05:30
</script>
<template>
<div class="prepend-top-default js-build-erased">
<div class="erased alert alert-warning">
2018-12-05 23:21:45 +05:30
<template v-if="isErasedByUser">
2019-02-13 22:33:31 +05:30
{{ s__('Job|Job has been erased by') }}
<gl-link :href="user.web_url"> {{ user.username }} </gl-link>
2018-11-20 20:47:30 +05:30
</template>
<template v-else>
2019-02-13 22:33:31 +05:30
{{ s__('Job|Job has been erased') }}
2018-11-20 20:47:30 +05:30
</template>
2019-02-13 22:33:31 +05:30
<timeago-tooltip :time="erasedAt" />
2018-11-20 20:47:30 +05:30
</div>
</div>
</template>