From 05281927ad576c0ffb130f21cbc0b637a138ff64 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Thu, 9 Oct 2025 15:21:48 +0200 Subject: [PATCH 1/6] - added files field to evaluation rejection, ammendment creation and ammendment communication modal windows; - fixed issue with filtering applications in dashboard for pre instructor; --- .idea/copilot.data.migration.agent.xml | 6 + .idea/copilot.data.migration.ask.xml | 6 + .idea/copilot.data.migration.ask2agent.xml | 6 + .idea/copilot.data.migration.edit.xml | 6 + .../DomandeTablePreInstructorAsync/index.js | 8 +- .../DomandaEditInstructorManager/index.js | 122 ++++++++++++++---- src/pages/DomandaEditPreInstructor/index.js | 122 ++++++++++++++---- .../SoccorsoAddInstructorManager/index.js | 67 +++++++++- src/pages/SoccorsoAddPreInstructor/index.js | 63 ++++++++- .../components/SoccorsoComunications/index.js | 116 +++++++++++++---- 10 files changed, 443 insertions(+), 79 deletions(-) create mode 100644 .idea/copilot.data.migration.agent.xml create mode 100644 .idea/copilot.data.migration.ask.xml create mode 100644 .idea/copilot.data.migration.ask2agent.xml create mode 100644 .idea/copilot.data.migration.edit.xml 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/pages/DashboardPreInstructor/components/DomandeTablePreInstructorAsync/index.js b/src/pages/DashboardPreInstructor/components/DomandeTablePreInstructorAsync/index.js index 6b12650..60dd450 100644 --- a/src/pages/DashboardPreInstructor/components/DomandeTablePreInstructorAsync/index.js +++ b/src/pages/DashboardPreInstructor/components/DomandeTablePreInstructorAsync/index.js @@ -54,6 +54,8 @@ const DomandeTablePreInstructorAsync = ({ userId = null, statuses = [] }) => { assignedUserName: { value: null, matchMode: 'equals' } } }); + const applicationStatuses = ['EVALUATION', 'SOCCORSO', 'NDG', 'APPOINTMENT', 'ADMISSIBLE', + 'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION']; const getPaginationQuery = useCallback(() => getQueryParamsForPaginatedEndpoint(lazyState, statuses, 'applicationId'), [lazyState]); @@ -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..015156d 100644 --- a/src/pages/DomandaEditInstructorManager/index.js +++ b/src/pages/DomandaEditInstructorManager/index.js @@ -56,6 +56,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 } 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 +78,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 +224,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') { @@ -445,8 +450,8 @@ const DomandaEditInstructorManager = () => { checklist: klona(data.checklist), files: klona(data.files), note: data.note, - motivation, - amountAccepted + motivation: finalDialogData.motivation, + amountAccepted: finalDialogData.amount } setLoading(true); @@ -470,8 +475,8 @@ const DomandaEditInstructorManager = () => { )), amendmentDetails: klona(data.amendmentDetails), note: data.note, - motivation, - amountAccepted + motivation: finalDialogData.motivation, + amountAccepted: finalDialogData.amount } setLoading(true); @@ -484,7 +489,7 @@ const DomandaEditInstructorManager = () => { errApproveRejectCallback ); } - }, [data, motivation]); + }, [data, finalDialogData]); const doReject = useCallback((newStatus) => { if (data.evaluationVersion === 'V1') { @@ -494,7 +499,7 @@ const DomandaEditInstructorManager = () => { checklist: klona(data.checklist), files: klona(data.files), note: data.note, - motivation + motivation: finalDialogData.motivation } setLoading(true); @@ -518,7 +523,7 @@ const DomandaEditInstructorManager = () => { )), amendmentDetails: klona(data.amendmentDetails), note: data.note, - motivation + motivation: finalDialogData.motivation } setLoading(true); @@ -531,7 +536,7 @@ const DomandaEditInstructorManager = () => { errApproveRejectCallback ); } - }, [data, motivation]); + }, [data, finalDialogData]); const approveRejectCallback = (data) => { if (data.status === 'SUCCESS') { @@ -653,7 +658,7 @@ const DomandaEditInstructorManager = () => { const hideCompleteDialog = () => { setIsVisibleCompleteDialog(false); setOperationType(''); - setMotivation(''); + setFinalDialogData({}); } const footerCompleteDialog = useCallback(() => { @@ -662,11 +667,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.subject || isEmpty(finalDialogData.subject) || !finalDialogData.motivation || isEmpty(finalDialogData.motivation) } return
@@ -676,7 +682,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'); @@ -945,7 +956,7 @@ const DomandaEditInstructorManager = () => { ? + + + + + + + + + + + + ); + }; + + const header = renderHeader(); + return ( <> @@ -196,7 +216,7 @@ const SoccorsoComunications = ({amendmentId, soccorsoStatus}) => { onHide={hideNewComDialog}>
{ onChange={(e) => updateNewCommData(e.target.value, 'title')}/> - updateNewCommData(e.target.value, 'comment')}/> + placeholder={__('Digita qui il messagio', 'gepafin')} + readOnly={soccorsoStatus === 'CLOSE'} + headerTemplate={header} + onTextChange={(e) => updateNewCommData(e.htmlValue, 'comment')} + style={{ height: 80 * 3, width: '100%' }} + /> {!['ROLE_CONFIDI', 'ROLE_BENEFICIARY'].includes(role) ?
: null} + {data.id && data.amendmentInitialDocument && is(Array, data.amendmentInitialDocument) + ?
+

{__('Documenti da PEC', 'gepafin')}

+
    + {data.amendmentInitialDocument.map((o, i) =>
  1. + {o.name} +
  2. )} +
+
: null} + {data.id ?

{__('Documenti richiesti', 'gepafin')}

diff --git a/src/pages/SoccorsoEditInstructorManager/index.js b/src/pages/SoccorsoEditInstructorManager/index.js index 3345ecd..ec998e2 100644 --- a/src/pages/SoccorsoEditInstructorManager/index.js +++ b/src/pages/SoccorsoEditInstructorManager/index.js @@ -422,6 +422,17 @@ const SoccorsoEditInstructorManager = () => {
{getEmailTemplateForSoccorso(data.emailTemplate, data.note)}
+ + {data.amendmentInitialDocument && is(Array, data.amendmentInitialDocument) + ?
+

{__('Documenti da PEC', 'gepafin')}

+
    + {data.amendmentInitialDocument.map((o, i) =>
  1. + {o.name} +
  2. )} +
+
: null} +

{__('Documenti richiesti', 'gepafin')}

    diff --git a/src/pages/SoccorsoEditPreInstructor/components/SoccorsoComunications/index.js b/src/pages/SoccorsoEditPreInstructor/components/SoccorsoComunications/index.js index 308a5e4..e1c8bd4 100644 --- a/src/pages/SoccorsoEditPreInstructor/components/SoccorsoComunications/index.js +++ b/src/pages/SoccorsoEditPreInstructor/components/SoccorsoComunications/index.js @@ -24,6 +24,7 @@ import { Toast } from 'primereact/toast'; import { FileUpload } from 'primereact/fileupload'; import { defaultMaxFileSize, mimeTypes } from '../../../../configData'; import { Editor } from 'primereact/editor'; +import renderHtmlContent from '../../../../helpers/renderHtmlContent'; const SoccorsoComunications = ({amendmentId, soccorsoStatus}) => { const [comms, setComms] = useState([]); @@ -104,7 +105,22 @@ const SoccorsoComunications = ({amendmentId, soccorsoStatus}) => { const createCommunication = () => { setIsLoadingCommunication(true); - CommunicationService.createCommunication(amendmentId, newCommData, createCommunicationCallback, errCreateCommunicationCallback); + const updatedFormData = { ...newCommData }; + delete updatedFormData.files; + const formDataToSend = new FormData(); + + const jsonBlob = new Blob([JSON.stringify(updatedFormData)], { + type: 'application/json' + }); + formDataToSend.append('communicationRequestBean', jsonBlob); + + if (newCommData.files && newCommData.files.length > 0) { + newCommData.files.forEach((file) => { + formDataToSend.append('files', file); + }); + } + + CommunicationService.createCommunication(amendmentId, formDataToSend, createCommunicationCallback, errCreateCommunicationCallback); }; const createCommunicationCallback = (data) => { @@ -188,7 +204,10 @@ const SoccorsoComunications = ({amendmentId, soccorsoStatus}) => {

    {o.title}

    -

    {o.comment}

    + {renderHtmlContent(o.comment)} + {o.documents && !isEmpty(o.documents) + ?
    {o.documents.map((doc) => {doc.name})}
    + : null } ) : diff --git a/src/pages/SoccorsoEditPreInstructor/index.js b/src/pages/SoccorsoEditPreInstructor/index.js index 303b874..465d2e7 100644 --- a/src/pages/SoccorsoEditPreInstructor/index.js +++ b/src/pages/SoccorsoEditPreInstructor/index.js @@ -422,6 +422,17 @@ const SoccorsoEditPreInstructor = () => {
    {getEmailTemplateForSoccorso(data.emailTemplate, data.note)}
+ + {data.amendmentInitialDocument && is(Array, data.amendmentInitialDocument) + ?
+

{__('Documenti da PEC', 'gepafin')}

+
    + {data.amendmentInitialDocument.map((o, i) =>
  1. + {o.name} +
  2. )} +
+
: null} +

{__('Documenti richiesti', 'gepafin')}

    diff --git a/src/service/amendments-service.js b/src/service/amendments-service.js index 13a5a4d..0c35bbd 100644 --- a/src/service/amendments-service.js +++ b/src/service/amendments-service.js @@ -25,7 +25,7 @@ export default class AmendmentsService { }; static createSoccorso = (body, callback, errCallback, queryParams) => { - NetworkService.post(`${API_BASE_URL}/amendments`, body, callback, errCallback, queryParams); + NetworkService.postMultiPart(`${API_BASE_URL}/amendments`, body, callback, errCallback, queryParams); }; static updateSoccorso = (id, body, callback, errCallback, queryParams) => { diff --git a/src/service/communication-service.js b/src/service/communication-service.js index 2b39271..8080ed3 100644 --- a/src/service/communication-service.js +++ b/src/service/communication-service.js @@ -9,6 +9,6 @@ export default class CommunicationService { }; static createCommunication = (id, body, callback, errCallback, queryParams) => { - NetworkService.post(`${API_BASE_URL}/communication/${id}`, body, callback, errCallback, queryParams); + NetworkService.postMultiPart(`${API_BASE_URL}/communication/${id}`, body, callback, errCallback, queryParams); }; } From 8c8737e2eea74fd6439046ac83fbf4835e191d88 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Thu, 16 Oct 2025 15:22:50 +0200 Subject: [PATCH 4/6] - updated implementation related to new rejection flow; --- src/configData.js | 26 +++++ .../DomandaEditInstructorManager/index.js | 100 +++++++++++++++--- src/pages/DomandaEditPreInstructor/index.js | 100 +++++++++++++++--- .../SoccorsoEditInstructorManager/index.js | 23 ++-- .../components/SoccorsoComunications/index.js | 2 +- src/pages/SoccorsoEditPreInstructor/index.js | 23 ++-- src/service/application-evaluation-service.js | 4 +- src/service/network-service.js | 44 +++++++- 8 files changed, 274 insertions(+), 48 deletions(-) diff --git a/src/configData.js b/src/configData.js index bf2ff08..8197a94 100644 --- a/src/configData.js +++ b/src/configData.js @@ -269,4 +269,30 @@ export const resendEmailLabelsByType = { APPLICATION_AMENDMENT_REMINDER: 'Invia email (sollecito)', APPLICATION_ADMISSIBLE: 'Invia email (ammisibile)', APPLICATION_REJECTED: 'Invia email (respinto)' +} + +export const rejectionReasons = [ + { label: 'Documentazione incompleta', text: 'la stessa è stata sottoposta ad istruttoria di ammissibilità con esito negativo.' }, + { label: 'Altri motivi', text: 'altri motivi' } +] + +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/pages/DomandaEditInstructorManager/index.js b/src/pages/DomandaEditInstructorManager/index.js index 015156d..4522fa8 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'; @@ -57,7 +58,7 @@ import SoccorsoResendEmails from '../SoccorsoEditPreInstructor/components/Soccor import EvaluationReAdmit from '../DomandaEditPreInstructor/components/EvaluationReAdmit'; import { SplitButton } from 'primereact/splitbutton'; import { FileUpload } from 'primereact/fileupload'; -import { defaultMaxFileSize, mimeTypes } from '../../configData'; +import { defaultMaxFileSize, mimeTypes, rejectionReasons } from '../../configData'; import getFormatedFileSizeText from '../../helpers/getFormatedFileSizeText'; const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID; @@ -377,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 ); @@ -398,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 ); @@ -454,11 +467,17 @@ const DomandaEditInstructorManager = () => { 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 ); @@ -479,12 +498,18 @@ const DomandaEditInstructorManager = () => { 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 ); @@ -499,14 +524,27 @@ const DomandaEditInstructorManager = () => { checklist: klona(data.checklist), files: klona(data.files), note: data.note, - motivation: finalDialogData.motivation + motivation: finalDialogData.motivation, + rejectedReason: 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 ); @@ -523,7 +561,20 @@ const DomandaEditInstructorManager = () => { )), amendmentDetails: klona(data.amendmentDetails), note: data.note, - motivation: finalDialogData.motivation + motivation: finalDialogData.motivation, + rejectedReason: 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); @@ -531,7 +582,7 @@ const DomandaEditInstructorManager = () => { ApplicationEvaluationService.updateEvaluationV2( data.assignedApplicationId, formId, - submitData, + formDataToSend, approveRejectCallback, errApproveRejectCallback ); @@ -956,7 +1007,7 @@ const DomandaEditInstructorManager = () => { ?
: null} - {operationType === 'reject' + {operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE' ?
+ updateFinalDialogData(e.value.text, 'subject')} + style={{ marginBottom: '10px' }} + /> updateFinalDialogData(e.target.value, 'subject')}/> @@ -1550,7 +1622,7 @@ const DomandaEditInstructorManager = () => { />
- {operationType === 'reject' + {operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE' ?
: null} - {operationType === 'reject' + {operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE' ?
+ updateFinalDialogData(e.value.text, 'subject')} + style={{ marginBottom: '10px' }} + /> updateFinalDialogData(e.target.value, 'subject')}/> @@ -1550,7 +1622,7 @@ const DomandaEditPreInstructor = () => { />
- {operationType === 'reject' + {operationType === 'reject' && APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE' ?
: null} -
-

{__('Documenti richiesti', 'gepafin')}

-
    - {data.formFields - ? data.formFields.map((o, i) =>
  1. + {(data.formFields && !isEmpty(data.formFields)) || (data.amendmentType === 'SPECIAL' && !isNil(data.amendmentDocumentType) + && amendmentRequestedDocs[data.amendmentDocumentType]) + ?
    +

    {__('Documenti richiesti', 'gepafin')}

    +
      + {data.formFields && !isEmpty(data.formFields) + ? data.formFields.map((o, i) =>
    1. {o.label}
    2. ) : null} -
    -
    + {amendmentRequestedDocs[data.amendmentDocumentType].map((v) =>
  2. + {v} +
  3. )} +
+
: null}

{__('Comunicazioni', 'gepafin')}

diff --git a/src/pages/SoccorsoEditPreInstructor/components/SoccorsoComunications/index.js b/src/pages/SoccorsoEditPreInstructor/components/SoccorsoComunications/index.js index e1c8bd4..b861044 100644 --- a/src/pages/SoccorsoEditPreInstructor/components/SoccorsoComunications/index.js +++ b/src/pages/SoccorsoEditPreInstructor/components/SoccorsoComunications/index.js @@ -44,7 +44,7 @@ const SoccorsoComunications = ({amendmentId, soccorsoStatus}) => { const getCommsCallback = (data) => { if (data.status === 'SUCCESS') { - setComms(data.data.commentsList.map(o => getFormattedCommsData(o))); + setComms(data.data.map(o => getFormattedCommsData(o))); } setIsLoadingCommunication(false); }; diff --git a/src/pages/SoccorsoEditPreInstructor/index.js b/src/pages/SoccorsoEditPreInstructor/index.js index 465d2e7..a705249 100644 --- a/src/pages/SoccorsoEditPreInstructor/index.js +++ b/src/pages/SoccorsoEditPreInstructor/index.js @@ -30,6 +30,7 @@ import { InputNumber } from 'primereact/inputnumber'; import SoccorsoComunications from './components/SoccorsoComunications'; import SoccorsoResendEmails from './components/SoccorsoResendEmails'; +import { amendmentRequestedDocs } from '../../configData'; const SoccorsoEditPreInstructor = () => { const isAsyncRequest = useStoreValue('isAsyncRequest'); @@ -433,16 +434,22 @@ const SoccorsoEditPreInstructor = () => {
: null} -
-

{__('Documenti richiesti', 'gepafin')}

-
    - {data.formFields - ? data.formFields.map((o, i) =>
  1. + {(data.formFields && !isEmpty(data.formFields)) || (data.amendmentType === 'SPECIAL' && !isNil(data.amendmentDocumentType) + && amendmentRequestedDocs[data.amendmentDocumentType]) + ?
    +

    {__('Documenti richiesti', 'gepafin')}

    +
      + {data.formFields && !isEmpty(data.formFields) + ? data.formFields.map((o, i) =>
    1. {o.label}
    2. ) : null} -
    -
    + {amendmentRequestedDocs[data.amendmentDocumentType].map((v) =>
  2. + {v} +
  3. )} +
+
: null}

{__('Comunicazioni', 'gepafin')}

diff --git a/src/service/application-evaluation-service.js b/src/service/application-evaluation-service.js index ee8dedc..91add58 100644 --- a/src/service/application-evaluation-service.js +++ b/src/service/application-evaluation-service.js @@ -17,11 +17,11 @@ export default class ApplicationEvaluationService { }; static updateEvaluation = (assignedApplicationId, body, callback, errCallback, queryParams) => { - NetworkService.put(`${API_BASE_URL}/applicationEvaluation/${assignedApplicationId}`, body, callback, errCallback, queryParams); + NetworkService.putMultiPart(`${API_BASE_URL}/applicationEvaluation/${assignedApplicationId}`, body, callback, errCallback, queryParams); }; static updateEvaluationV2 = (assignedApplicationId, formId, body, callback, errCallback, queryParams = []) => { - NetworkService.put(`${API_BASE_URL}/applicationEvaluation/v2/assignedApplication/${assignedApplicationId}`, body, callback, errCallback, [ + NetworkService.putMultiPart(`${API_BASE_URL}/applicationEvaluation/v2/assignedApplication/${assignedApplicationId}`, body, callback, errCallback, [ ['evaluationFormId', formId] ]); }; diff --git a/src/service/network-service.js b/src/service/network-service.js index 542f386..e7f049c 100644 --- a/src/service/network-service.js +++ b/src/service/network-service.js @@ -84,7 +84,6 @@ export class NetworkService { method: 'POST', mode: 'cors', headers: { - //'Content-Type': 'multipart/form-data', 'Authorization': 'Bearer ' + storeGet('getToken'), }, body: body @@ -235,6 +234,49 @@ export class NetworkService { .catch(err => errorCallback(err)); }; + static putMultiPart = (url, body, callback, errorCallback, queryParams = null) => { + if (queryParams) { + url += '?' + + for (let i = 0; i < queryParams.length; i++) { + if (queryParams[i] && this.isNotBlank(queryParams[i][0]) && this.isNotBlank(queryParams[i][1])) { + let param = queryParams[i][0] + '=' + queryParams[i][1] + + if (i !== queryParams.length - 1) + param += '&' + + url += param; + } + } + + if (url.charAt(url.length) === '&') + url = url.substring(0, url.length - 1); + } + + fetch(url, { + method: 'PUT', + mode: 'cors', + headers: { + 'Authorization': 'Bearer ' + storeGet('getToken'), + }, + body: body + }) + .then(async response => { + let status = response.status; + this.logApiError(url, status); + return { response: await response.json(), status: status } + }) + .then(data => { + if (data.status >= 400 && data.status <= 599) { + errorCallback(data.response) + this.logApiError(url, data.status, data.response); + } else { + callback(data.response) + } + }) + .catch(err => errorCallback(err)); + }; + static isNotBlank(value) { return value !== null && value !== undefined && value !== '' } From a1ddf9f9736b0c530d7b0ab9669d2d1196ff788b Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Thu, 16 Oct 2025 17:02:48 +0200 Subject: [PATCH 5/6] - updated; --- src/configData.js | 2 +- src/pages/DomandaEditInstructorManager/index.js | 4 ++-- .../components/ApplicationInfo/index.js | 4 ++++ src/pages/DomandaEditPreInstructor/index.js | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/configData.js b/src/configData.js index 8197a94..ac68829 100644 --- a/src/configData.js +++ b/src/configData.js @@ -273,7 +273,7 @@ export const resendEmailLabelsByType = { export const rejectionReasons = [ { label: 'Documentazione incompleta', text: 'la stessa è stata sottoposta ad istruttoria di ammissibilità con esito negativo.' }, - { label: 'Altri motivi', text: 'altri motivi' } + { label: 'Altri motivi', text: 'la stessa è stata esclusa dalla graduatoria definitiva' } ] export const amendmentRequestedDocs = { diff --git a/src/pages/DomandaEditInstructorManager/index.js b/src/pages/DomandaEditInstructorManager/index.js index 4522fa8..81c71b5 100644 --- a/src/pages/DomandaEditInstructorManager/index.js +++ b/src/pages/DomandaEditInstructorManager/index.js @@ -1006,7 +1006,7 @@ const DomandaEditInstructorManager = () => { && APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE') ?