From 825879caf5a202f054a9fe50d8d70f1ab2aa7012 Mon Sep 17 00:00:00 2001 From: Alejandro MG Date: Mon, 16 Dec 2024 16:09:46 +0100 Subject: [PATCH 1/2] Ensures declaration does not need ANSES referal before validating it --- .../src/views/InstructionPage/DecisionTab.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/InstructionPage/DecisionTab.vue b/frontend/src/views/InstructionPage/DecisionTab.vue index 29db4c70..79e61802 100644 --- a/frontend/src/views/InstructionPage/DecisionTab.vue +++ b/frontend/src/views/InstructionPage/DecisionTab.vue @@ -72,7 +72,21 @@ v-model="comment" /> - + +
+
+

+ + La déclaration ne peut pas être validée en nécessitant une saisine ANSEES. Merci de changer l'article + avant de la valider. +

+ +
{{ firstErrorMsg(v$, "reasons") }}
@@ -90,6 +104,7 @@ import { useFetch } from "@vueuse/core" import { headers } from "@/utils/data-fetching" import useToaster from "@/composables/use-toaster" import { handleError } from "@/utils/error-handling" +import ArticleInfoRow from "@/components/DeclarationSummary/ArticleInfoRow" const decisionCategory = ref(null) watch(decisionCategory, () => (proposal.value = decisionCategory.value === "approve" ? "autorisation" : null)) @@ -125,6 +140,8 @@ watch(proposal, (newProposal) => { else delayDays.value = 15 }) +const needsAnsesReferal = computed(() => declaration.value?.article === "ANSES_REFERAL") + const decisionCategories = [ { value: "approve", From 224a41a4df9eb2c959057ba66a46a867071c9a39 Mon Sep 17 00:00:00 2001 From: Alejandro MG Date: Tue, 17 Dec 2024 10:03:28 +0100 Subject: [PATCH 2/2] 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",