From 05281927ad576c0ffb130f21cbc0b637a138ff64 Mon Sep 17 00:00:00 2001 From: Vitalii Kiiko Date: Thu, 9 Oct 2025 15:21:48 +0200 Subject: [PATCH] - 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 = () => { ?