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

FIX Ajout de l'affichage du message d'erreur sur les pages de simu + … #113

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/components/NavigateNotice.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!--Conteneur bouton 1-->
<v-row class="d-flex justify-center">
<v-btn
class="mt-3"
:disabled="nbNotice.nbNoticeEnCours === 0"
large
dark
Expand All @@ -17,6 +18,7 @@
<!--Conteneur bouton 2-->
<v-row class="d-flex justify-center">
<v-btn
class="mt-3"
:disabled="nbNotice.nbNoticeEnCours === 0"
large
dark
Expand All @@ -31,6 +33,7 @@
<!--Conteneur bouton 3-->
<v-row class="d-flex justify-center">
<v-btn
class="mt-3"
:disabled="nbNotice.nbNoticeEnCours === nbNotice.nbTotalNotice - 1"
large
dark
Expand All @@ -45,6 +48,7 @@
<!--Conteneur bouton 4-->
<v-row class="d-flex justify-center">
<v-btn
class="mt-3"
:disabled="nbNotice.nbNoticeEnCours === nbNotice.nbTotalNotice - 1"
large
dark
Expand Down
15 changes: 12 additions & 3 deletions src/components/Simulation.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<template>
<recap-demande :demande="demande"></recap-demande>

<v-overlay v-model="isLoading" class="justify-center align-center">
<v-progress-circular
color="blue-lighten-3"
Expand All @@ -9,14 +7,17 @@
:width="12"
></v-progress-circular>
</v-overlay>

<recap-demande :demande="demande"></recap-demande>
<!-- CONTENU SIMULATION -->
<v-alert icon="mdi-alert" type="error" v-if="alertMessageError" class="my-3" border="left">Simulation impossible : {{ alertMessageError }}</v-alert>
<v-card flat class="pb-2">
<v-card-title style="background-color: #295494; color: white" class="d-flex justify-space-between">
<span>Ecran de simulation</span>
<v-btn depressed variant="text" @click="deleted()" prepend-icon="mdi-delete">Supprimer</v-btn>
</v-card-title>
<!--TEMPLATE DE SIMULATION-->
<v-alert type="warning" align="center" class="my-3 pa-2" dense prominent border="left">
<v-alert type="warning" class="my-3 pa-2" dense prominent border="left">
Cet écran est une <strong>prévisualisation</strong> du traitement.<br>
Il s'agit de la <strong>dernière étape</strong> avant de lancer le traitement en <strong>base de
production</strong>. Merci de <strong>vérifier vos données</strong>.
Expand Down Expand Up @@ -78,6 +79,7 @@ const numeroPPNNotice = ref();
const noticeAvant = ref("");
const noticeApres = ref("");
const isLoading = ref(true);
const alertMessageError = ref();

onMounted(() => {
demandesService.getNbLigneFichier(props.demande.id, props.demande.type)
Expand All @@ -90,19 +92,26 @@ onMounted(() => {
noticeAvant.value = response.data[1];
noticeApres.value = response.data[2];
})
.catch(err => {
alertMessageError.value = err.response.data.message
})
.finally(() => {
isLoading.value = false;
});
});

function refresh() {
isLoading.value = true;
alertMessageError.value = null;
demandesService.simulerLigne(props.demande.id, nbNotice.value.nbNoticeEnCours, props.demande.type)
.then(response => {
numeroPPNNotice.value = response.data[0];
noticeAvant.value = response.data[1];
noticeApres.value = response.data[2];
})
.catch(err => {
alertMessageError.value = err.response.data.message
})
.finally(() => {
isLoading.value = false;
});
Expand Down
Loading