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

50 lines
1.1 KiB
Vue
Raw Normal View History

2018-11-20 20:47:30 +05:30
<script>
2021-03-11 19:13:27 +05:30
import { GlAlert, GlLink, GlSprintf } from '@gitlab/ui';
2020-03-13 15:44:24 +05:30
import { isEmpty } from 'lodash';
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: {
2021-03-11 19:13:27 +05:30
GlAlert,
2018-12-13 13:39:08 +05:30
GlLink,
2021-03-11 19:13:27 +05:30
GlSprintf,
TimeagoTooltip,
2018-12-13 13:39:08 +05:30
},
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() {
2020-03-13 15:44:24 +05:30
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>
2021-03-11 19:13:27 +05:30
<div class="gl-mt-3">
<gl-alert variant="warning" :dismissible="false">
2018-12-05 23:21:45 +05:30
<template v-if="isErasedByUser">
2021-03-11 19:13:27 +05:30
<gl-sprintf :message="s__('Job|Job has been erased by %{userLink}')">
<template #userLink>
<gl-link :href="user.web_url" target="_blank">{{ user.username }}</gl-link>
</template>
</gl-sprintf>
2018-11-20 20:47:30 +05:30
</template>
2021-03-11 19:13:27 +05:30
2018-11-20 20:47:30 +05:30
<template v-else>
2019-02-15 15:39:39 +05:30
{{ s__('Job|Job has been erased') }}
2018-11-20 20:47:30 +05:30
</template>
2019-02-15 15:39:39 +05:30
<timeago-tooltip :time="erasedAt" />
2021-03-11 19:13:27 +05:30
</gl-alert>
2018-11-20 20:47:30 +05:30
</div>
</template>