summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/jobs
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-08-17 07:54:38 +0000
committerPhil Hughes <me@iamphill.com>2018-08-17 07:54:38 +0000
commit7abab12e656b5f40e6431dbcb54c9bc6f066f12d (patch)
tree1cbeb03ecbf7aeec66d5fda5f09fb01959770f6a /app/assets/javascripts/jobs
parent7548cdc3187e7a51a5c010096ef383f274afce39 (diff)
parent8d5c92c558cfb3d3850813c15d6ca5d1c2d11fdd (diff)
downloadgitlab-ce-7abab12e656b5f40e6431dbcb54c9bc6f066f12d.tar.gz
Merge branch '50101-commit-block' into 'master'
Creates Vue component for commit block in job log view See merge request gitlab-org/gitlab-ce!21249
Diffstat (limited to 'app/assets/javascripts/jobs')
-rw-r--r--app/assets/javascripts/jobs/components/commit_block.vue64
1 files changed, 64 insertions, 0 deletions
diff --git a/app/assets/javascripts/jobs/components/commit_block.vue b/app/assets/javascripts/jobs/components/commit_block.vue
new file mode 100644
index 00000000000..7f485295513
--- /dev/null
+++ b/app/assets/javascripts/jobs/components/commit_block.vue
@@ -0,0 +1,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>