blob: 95616a4c7067852da3ad6e4169daa14ab458ed6e (
plain)
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 { GlLink } from '@gitlab/ui';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
export default {
components: {
ClipboardButton,
GlLink,
},
props: {
commit: {
type: Object,
required: true,
},
mergeRequest: {
type: Object,
required: false,
default: null,
},
},
};
</script>
<template>
<div>
<p class="gl-display-flex gl-flex-wrap gl-align-items-baseline gl-gap-2 gl-mb-0">
<span class="gl-display-flex gl-font-weight-bold">{{ __('Commit') }}</span>
<gl-link
:href="commit.commit_path"
class="gl-text-blue-500! gl-font-monospace"
data-testid="commit-sha"
>
{{ commit.short_id }}
</gl-link>
<clipboard-button
:text="commit.id"
:title="__('Copy commit SHA')"
category="tertiary"
size="small"
class="gl-align-self-center"
/>
<span v-if="mergeRequest">
{{ __('in') }}
<gl-link :href="mergeRequest.path" class="gl-text-blue-500!" data-testid="link-commit"
>!{{ mergeRequest.iid }}</gl-link
>
</span>
</p>
<p class="gl-mb-0">{{ commit.title }}</p>
</div>
</template>
|