All files / src/components PackOrigin.vue

100% Statements 5/5
100% Branches 4/4
50% Functions 1/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    8x                       2x                             3x 3x 3x    
<template>
  <!-- A copy installed from a Store pack says which, linking to it (UC-STORE-016.1) -->
  <div class="small text-muted pack-origin">
    <font-awesome-icon icon="fa-solid fa-store" class="me-1" />
    <router-link
      v-if="fromPack.name !== null"
      :to="flowLink('store', {}, { pack: fromPack.packId })"
      class="pack-origin-link"
      @click.stop
    >
      {{
        t('store.fromPack')
          .replace('{pack}', getTranslation(fromPack.name))
          .replace('{version}', String(fromPack.version))
      }}
    </router-link>
    <span v-else>{{ t('store.fromDeletedPack') }}</span>
  </div>
</template>
 
<script setup lang="ts">
// @implements UC-STORE-016.1
import { useUILanguage } from '@/composables/useUILanguage'
import { useLanguage } from '@/composables/useLanguage'
import type { EntityPackSource } from '@/stores/entities'
import { useFlowLink } from '@/composables/useFlowLink'
 
defineProps<{ fromPack: EntityPackSource }>()
 
const { t } = useUILanguage()
const { getTranslation } = useLanguage()
const { flowLink } = useFlowLink()
</script>