All files / apps/developer-portal/layers/projects/app/components/project DepsTab.vue

100% Statements 12/12
100% Branches 3/3
100% Functions 3/3
100% Lines 12/12

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  3x             3x       3x 3x     3x       2x 3x           3x 3x 3x       3x 1x                              
<template>
    <WidgetPanel
        :title="$t('projectDepsTab.title')"
        :meta="$t('projectDepsTab.meta', { age })"
        to="/deps"
        :count="outdated.length"
    >
        <div v-if="outdated.length > 0" data-scroll-x class="overflow-x-auto">
            <table class="data-table">
                <thead>
                    <tr>
                        <th>{{ $t("projectDepsTab.columns.package") }}</th>
                        <th class="numeric">{{ $t("projectDepsTab.columns.current") }}</th>
                        <th class="numeric hidden sm:table-cell">
                            {{ $t("projectDepsTab.columns.wanted") }}
                        </th>
                        <th class="numeric">{{ $t("projectDepsTab.columns.latest") }}</th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="item in outdated" :key="item.name">
                        <td class="font-mono">
                            {{ item.name }}
                            <span v-if="item.isDeprecated" class="tone-bad">
                                {{ $t("projectDepsTab.deprecated") }}
                            </span>
                        </td>
                        <td class="numeric font-mono">{{ item.current }}</td>
                        <td class="numeric hidden font-mono sm:table-cell">{{ item.wanted }}</td>
                        <td class="numeric font-mono text-highlighted">{{ item.latest }}</td>
                    </tr>
                </tbody>
            </table>
        </div>
        <EmptyState v-else>{{ $t("projectDepsTab.current") }}</EmptyState>
    </WidgetPanel>
</template>
 
<script setup lang="ts">
import type { OutdatedPackage } from "#layers/snapshot/shared/types/OutdatedPackage.ts";
 
interface Props {
    outdated: OutdatedPackage[];
    /** When the dependencies were collected, as relative time. */
    age: string;
}
 
const { outdated, age } = defineProps<Props>();
</script>