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
|
<script>
import { GlAvatarLabeled, GlAvatarLink, GlIcon } from '@gitlab/ui';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
export default {
components: { GlAvatarLabeled, GlAvatarLink, GlIcon, TimeAgoTooltip },
props: {
event: {
type: Object,
required: true,
},
iconName: {
type: String,
required: true,
},
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" />
<slot></slot>
</div>
<div v-if="$scopedSlots['additional-info']" class="gl-mt-2">
<slot name="additional-info"></slot>
</div>
</div>
</li>
</template>
|