From c3955ff9a096ccfebed9514f3eecca06f1db093a Mon Sep 17 00:00:00 2001 From: Quentin Bellanger Date: Fri, 12 Jul 2024 16:29:59 +0200 Subject: [PATCH] display transverse criteria in report improvements tab --- .../src/components/report/ReportCriteria.vue | 11 ++-- .../src/components/report/ReportErrors.vue | 20 +++---- .../components/report/ReportImprovements.vue | 25 +++++--- .../src/components/report/getReportErrors.ts | 6 +- .../report/getReportImprovements.ts | 60 +------------------ 5 files changed, 34 insertions(+), 88 deletions(-) diff --git a/confiture-web-app/src/components/report/ReportCriteria.vue b/confiture-web-app/src/components/report/ReportCriteria.vue index cfd88d1e9..822d6d353 100644 --- a/confiture-web-app/src/components/report/ReportCriteria.vue +++ b/confiture-web-app/src/components/report/ReportCriteria.vue @@ -2,16 +2,13 @@ import { useRoute } from "vue-router"; import { pluralize } from "../../utils"; -import type { ReportErrors } from "./getReportErrors"; -import { - ReportImprovement, - ReportTransverseImprovement -} from "./getReportImprovements"; +import type { ReportError } from "./getReportErrors"; +import { ReportImprovement } from "./getReportImprovements"; defineProps<{ count: number; - pagesData: ReportErrors[] | ReportImprovement[]; - transverseData: ReportErrors[] | ReportTransverseImprovement[]; + pagesData: ReportError[] | ReportImprovement[]; + transverseData: ReportError[] | ReportImprovement[]; showFilters?: boolean; }>(); diff --git a/confiture-web-app/src/components/report/ReportErrors.vue b/confiture-web-app/src/components/report/ReportErrors.vue index 1d2af3819..d36fe7d73 100644 --- a/confiture-web-app/src/components/report/ReportErrors.vue +++ b/confiture-web-app/src/components/report/ReportErrors.vue @@ -3,7 +3,7 @@ import { computed, ref } from "vue"; import { useReportStore } from "../../store"; import { CriterionResultUserImpact, CriteriumResultStatus } from "../../types"; -import { getAllReportErrors } from "./getReportErrors"; +import { getReportErrors } from "./getReportErrors"; import ReportCriteria from "./ReportCriteria.vue"; import ReportErrorCriterium from "./ReportErrorCriterium.vue"; @@ -64,11 +64,7 @@ const unknownUserImpactErrorCount = computed( ); const errorsCount = computed(() => { - return getAllReportErrors( - report, - quickWinFilter.value, - userImpactFilters.value - ) + return getReportErrors(report, quickWinFilter.value, userImpactFilters.value) .map((page: any) => page.topics.map((topic: any) => topic.errors)) .flat(2).length; }); @@ -86,10 +82,10 @@ function resetFilters() { v-if="report.data" :count="errorsCount" :pages-data=" - getAllReportErrors(report, quickWinFilter, userImpactFilters).slice(1) + getReportErrors(report, quickWinFilter, userImpactFilters).slice(1) " :transverse-data=" - getAllReportErrors(report, quickWinFilter, userImpactFilters).slice(0, 1) + getReportErrors(report, quickWinFilter, userImpactFilters).slice(0, 1) " :show-filters="true" > @@ -191,8 +187,8 @@ function resetFilters() {