1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
<script>
import { GlAvatarLabeled, GlAvatarLink, GlIcon, GlSprintf } from '@gitlab/ui';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
import TargetLink from '../target_link.vue';
import ResourceParentLink from '../resource_parent_link.vue';
export default {
components: {
GlAvatarLabeled,
GlAvatarLink,
GlIcon,
GlSprintf,
TimeAgoTooltip,
TargetLink,
ResourceParentLink,
},
props: {
event: {
type: Object,
required: true,
},
iconName: {
type: String,
required: true,
},
message: {
type: String,
required: false,
default: '',
},
iconClass: {
type: String,
required: false,
default: null,
},
},
computed: {
author() {
return this.event.author;
},
authorUsername() {
return `@${this.author.username}`;
},
},
};
</script>
<template>
<li class="gl-mt-5 gl-pb-5 gl-border-b gl-relative">
<time-ago-tooltip :time="event.created_at" class="gl-float-right gl-text-secondary" />
<gl-avatar-link :href="author.web_url">
<gl-avatar-labeled
:label="author.name"
:sub-label="authorUsername"
:src="author.avatar_url"
:size="32"
/>
</gl-avatar-link>
<div class="gl-pl-8 gl-mt-2" data-testid="event-body">
<div class="gl-text-secondary">
<gl-icon :class="iconClass" :name="iconName" />
<gl-sprintf v-if="message" :message="message">
<template #targetLink>
<target-link :event="event" />
</template>
<template #resourceParentLink>
<resource-parent-link :event="event" />
</template>
</gl-sprintf>
<slot v-else></slot>
</div>
<div v-if="$scopedSlots['additional-info']" class="gl-mt-2">
<slot name="additional-info"></slot>
</div>
</div>
</li>
</template>
|