summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/jobs/components/commit_block.vue
blob: 7f4852955139708bde7a26b83b6d5e7f1e5041ca (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
59
60
61
62
63
64
<script>
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';

export default {
  components: {
    ClipboardButton,
  },
  props: {
    pipelineShortSha: {
      type: String,
      required: true,
    },
    pipelineShaPath: {
      type: String,
      required: true,
    },
    mergeRequestReference: {
      type: String,
      required: false,
      default: null,
    },
    mergeRequestPath: {
      type: String,
      required: false,
      default: null,
    },
    gitCommitTitlte: {
      type: String,
      required: true,
    },
  },
};
</script>
<template>
  <div class="block">
    <p>
      {{ __('Commit') }}

      <a
        :href="pipelineShaPath"
        class="js-commit-sha commit-sha link-commit"
      >
        {{ pipelineShortSha }}
      </a>

      <clipboard-button
        :text="pipelineShortSha"
        :title="__('Copy commit SHA to clipboard')"
      />

      <a
        v-if="mergeRequestPath && mergeRequestReference"
        :href="mergeRequestPath"
        class="js-link-commit link-commit"
      >
        {{ mergeRequestReference }}
      </a>
    </p>

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