All files / apps/developer-portal/layers/health/app/pages issues.vue

100% Statements 15/15
90% Branches 9/10
100% Functions 8/8
100% Lines 13/13

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  6x               8x   8x   1x       1x 1x                                   1x         1x                           2x   10x   8x           1x   6x    
<template>
    <UDashboardPanel id="issues">
        <template #header>
            <PageHeader :title="$t('issues.title')">
                <template #actions>
                    <HealthIssuesRead
                        :fetched-at="issues.fetchedAt"
                        :reloading
                        @refresh="refresh"
                    />
                </template>
            </PageHeader>
 
            <HealthIssuesToolbar v-model:search="search" v-model:label="label" :issues="all" />
        </template>
 
        <template #body>
            <div class="flex flex-col gap-4">
                <p class="max-w-3xl text-sm text-muted">{{ $t("issues.intro") }}</p>
 
                <UAlert
                    v-if="issues.error"
                    color="warning"
                    variant="subtle"
                    icon="i-lucide-plug-zap"
                    :title="$t('issues.error.title')"
                    :description="$t('issues.error.description', { error: issues.error })"
                />
 
                <ListCard
                    :title="$t('issues.list.title')"
                    :note="$t('issues.list.note')"
                    :shown="visible.length"
                    :total="all.length"
                >
                    <template #empty>
                        <div class="p-12 text-center">
                            <UIcon
                                name="i-lucide-circle-dot"
                                class="mx-auto mb-2 size-8 text-dimmed"
                            />
                            <p class="text-sm text-muted">
                                {{ all.length === 0 ? $t("issues.empty") : $t("issues.noMatch") }}
                            </p>
                            <I18nT
                                v-if="all.length === 0 && !issues.error"
                                keypath="issues.file"
                                tag="p"
                                scope="global"
                                class="mt-1 text-xs text-dimmed"
                            >
                                <template #command>
                                    <code class="font-mono">{{ ADD }}</code>
                                </template>
                            </I18nT>
                        </div>
                    </template>
                    <HealthIssueRow v-for="issue in visible" :key="issue.number" :issue />
                </ListCard>
            </div>
        </template>
    </UDashboardPanel>
</template>
 
<script setup lang="ts">
const ADD = "pnpm issue:add";
 
const { issues, label, search, all, visible, reloading, refresh } = useIssueList();
</script>