From c1292d3b4073a0cb5169280c4ede3807e41ae723 Mon Sep 17 00:00:00 2001 From: Quentin Bellanger Date: Fri, 29 Sep 2023 11:09:22 +0200 Subject: [PATCH] Nettoyage de TODO (#482) * use formatted status everywhere * remove old todos or convert them to fixme --- .../AuditGeneralInformationsForm.vue | 1 - .../components/AuditGenerationCriterium.vue | 6 +- .../src/components/ChartLegend.vue | 11 +- confiture-web-app/src/components/PieChart.vue | 9 +- confiture-web-app/src/components/Radio.vue | 1 - .../src/components/ReportA11yStatement.vue | 1 - .../src/components/StackBarChart.vue | 9 +- .../TestEnvironmentSelection.vue | 2 +- .../TestEnvironmentSelection/combinations.ts | 2 +- .../pages/edit/EditAuditDeclarationPage.vue | 1 - .../src/pages/edit/EditAuditStepFourPage.vue | 1 - .../src/pages/error/ErrorPage.vue | 1 - .../src/pages/misc/PrivacyPage.vue | 172 ++++++++++++------ confiture-web-app/src/types/report.ts | 3 - confiture-web-app/src/utils.ts | 1 - 15 files changed, 144 insertions(+), 77 deletions(-) diff --git a/confiture-web-app/src/components/AuditGeneralInformationsForm.vue b/confiture-web-app/src/components/AuditGeneralInformationsForm.vue index 85ab256a6..44ac05c7b 100644 --- a/confiture-web-app/src/components/AuditGeneralInformationsForm.vue +++ b/confiture-web-app/src/components/AuditGeneralInformationsForm.vue @@ -85,7 +85,6 @@ async function deletePage(i: number) { } /** - * TODO: remove this * Dev function to avoid filling all fields manually */ function fillFields() { diff --git a/confiture-web-app/src/components/AuditGenerationCriterium.vue b/confiture-web-app/src/components/AuditGenerationCriterium.vue index 05a37e61e..3e0467de6 100644 --- a/confiture-web-app/src/components/AuditGenerationCriterium.vue +++ b/confiture-web-app/src/components/AuditGenerationCriterium.vue @@ -38,17 +38,17 @@ const statuses: Array<{ color?: RadioColor; }> = [ { - label: "Conforme", + label: formatStatus(CriteriumResultStatus.COMPLIANT), value: CriteriumResultStatus.COMPLIANT, color: "green", }, { - label: "Non conforme", + label: formatStatus(CriteriumResultStatus.NOT_COMPLIANT), value: CriteriumResultStatus.NOT_COMPLIANT, color: "red", }, { - label: "Non applicable", + label: formatStatus(CriteriumResultStatus.NOT_APPLICABLE), value: CriteriumResultStatus.NOT_APPLICABLE, color: "grey", }, diff --git a/confiture-web-app/src/components/ChartLegend.vue b/confiture-web-app/src/components/ChartLegend.vue index cf88f6f3d..a0d22d89b 100644 --- a/confiture-web-app/src/components/ChartLegend.vue +++ b/confiture-web-app/src/components/ChartLegend.vue @@ -1,18 +1,23 @@ + + diff --git a/confiture-web-app/src/components/PieChart.vue b/confiture-web-app/src/components/PieChart.vue index f80667b71..b2aa25f2d 100644 --- a/confiture-web-app/src/components/PieChart.vue +++ b/confiture-web-app/src/components/PieChart.vue @@ -8,7 +8,8 @@ ChartJS.register(PieController, ArcElement); import { Chart, ChartConfiguration } from "chart.js"; import { onMounted, onUnmounted, ref } from "vue"; -import { getCssVarValue } from "../utils"; +import { getCssVarValue, formatStatus } from "../utils"; +import { CriteriumResultStatus } from "../types"; import { useChartColorsUpdate } from "../composables/useChartColorsUpdate"; const props = defineProps<{ @@ -20,7 +21,11 @@ const props = defineProps<{ const chartConfig: ChartConfiguration<"pie", number[], string> = { type: "pie", data: { - labels: ["Conforme", "Non conforme", "Non applicable"], + labels: [ + formatStatus(CriteriumResultStatus.COMPLIANT), + formatStatus(CriteriumResultStatus.NOT_COMPLIANT), + formatStatus(CriteriumResultStatus.NOT_APPLICABLE), + ], datasets: [ { data: [props.compliant, props.notCompliant, props.notApplicable], diff --git a/confiture-web-app/src/components/Radio.vue b/confiture-web-app/src/components/Radio.vue index 13a28f2eb..cbca89601 100644 --- a/confiture-web-app/src/components/Radio.vue +++ b/confiture-web-app/src/components/Radio.vue @@ -3,7 +3,6 @@ export type RadioColor = "red" | "green" | "yellow" | "grey";