From 578c45b764825406ef93624a26b03fd8ec6f7ef5 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Wed, 22 Jan 2025 16:08:00 +0100 Subject: [PATCH] - added amendment stats; - improved displaying messages during application validation; --- src/pages/BandoApplication/index.js | 35 ++++++--- src/pages/BandoFlowEdit/index.js | 12 +-- .../DomandaEditInstructorManager/index.js | 27 ++++--- src/pages/DomandaEditPreInstructor/index.js | 13 ++-- src/pages/Domande/index.js | 2 +- .../SoccorsoIstruttorioPreInstructor/index.js | 74 ++++++++++++++++++- src/service/dashboard-service.js | 4 + 7 files changed, 128 insertions(+), 39 deletions(-) diff --git a/src/pages/BandoApplication/index.js b/src/pages/BandoApplication/index.js index 0e5846d..f46dcf4 100644 --- a/src/pages/BandoApplication/index.js +++ b/src/pages/BandoApplication/index.js @@ -165,19 +165,32 @@ const BandoApplication = () => { const validateApplicationCallback = (data) => { if (data.status === 'SUCCESS') { if (data.data.status) { - setApplicationStatus(data.data.status); // ask why not 'applicationStatus'? + setApplicationStatus(data.data.status); } } storeSet.main.unsetAsyncRequest(); } const errValidateApplicationCallback = (data) => { - if (toast.current) { - toast.current.show({ - severity: 'error', - summary: '', - detail: data.message - }); + if (data.status === 'VALIDATION_ERROR') { + if (formMsgs.current) { + formMsgs.current.show([ + { + id: '99', + sticky: true, severity: 'error', summary: '', + detail: data.data.join(' '), + closable: true + } + ]); + } + } else { + if (toast.current) { + toast.current.show({ + severity: 'error', + summary: '', + detail: data.message + }); + } } storeSet.main.unsetAsyncRequest(); } @@ -260,7 +273,7 @@ const BandoApplication = () => { { id: '99', sticky: true, severity: 'error', summary: '', - detail: data.data.join(', '), + detail: data.data.join(' '), closable: true } ]); @@ -420,7 +433,9 @@ const BandoApplication = () => { icon="pi pi-arrow-right" iconPos="right"/> : null}