summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/jobs/components/commit_block.vue
blob: 9373dbebc8ad9c7a7a47eecec521f5b40934d9a7 (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
55
56
57
58
<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,
    },
    isLastBlock: {
      type: Boolean,
      required: true,
    },
  },
};
</script>
<template>
  <div
    :class="{
      'block-last': isLastBlock,
      block: !isLastBlock
  }">
    <p>
      {{ __('Commit') }}

      <gl-link
        :href="commit.commit_path"
        class="js-commit-sha commit-sha link-commit"
      >{{ commit.short_id }}</gl-link>

      <clipboard-button
        :text="commit.short_id"
        :title="__('Copy commit SHA to clipboard')"
        css-class="btn btn-clipboard btn-transparent"
      />

      <gl-link
        v-if="mergeRequest"
        :href="mergeRequest.path"
        class="js-link-commit link-commit"
      >!{{ mergeRequest.iid }}</gl-link>
    </p>

    <p class="build-light-text append-bottom-0">
      {{ commit.title }}
    </p>
  </div>
</template>