Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Affiche seulement les pages avec des améliorations dans le rapport #831

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions confiture-web-app/src/components/report/ReportImprovements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const transverseImprovements = computed(() => {
});

const pagesImprovements = computed(() => {
return getReportImprovements(report).slice(1);
return getReportImprovements(report)
.slice(1)
.filter((p) => p.topics.length > 0);
});

const improvementsCount = computed(() => {
Expand All @@ -32,7 +34,7 @@ const improvementsCount = computed(() => {
:transverse-data="transverseImprovements"
>
<template #transverse-data>
<section class="fr-mb-8w">
<section v-if="transverseImprovements.topics.length > 0" class="fr-mb-8w">
<h2 id="elements-transverses" class="fr-h3 fr-mb-2w page-title">
Éléments transverses
</h2>
Expand Down Expand Up @@ -77,10 +79,6 @@ const improvementsCount = computed(() => {
{{ page.url }} <span class="fr-sr-only">(nouvelle fenêtre)</span>
</a>

<p v-if="page.topics.length === 0" class="fr-mt-4w">
Aucun point d’amélioration relevé sur cette page.
</p>

<div
v-for="(topic, i) in page.topics"
:key="topic.number"
Expand Down
Loading