Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/jobs/components/job/sidebar/commit_block.vue')
-rw-r--r--app/assets/javascripts/jobs/components/job/sidebar/commit_block.vue47
1 files changed, 47 insertions, 0 deletions
diff --git a/app/assets/javascripts/jobs/components/job/sidebar/commit_block.vue b/app/assets/javascripts/jobs/components/job/sidebar/commit_block.vue
new file mode 100644
index 00000000000..7f25ca8a94d
--- /dev/null
+++ b/app/assets/javascripts/jobs/components/job/sidebar/commit_block.vue
@@ -0,0 +1,47 @@
+<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>
+ <span class="gl-font-weight-bold">{{ __('Commit') }}</span>
+
+ <gl-link :href="commit.commit_path" class="gl-text-blue-600!" data-testid="commit-sha">
+ {{ commit.short_id }}
+ </gl-link>
+
+ <clipboard-button
+ :text="commit.id"
+ :title="__('Copy commit SHA')"
+ category="tertiary"
+ size="small"
+ />
+
+ <span v-if="mergeRequest">
+ {{ __('in') }}
+ <gl-link :href="mergeRequest.path" class="gl-text-blue-600!" data-testid="link-commit"
+ >!{{ mergeRequest.iid }}</gl-link
+ >
+ </span>
+
+ <p class="gl-mb-0">{{ commit.title }}</p>
+ </div>
+</template>