gitlab-org--gitlab-foss/app/assets/javascripts/jobs/components/erased_block.vue

44 lines
934 B
Vue
Raw Normal View History

<script>
2018-10-10 02:23:54 -04:00
import _ from 'underscore';
2018-11-16 14:29:11 -05:00
import { GlLink } from '@gitlab/ui';
2018-10-10 02:23:54 -04:00
import TimeagoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
2018-10-10 02:23:54 -04:00
export default {
components: {
TimeagoTooltip,
GlLink,
2018-10-10 02:23:54 -04:00
},
props: {
user: {
type: Object,
required: false,
default: () => ({}),
},
2018-10-10 02:23:54 -04:00
erasedAt: {
type: String,
required: true,
},
2018-10-10 02:23:54 -04:00
},
computed: {
isErasedByUser() {
return !_.isEmpty(this.user);
},
2018-10-10 02:23:54 -04:00
},
};
</script>
<template>
<div class="prepend-top-default js-build-erased">
<div class="erased alert alert-warning">
<template v-if="isErasedByUser">
2018-11-16 15:07:38 -05:00
{{ s__('Job|Job has been erased by') }}
<gl-link :href="user.web_url"> {{ user.username }} </gl-link>
</template>
<template v-else>
2018-11-16 15:07:38 -05:00
{{ s__('Job|Job has been erased') }}
</template>
2018-08-13 11:52:42 -04:00
2018-11-16 15:07:38 -05:00
<timeago-tooltip :time="erasedAt" />
</div>
</div>
</template>