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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
<script>
import { mapGetters } from 'vuex';
import Icon from '../../../vue_shared/components/icon.vue';
import timeago from '../../../vue_shared/mixins/timeago';
import tooltip from '../../../vue_shared/directives/tooltip';
import TitleComponent from '../../../issue_show/components/title.vue';
import DescriptionComponent from '../../../issue_show/components/description.vue';
const states = {
open: 'open',
closed: 'closed',
};
export default {
directives: {
tooltip,
},
components: {
Icon,
TitleComponent,
DescriptionComponent,
},
mixins: [timeago],
computed: {
...mapGetters(['currentMergeRequest']),
isOpen() {
return this.currentMergeRequest.state === states.open;
},
isClosed() {
return this.currentMergeRequest.state === states.closed;
},
authorUsername() {
return `@${this.currentMergeRequest.author.username}`;
},
iconName() {
return this.isOpen ? 'issue-open-m' : 'close';
},
},
};
</script>
<template>
<div class="ide-merge-request-info">
<div class="detail-page-header">
<div class="detail-page-header-body">
<div
:class="{
'status-box-open': isOpen,
'status-box-closed': isClosed
}"
class="issuable-status-box status-box d-flex h-100"
>
<icon
:name="iconName"
/>
</div>
<div class="issuable-meta">
Opened
{{ timeFormated(currentMergeRequest.created_at) }}
by
<a
:href="currentMergeRequest.author.web_url"
class="author_link"
>
<img
:src="currentMergeRequest.author.avatar_url"
class="avatar avatar-inline s24"
/>
<strong
v-tooltip
:title="authorUsername"
>
{{ currentMergeRequest.author.name }}
</strong>
</a>
</div>
</div>
</div>
<div class="issuable-details">
<title-component
:issuable-ref="currentMergeRequest.iid"
:title-html="currentMergeRequest.title"
:title-text="currentMergeRequest.title"
/>
<description-component
:description-html="currentMergeRequest.description"
:description-text="currentMergeRequest.description"
/>
</div>
</div>
</template>
<style scoped>
.ide-merge-request-info {
overflow: auto;
}
</style>
|