From 224a41a4df9eb2c959057ba66a46a867071c9a39 Mon Sep 17 00:00:00 2001 From: Alejandro MG Date: Tue, 17 Dec 2024 10:03:28 +0100 Subject: [PATCH] Ensures visa cannot happen on an ANSES referal article declaration --- .../src/views/VisaPage/VisaValidationTab.vue | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/frontend/src/views/VisaPage/VisaValidationTab.vue b/frontend/src/views/VisaPage/VisaValidationTab.vue index 7f25860e..ad8cdb92 100644 --- a/frontend/src/views/VisaPage/VisaValidationTab.vue +++ b/frontend/src/views/VisaPage/VisaValidationTab.vue @@ -41,8 +41,14 @@

{{ decision.description }}

-
- + +
+
@@ -57,6 +63,7 @@ import { useFetch } from "@vueuse/core" import { handleError } from "@/utils/error-handling" import useToaster from "@/composables/use-toaster" import VisaInfoLine from "./VisaInfoLine.vue" +import ArticleInfoRow from "@/components/DeclarationSummary/ArticleInfoRow" const $externalResults = ref({}) const emit = defineEmits(["decision-done"]) @@ -91,16 +98,22 @@ const acceptVisa = async () => { emit("decision-done") } } - +const needsAnsesReferal = computed(() => declaration.value?.article === "ANSES_REFERAL") +const shouldBlockApproval = computed( + () => needsAnsesReferal.value && declaration.value.postValidationStatus === "AUTHORIZED" +) const decisionCategories = computed(() => { return [ { title: "Je valide cette décision", icon: "ri-checkbox-circle-fill", iconColor: "green", - description: "Je vise cette déclaration et signe.", + description: shouldBlockApproval.value + ? "La déclaration ne peut pas être autorisée en nécessitant une saisine ANSEES." + : "Je vise cette déclaration et signe.", buttonText: "Valider", buttonHandler: acceptVisa, + blockedByAnses: shouldBlockApproval.value, }, { title: "Je ne suis pas d'accord",