Merge branch 'develop' into master-sync/29-04-2025

This commit is contained in:
Vitalii Kiiko
2025-04-29 08:42:20 +02:00
124 changed files with 2526 additions and 1161 deletions

View File

@@ -9,7 +9,7 @@ import { evaluate } from 'mathjs';
import equal from 'fast-deep-equal';
// store
import { storeGet, storeSet, useStore } from '../../store';
import { storeGet, storeSet, useStoreValue } from '../../store';
// api
import ApplicationEvaluationService from '../../service/application-evaluation-service';
@@ -58,7 +58,7 @@ const APP_EVALUATION_FLOW_ID = process.env.REACT_APP_EVALUATION_FLOW_ID;
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
const DomandaEditPreInstructor = () => {
const isAsyncRequest = useStore().main.isAsyncRequest();
const isAsyncRequest = useStoreValue('isAsyncRequest');
const { id } = useParams();
const navigate = useNavigate();
const [data, setData] = useState({});
@@ -179,18 +179,18 @@ const DomandaEditPreInstructor = () => {
const getVersion = (resp) => {
if (resp.status === 'SUCCESS') {
if (resp.data.evaluationVersion === 'V1') {
storeSet.main.setAsyncRequest();
storeSet('setAsyncRequest');
ApplicationEvaluationService.getEvaluationByApplId(getCallback, errGetCallback, [
['applicationId', resp.data.applicationId]
]);
} else if (resp.data.evaluationVersion === 'V2') {
storeSet.main.setAsyncRequest();
storeSet('setAsyncRequest');
ApplicationEvaluationService.getEvaluationV2ByApplId(getCallback, errGetCallback, [
['applicationId', resp.data.applicationId]
]);
}
}
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const errGetVersion = (resp) => {
@@ -202,7 +202,7 @@ const DomandaEditPreInstructor = () => {
});
}
set404FromErrorResponse(resp);
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const getCallback = (resp) => {
@@ -233,7 +233,7 @@ const DomandaEditPreInstructor = () => {
setFormInitialData(formDataInitial);
}
}
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const errGetCallback = (resp) => {
@@ -245,7 +245,7 @@ const DomandaEditPreInstructor = () => {
});
}
set404FromErrorResponse(resp);
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const getFormattedData = (data) => {
@@ -377,7 +377,7 @@ const DomandaEditPreInstructor = () => {
afterUpdateCallback();
}
}
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const errUpdateCallback = (data) => {
@@ -389,7 +389,7 @@ const DomandaEditPreInstructor = () => {
});
}
set404FromErrorResponse(data);
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const doApprove = useCallback(() => {
@@ -610,7 +610,7 @@ const DomandaEditPreInstructor = () => {
const footerCompleteDialog = useCallback(() => {
return <div>
<Button type="button" label={__('Anulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
<Button type="button" label={__('Annulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
<Button
type="button"
disabled={loading || ('approve' === operationType && (!amountAccepted || isEmpty(amountAccepted) || amountAccepted === 0))}
@@ -634,7 +634,7 @@ const DomandaEditPreInstructor = () => {
}
const doGetNDGRequest = () => {
storeSet.main.setAsyncRequest();
storeSet('setAsyncRequest');
AppointmentService.getNdg(id, getNdgCallback, errGetNdgCallback);
}
@@ -654,7 +654,7 @@ const DomandaEditPreInstructor = () => {
}));
}
}
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const errGetNdgCallback = (data) => {
@@ -666,7 +666,7 @@ const DomandaEditPreInstructor = () => {
});
}
set404FromErrorResponse(data);
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const doCreateAppointment = () => {
@@ -695,7 +695,7 @@ const DomandaEditPreInstructor = () => {
const footerAppointmentDialog = () => {
return <div>
<Button type="button" label={__('Anulla', 'gepafin')} onClick={hideAppointmentDialog} outlined/>
<Button type="button" label={__('Annulla', 'gepafin')} onClick={hideAppointmentDialog} outlined/>
<Button
type="button"
disabled={loading}
@@ -708,7 +708,7 @@ const DomandaEditPreInstructor = () => {
!isEmpty(appointmentData.title) && !isEmpty(appointmentData.text) && !isEmpty(appointmentData.amount)
&& !isEmpty(appointmentData.duration) && appointmentData.duration !== 0 && appointmentData.amount !== 0
) {
storeSet.main.setAsyncRequest();
storeSet('setAsyncRequest');
const submitData = {
'importoBreveTermine': appointmentData.amount,
'durataMesiFinanziamento': appointmentData.duration,
@@ -739,7 +739,7 @@ const DomandaEditPreInstructor = () => {
}
}
setIsVisibleAppointmentDialog(false);
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const errGetAppointemntCallback = (data) => {
@@ -752,7 +752,7 @@ const DomandaEditPreInstructor = () => {
}
setIsVisibleAppointmentDialog(false);
set404FromErrorResponse(data);
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const doMakeAdmisible = () => {
@@ -770,7 +770,7 @@ const DomandaEditPreInstructor = () => {
}, [isAdmissible]);
const evaluationBlockedForUser = (data = {}) => {
const userData = storeGet.main.userData()
const userData = storeGet('userData')
return isAsyncRequest || userData.id !== data.assignedUserId;
}
@@ -934,7 +934,7 @@ const DomandaEditPreInstructor = () => {
const parsed = parseInt(id)
const entityId = !isNaN(parsed) ? parsed : 0;
storeSet.main.setAsyncRequest();
storeSet('setAsyncRequest');
ApplicationEvaluationService.getEvaluationVersionByApplId(entityId, getVersion, errGetVersion);
AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [
['statuses', ['AWAITING', 'RESPONSE_RECEIVED', 'CLOSE']]