All files / ee/app/assets/javascripts/compliance_dashboard/components/merge_requests merge_request.vue

100% Statements 5/5
100% Branches 2/2
100% Functions 2/2
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 65 66 67 68 69 70 71  3x 3x   3x                               7x                 30x                                                                                  
<script>
import { GlAvatar, GlAvatarLink } from '@gitlab/ui';
import ComplianceFrameworkLabel from 'ee/vue_shared/components/compliance_framework_label/compliance_framework_label.vue';
 
import { s__ } from '~/locale';
 
export default {
  components: {
    ComplianceFrameworkLabel,
    GlAvatar,
    GlAvatarLink,
  },
  props: {
    mergeRequest: {
      type: Object,
      required: true,
    },
  },
  computed: {
    complianceFramework() {
      return this.mergeRequest.compliance_management_framework;
    },
  },
  strings: {
    createdBy: s__('ComplianceDashboard|created by:'),
  },
};
</script>
 
<template>
  <div
    class="gl-grid-col-start-1 gl-border-b-solid gl-border-b-1 gl-border-b-gray-100 gl-p-5"
    data-testid="merge-request"
  >
    <div>
      <a :href="mergeRequest.path" class="gl-text-gray-900 gl-font-weight-bold">
        {{ mergeRequest.title }}
      </a>
    </div>
    <span class="gl-text-gray-500">{{ mergeRequest.issuable_reference }}</span>
    <span class="issuable-authored gl-text-gray-500 gl-display-inline-flex gl-align-items-center">
      - {{ $options.strings.createdBy }}
      <gl-avatar-link
        :key="mergeRequest.author.id"
        :title="mergeRequest.author.name"
        :href="mergeRequest.author.web_url"
        :data-user-id="mergeRequest.author.id"
        :data-name="mergeRequest.author.name"
        class="gl-display-inline-flex gl-align-items-center gl-ml-3 gl-text-gray-900 author-link js-user-link"
      >
        <gl-avatar
          :src="mergeRequest.author.avatar_url"
          :entity-id="mergeRequest.author.id"
          :entity-name="mergeRequest.author.name"
          :size="16"
          class="gl-mr-2"
        />
        <span>{{ mergeRequest.author.name }}</span>
      </gl-avatar-link>
    </span>
    <div>
      <compliance-framework-label
        v-if="complianceFramework"
        :name="complianceFramework.name"
        :color="complianceFramework.color"
        :description="complianceFramework.description"
      />
    </div>
  </div>
</template>