diff --git a/.idea/copilot.data.migration.agent.xml b/.idea/copilot.data.migration.agent.xml new file mode 100644 index 0000000..4ea72a9 --- /dev/null +++ b/.idea/copilot.data.migration.agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.ask.xml b/.idea/copilot.data.migration.ask.xml new file mode 100644 index 0000000..7ef04e2 --- /dev/null +++ b/.idea/copilot.data.migration.ask.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.ask2agent.xml b/.idea/copilot.data.migration.ask2agent.xml new file mode 100644 index 0000000..1f2ea11 --- /dev/null +++ b/.idea/copilot.data.migration.ask2agent.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/copilot.data.migration.edit.xml b/.idea/copilot.data.migration.edit.xml new file mode 100644 index 0000000..8648f94 --- /dev/null +++ b/.idea/copilot.data.migration.edit.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/src/configData.js b/src/configData.js index bf2ff08..f4c5cc6 100644 --- a/src/configData.js +++ b/src/configData.js @@ -269,4 +269,40 @@ export const resendEmailLabelsByType = { APPLICATION_AMENDMENT_REMINDER: 'Invia email (sollecito)', APPLICATION_ADMISSIBLE: 'Invia email (ammisibile)', APPLICATION_REJECTED: 'Invia email (respinto)' +} + +export const rejectionReasons = [ + { + id: 1, + label: 'Documentazione incompleta', + text: 'la stessa è stata sottoposta ad istruttoria di ammissibilità con esito negativo.', + subject: 'Esito negativo istruttoria di ammissibilità' + }, + { + id: 2, + label: 'Altri motivi', + text: 'la stessa è stata esclusa dalla graduatoria definitiva', + subject: 'Esclusione dalla graduatoria definitiva.' + } +]; + +export const amendmentRequestedDocs = { + NESSUNA_GARANZIA: [ + 'Lettera di accettazione firmata' + ], + GARANZIA_MCC: [ + 'Lettera di accettazione firmata', + 'Modulo di domanda della agevolazione (ex allegato 4)' + ], + MCC_START_UP: [ + 'Lettera di accettazione firmata', + 'Modulo di domanda della agevolazione (ex allegato 4)', + 'Modello di valutazione bilanci previsionali', + 'Modello valutazione start up' + ], + ALTRE_GARANZIE: [ + 'Lettera di accettazione firmata', + 'Modello privacy', + 'Autocertificazione e altri eventuali in zip/p7m' + ], } \ No newline at end of file diff --git a/src/helpers/getBandoLabel.js b/src/helpers/getBandoLabel.js index 6c27fdf..f827156 100644 --- a/src/helpers/getBandoLabel.js +++ b/src/helpers/getBandoLabel.js @@ -75,7 +75,7 @@ const getBandoLabel = (status) => { return __('Respinto', 'gepafin'); case 'TECHNICAL_EVALUATION_REJECTED': - return __('Respinto', 'gepafin'); + return __('Respinto Tec-Fin', 'gepafin'); default: return ''; diff --git a/src/helpers/getBandoSeverity.js b/src/helpers/getBandoSeverity.js index 5c54514..3002c37 100644 --- a/src/helpers/getBandoSeverity.js +++ b/src/helpers/getBandoSeverity.js @@ -72,6 +72,9 @@ const getBandoSeverity = (status) => { case 'REJECTED': return 'danger'; + case 'TECHNICAL_EVALUATION_REJECTED': + return 'danger'; + default: return 'info'; } diff --git a/src/pages/DashboardPreInstructor/components/DomandeTablePreInstructorAsync/index.js b/src/pages/DashboardPreInstructor/components/DomandeTablePreInstructorAsync/index.js index 6b12650..ef078c0 100644 --- a/src/pages/DashboardPreInstructor/components/DomandeTablePreInstructorAsync/index.js +++ b/src/pages/DashboardPreInstructor/components/DomandeTablePreInstructorAsync/index.js @@ -31,7 +31,9 @@ import SoccorsoResendEmails from '../../../SoccorsoEditPreInstructor/components/ const APP_HUB_ID = process.env.REACT_APP_HUB_ID; -const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [] }) => { +const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [], + applicationStatuses = ['EVALUATION', 'SOCCORSO', 'NDG', 'APPOINTMENT', 'ADMISSIBLE', + 'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION']}) => { const navigate = useNavigate(); const userData = useStoreValue('userData'); const [localAsyncRequest, setLocalAsyncRequest] = useState(false); @@ -106,14 +108,14 @@ const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [] }) => { }; const statusFilterTemplate = (options) => { - return { options.filterCallback(e.value, options.index) const filters = { ...lazyState.filters }; if (e.value) { - filters['status'] = { value: e.value, matchMode: 'equals' }; + filters['applicationStatus'] = { value: e.value, matchMode: 'equals' }; } else { - delete filters['status']; + delete filters['applicationStatus']; } setLazyState({ ...lazyState, filters, first: 0 }); }} diff --git a/src/pages/DomandaEditInstructorManager/index.js b/src/pages/DomandaEditInstructorManager/index.js index 40247f4..d585376 100644 --- a/src/pages/DomandaEditInstructorManager/index.js +++ b/src/pages/DomandaEditInstructorManager/index.js @@ -48,6 +48,7 @@ import BlockingOverlay from '../../components/BlockingOverlay'; import { classNames } from 'primereact/utils'; import { InputTextarea } from 'primereact/inputtextarea'; import { InputText } from 'primereact/inputtext'; +import { Dropdown } from 'primereact/dropdown'; import ListOfFiles from '../DomandaEditPreInstructor/components/ListOfFiles'; import RepeaterFields from '../DomandaEditPreInstructor/components/RepeaterFields'; import ApplicationInfo from '../DomandaEditPreInstructor/components/ApplicationInfo'; @@ -56,6 +57,9 @@ import FormField from '../../components/FormField'; import SoccorsoResendEmails from '../SoccorsoEditPreInstructor/components/SoccorsoResendEmails'; import EvaluationReAdmit from '../DomandaEditPreInstructor/components/EvaluationReAdmit'; import { SplitButton } from 'primereact/splitbutton'; +import { FileUpload } from 'primereact/fileupload'; +import { defaultMaxFileSize, mimeTypes, rejectionReasons } from '../../configData'; +import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText'; const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID; const APP_HUB_ID = process.env.REACT_APP_HUB_ID; @@ -75,8 +79,10 @@ const DomandaEditInstructorManager = () => { const [loading, setLoading] = useState(false); const [isVisibleCompleteDialog, setIsVisibleCompleteDialog] = useState(false); const [operationType, setOperationType] = useState(''); - const [motivation, setMotivation] = useState(''); - const [amountAccepted, setAmountAccepted] = useState(0); + const [finalDialogData, setFinalDialogData] = useState({ + motivation: '' + }); + const finalDialogFilesRef = useRef(null); const [isVisibleAppointmentDialog, setIsVisibleAppointmentDialog] = useState(false); const [isVisiblePreTecEvalDialog, setIsVisiblePreTecEvalDialog] = useState(false); const [preTecEvalData, setPreTecEvalData] = useState({ @@ -219,7 +225,7 @@ const DomandaEditInstructorManager = () => { const getCallback = (resp) => { if (resp.status === 'SUCCESS') { setData(getFormattedData(resp.data)); - setMotivation(resp.data.motivation); + setFinalDialogData((prev) => ({...prev, motivation: resp.data.motivation})); updateFlagsForSoccorso(resp.data); if (resp.data.evaluationVersion === 'V2') { @@ -372,9 +378,15 @@ const DomandaEditInstructorManager = () => { ...cfgModifier }; + const formDataToSend = new FormData(); + const jsonBlob = new Blob([JSON.stringify(submitData)], { + type: 'application/json' + }); + formDataToSend.append('evaluationRequest', jsonBlob); + ApplicationEvaluationService.updateEvaluation( data.assignedApplicationId, - submitData, + formDataToSend, (data) => updateCallback(data, afterUpdateCallback), errUpdateCallback ); @@ -393,10 +405,16 @@ const DomandaEditInstructorManager = () => { ...cfgModifier } + const formDataToSend = new FormData(); + const jsonBlob = new Blob([JSON.stringify(submitData)], { + type: 'application/json' + }); + formDataToSend.append('applicationEvaluationFormRequestBean', jsonBlob); + ApplicationEvaluationService.updateEvaluationV2( data.assignedApplicationId, formId, - submitData, + formDataToSend, (data) => updateCallback(data, afterUpdateCallback), errUpdateCallback ); @@ -445,15 +463,21 @@ const DomandaEditInstructorManager = () => { checklist: klona(data.checklist), files: klona(data.files), note: data.note, - motivation, - amountAccepted + motivation: finalDialogData.motivation, + amountAccepted: finalDialogData.amount } + const formDataToSend = new FormData(); + const jsonBlob = new Blob([JSON.stringify(submitData)], { + type: 'application/json' + }); + formDataToSend.append('evaluationRequest', jsonBlob); + setLoading(true); setIsVisibleCompleteDialog(false); ApplicationEvaluationService.updateEvaluation( data.assignedApplicationId, - submitData, + formDataToSend, approveRejectCallback, errApproveRejectCallback ); @@ -470,21 +494,27 @@ const DomandaEditInstructorManager = () => { )), amendmentDetails: klona(data.amendmentDetails), note: data.note, - motivation, - amountAccepted + motivation: finalDialogData.motivation, + amountAccepted: finalDialogData.amount } + const formDataToSend = new FormData(); + const jsonBlob = new Blob([JSON.stringify(submitData)], { + type: 'application/json' + }); + formDataToSend.append('applicationEvaluationFormRequestBean', jsonBlob); + setLoading(true); setIsVisibleCompleteDialog(false); ApplicationEvaluationService.updateEvaluationV2( data.assignedApplicationId, formId, - submitData, + formDataToSend, approveRejectCallback, errApproveRejectCallback ); } - }, [data, motivation]); + }, [data, finalDialogData]); const doReject = useCallback((newStatus) => { if (data.evaluationVersion === 'V1') { @@ -494,14 +524,28 @@ const DomandaEditInstructorManager = () => { checklist: klona(data.checklist), files: klona(data.files), note: data.note, - motivation + motivation: finalDialogData.motivation, + rejectedReason: finalDialogData.reason, + rejectedReasonSubject: finalDialogData.subject + } + + const formDataToSend = new FormData(); + const jsonBlob = new Blob([JSON.stringify(submitData)], { + type: 'application/json' + }); + formDataToSend.append('evaluationRequest', jsonBlob); + + if (finalDialogData.files && finalDialogData.files.length > 0) { + finalDialogData.files.forEach((file) => { + formDataToSend.append('rejectedDocuments', file); + }); } setLoading(true); setIsVisibleCompleteDialog(false); ApplicationEvaluationService.updateEvaluation( data.assignedApplicationId, - submitData, + formDataToSend, approveRejectCallback, errApproveRejectCallback ); @@ -518,7 +562,21 @@ const DomandaEditInstructorManager = () => { )), amendmentDetails: klona(data.amendmentDetails), note: data.note, - motivation + motivation: finalDialogData.motivation, + rejectedReason: finalDialogData.reason, + rejectedReasonSubject: finalDialogData.subject + } + + const formDataToSend = new FormData(); + const jsonBlob = new Blob([JSON.stringify(submitData)], { + type: 'application/json' + }); + formDataToSend.append('applicationEvaluationFormRequestBean', jsonBlob); + + if (finalDialogData.files && finalDialogData.files.length > 0) { + finalDialogData.files.forEach((file) => { + formDataToSend.append('rejectedDocuments', file); + }); } setLoading(true); @@ -526,12 +584,12 @@ const DomandaEditInstructorManager = () => { ApplicationEvaluationService.updateEvaluationV2( data.assignedApplicationId, formId, - submitData, + formDataToSend, approveRejectCallback, errApproveRejectCallback ); } - }, [data, motivation]); + }, [data, finalDialogData]); const approveRejectCallback = (data) => { if (data.status === 'SUCCESS') { @@ -653,7 +711,7 @@ const DomandaEditInstructorManager = () => { const hideCompleteDialog = () => { setIsVisibleCompleteDialog(false); setOperationType(''); - setMotivation(''); + setFinalDialogData({}); } const footerCompleteDialog = useCallback(() => { @@ -662,11 +720,12 @@ const DomandaEditInstructorManager = () => { if (operationType === 'approve') { onSubmitAction = doApprove; - isDisabled = isDisabled || !amountAccepted || isEmpty(amountAccepted) || amountAccepted === 0; + isDisabled = isDisabled || !finalDialogData.amount || isEmpty(finalDialogData.amount) || finalDialogData.amount === 0; } else if (operationType === 'tf_reject') { onSubmitAction = () => doReject('TECHNICAL_EVALUATION_REJECTED'); } else { onSubmitAction = () => doReject('REJECTED'); + isDisabled = isDisabled || !finalDialogData.reason || isEmpty(finalDialogData.reason) || !finalDialogData.motivation || isEmpty(finalDialogData.motivation) } return
@@ -676,7 +735,12 @@ const DomandaEditInstructorManager = () => { disabled={isDisabled} label={__('Invia', 'gepafin')} onClick={onSubmitAction}/>
- }, [amountAccepted, data, motivation]); + }, [finalDialogData, data]); + + const updateFinalDialogData = (value, path) => { + const newData = wrap(finalDialogData).set(path.split('.'), value).value(); + setFinalDialogData(newData); + }; const initiateApproving = () => { setOperationType('approve'); @@ -944,8 +1008,8 @@ const DomandaEditInstructorManager = () => { && APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE') ? + + + + + + + + + + + + ); + }; + + const header = renderHeader(); return ( <> - + - - - + + + @@ -163,7 +204,10 @@ const SoccorsoComunications = ({ amendmentId, soccorsoStatus }) => { ) : @@ -175,7 +219,7 @@ const SoccorsoComunications = ({ amendmentId, soccorsoStatus }) => {
{__('Data', 'gepafin')}{__('Comunicazione', 'gepafin')}{__('Data', 'gepafin')}{__('Comunicazione', 'gepafin')}

{o.title}

-

{o.comment}

+ {renderHtmlContent(o.comment)} + {o.documents && !isEmpty(o.documents) + ?
{o.documents.map((doc) => {doc.name})}
+ : null }