All files / app/assets/javascripts/packages_and_registries/package_registry/components/details/metadata nuget.vue

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

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 593x                                                                                                                    
<!-- eslint-disable vue/multi-word-component-names -->
<script>
import { GlLink, GlSprintf } from '@gitlab/ui';
import { s__ } from '~/locale';
import DetailsRow from '~/vue_shared/components/registry/details_row.vue';
 
export default {
  i18n: {
    sourceText: s__('PackageRegistry|Source project located at %{link}'),
    licenseText: s__('PackageRegistry|License information located at %{link}'),
  },
  components: {
    DetailsRow,
    GlLink,
    GlSprintf,
  },
  props: {
    packageMetadata: {
      type: Object,
      required: true,
    },
  },
};
</script>
 
<template>
  <div>
    <details-row
      v-if="packageMetadata.projectUrl"
      icon="project"
      padding="gl-p-4"
      dashed
      data-testid="nuget-source"
    >
      <gl-sprintf :message="$options.i18n.sourceText">
        <template #link>
          <gl-link :href="packageMetadata.projectUrl" target="_blank">{{
            packageMetadata.projectUrl
          }}</gl-link>
        </template>
      </gl-sprintf>
    </details-row>
    <details-row
      v-if="packageMetadata.licenseUrl"
      icon="license"
      padding="gl-p-4"
      data-testid="nuget-license"
    >
      <gl-sprintf :message="$options.i18n.licenseText">
        <template #link>
          <gl-link :href="packageMetadata.licenseUrl" target="_blank">{{
            packageMetadata.licenseUrl
          }}</gl-link>
        </template>
      </gl-sprintf>
    </details-row>
  </div>
</template>