Merge pull request #52 from Kitzanos/master-sync-01-07-2025
Master sync 01 07 2025
This commit is contained in:
@@ -71,6 +71,9 @@ const getBandoLabel = (status) => {
|
||||
case 'REJECTED':
|
||||
return __('Respinto', 'gepafin');
|
||||
|
||||
case 'TECHNICAL_EVALUATION_REJECTED':
|
||||
return __('Respinto', 'gepafin');
|
||||
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import translationStrings from '../../../../translationStringsForComponents';
|
||||
|
||||
// api
|
||||
import BandoService from '../../../../service/bando-service';
|
||||
import ApplicationService from '../../../../service/application-service';
|
||||
|
||||
// tools
|
||||
import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString';
|
||||
@@ -23,6 +24,8 @@ import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
||||
import { Dropdown } from 'primereact/dropdown';
|
||||
import { Tag } from 'primereact/tag';
|
||||
import { Calendar } from 'primereact/calendar';
|
||||
import { storeGet, storeSet } from '../../../../store';
|
||||
|
||||
|
||||
const AllBandiPreInstructorTableAsync = () => {
|
||||
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||
@@ -43,6 +46,8 @@ const AllBandiPreInstructorTableAsync = () => {
|
||||
});
|
||||
const statuses = ['DRAFT','PUBLISH','EXPIRED'];
|
||||
|
||||
const role = storeGet('getRole')
|
||||
|
||||
const getPaginationQuery = useCallback(() => getQueryParamsForPaginatedEndpoint(lazyState, statuses, 'id'), [lazyState]);
|
||||
|
||||
const onPage = (event) => {
|
||||
@@ -86,9 +91,40 @@ const AllBandiPreInstructorTableAsync = () => {
|
||||
};
|
||||
|
||||
const actionsBodyTemplate = (rowData) => {
|
||||
return <Link to={`/bandi/${rowData.id}`}>
|
||||
<Button severity="info" label={__('Mostra', 'gepafin')} icon="pi pi-eye" size="small" iconPos="right" />
|
||||
</Link>
|
||||
return (
|
||||
<div className="p-d-flex p-flex-column">
|
||||
<Link to={`/bandi/${rowData.id}`}>
|
||||
<Button severity="info" label={__('Mostra', 'gepafin')} icon="pi pi-eye" size="small" iconPos="right" />
|
||||
</Link>
|
||||
{role === 'ROLE_INSTRUCTOR_MANAGER' && (
|
||||
<Button severity="info" label={__('Scarica graduatoria', 'gepafin')} icon="pi pi-download" size="small" iconPos="right" style={{marginTop:'10px'}} onClick={() => handleDownloadRanking(rowData.id)}/>
|
||||
)}
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const downloadSuccessCallback = (resp, callId) => {
|
||||
const file = new Blob([resp], { type: 'text/csv' });
|
||||
const url = window.URL.createObjectURL(file);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.setAttribute('download', `call-${callId}-applications-ranking.csv`);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
link.remove();
|
||||
setLocalAsyncRequest(false);
|
||||
}
|
||||
|
||||
const downloadErrorCallback = (resp) => {
|
||||
setLocalAsyncRequest(false);
|
||||
}
|
||||
|
||||
const handleDownloadRanking = (callId)=>{
|
||||
setLocalAsyncRequest(true);
|
||||
ApplicationService.downloadRanking(callId,
|
||||
(resp)=>downloadSuccessCallback(resp,callId),
|
||||
downloadErrorCallback)
|
||||
}
|
||||
|
||||
const statusBodyTemplate = (rowData) => {
|
||||
|
||||
@@ -444,10 +444,10 @@ const DomandaEditInstructorManager = () => {
|
||||
}
|
||||
}, [data, motivation]);
|
||||
|
||||
const doReject = useCallback(() => {
|
||||
const doReject = useCallback((newStatus) => {
|
||||
if (data.evaluationVersion === 'V1') {
|
||||
const submitData = {
|
||||
applicationStatus: 'REJECTED',
|
||||
applicationStatus: newStatus,
|
||||
criteria: klona(data.criteria),
|
||||
checklist: klona(data.checklist),
|
||||
files: klona(data.files),
|
||||
@@ -466,7 +466,7 @@ const DomandaEditInstructorManager = () => {
|
||||
} else if (data.evaluationVersion === 'V2') {
|
||||
const newFormValues = getTransformedSubmitData();
|
||||
const submitData = {
|
||||
applicationStatus: 'REJECTED',
|
||||
applicationStatus: newStatus,
|
||||
formFields: newFormValues,
|
||||
files: klona(data.files),
|
||||
evaluationDocument: klona(data.evaluationDocument.map(o => ({
|
||||
@@ -596,7 +596,7 @@ const DomandaEditInstructorManager = () => {
|
||||
|
||||
const shouldDisableField = useCallback((fieldName) => {
|
||||
return !['EVALUATION', 'ADMISSIBLE'].includes(data.applicationStatus)
|
||||
|| (['ADMISSIBLE'].includes(data.applicationStatus) && fieldName !== 'criteria')
|
||||
|| (['ADMISSIBLE', 'TECHNICAL_EVALUATION'].includes(data.applicationStatus) && !['criteria', 'note'].includes(fieldName))
|
||||
|| (fieldName === 'files' && !isEmpty(data.amendmentDetails))
|
||||
}, [data.applicationStatus]);
|
||||
|
||||
@@ -613,12 +613,24 @@ const DomandaEditInstructorManager = () => {
|
||||
}
|
||||
|
||||
const footerCompleteDialog = useCallback(() => {
|
||||
let onSubmitAction;
|
||||
let isDisabled = loading;
|
||||
|
||||
if (operationType === 'approve') {
|
||||
onSubmitAction = doApprove;
|
||||
isDisabled = isDisabled || !amountAccepted || isEmpty(amountAccepted) || amountAccepted === 0;
|
||||
} else if (operationType === 'tf_reject') {
|
||||
onSubmitAction = () => doReject('TECHNICAL_EVALUATION_REJECTED');
|
||||
} else {
|
||||
onSubmitAction = () => doReject('REJECTED');
|
||||
}
|
||||
|
||||
return <div>
|
||||
<Button type="button" label={__('Annulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
|
||||
<Button
|
||||
type="button"
|
||||
disabled={loading || ('approve' === operationType && (!amountAccepted || isEmpty(amountAccepted) || amountAccepted === 0))}
|
||||
label={__('Invia', 'gepafin')} onClick={'approve' === operationType ? doApprove : doReject}/>
|
||||
disabled={isDisabled}
|
||||
label={__('Invia', 'gepafin')} onClick={onSubmitAction}/>
|
||||
</div>
|
||||
}, [amountAccepted, data, motivation]);
|
||||
|
||||
@@ -633,6 +645,11 @@ const DomandaEditInstructorManager = () => {
|
||||
setIsVisibleCompleteDialog(true);
|
||||
}
|
||||
|
||||
const initiateTFRejecting = () => {
|
||||
setOperationType('tf_reject');
|
||||
setIsVisibleCompleteDialog(true);
|
||||
}
|
||||
|
||||
const doCheckNDG = () => {
|
||||
doSaveDraft(doGetNDGRequest);
|
||||
}
|
||||
@@ -858,6 +875,14 @@ const DomandaEditInstructorManager = () => {
|
||||
severity={isAdmissible ? 'success' : 'warning'}
|
||||
label={__('Valutazione tecnico-finanziaria positiva', 'gepafin')}
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
disabled={!data.id || !['TECHNICAL_EVALUATION'].includes(data.applicationStatus) || evaluationBlockedForUser(data)}
|
||||
onClick={initiateTFRejecting}
|
||||
icon="pi pi-info-circle" iconPos="right"
|
||||
severity={isAdmissible ? 'success' : 'warning'}
|
||||
label={__('Respingi domanda per valutazione TF negativa', 'gepafin')}
|
||||
/>
|
||||
{data.id
|
||||
? <Button
|
||||
type="button"
|
||||
@@ -873,7 +898,7 @@ const DomandaEditInstructorManager = () => {
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={APP_EVALUATION_FLOW_ID === '1'
|
||||
&& (!['EVALUATION', 'ADMISSIBLE', 'NDG', 'APPOINTMENT', 'TECHNICAL_EVALUATION'].includes(data.applicationStatus)
|
||||
&& (!['EVALUATION', 'ADMISSIBLE', 'NDG', 'APPOINTMENT'].includes(data.applicationStatus)
|
||||
|| evaluationBlockedForUser(data))}
|
||||
onClick={initiateRejecting}
|
||||
label={__('Respingi domanda', 'gepafin')}
|
||||
@@ -886,7 +911,8 @@ const DomandaEditInstructorManager = () => {
|
||||
<SoccorsoResendEmails
|
||||
emailsData={emailSendResponse}
|
||||
setDataEmailsSoccorso={updateEmailSendResponses}/>
|
||||
<EvaluationReAdmit id={data.applicationId} status={data.applicationStatus} statusUpdateFn={updateStatusOfAppl}/>
|
||||
<EvaluationReAdmit id={data.applicationId} status={data.applicationStatus}
|
||||
statusUpdateFn={updateStatusOfAppl}/>
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1254,7 +1280,7 @@ const DomandaEditInstructorManager = () => {
|
||||
</tr>)}
|
||||
<tr>
|
||||
<td>{__('Punteggio:', 'gepafin')}</td>
|
||||
<td>{new Intl.NumberFormat("it-IT").format(
|
||||
<td>{new Intl.NumberFormat('it-IT').format(
|
||||
sum(data.criteria.map(o => o.score))
|
||||
)}</td>
|
||||
<td>
|
||||
|
||||
@@ -443,10 +443,10 @@ const DomandaEditPreInstructor = () => {
|
||||
}
|
||||
}, [data, motivation]);
|
||||
|
||||
const doReject = useCallback(() => {
|
||||
const doReject = useCallback((newStatus) => {
|
||||
if (data.evaluationVersion === 'V1') {
|
||||
const submitData = {
|
||||
applicationStatus: 'REJECTED',
|
||||
applicationStatus: newStatus,
|
||||
criteria: klona(data.criteria),
|
||||
checklist: klona(data.checklist),
|
||||
files: klona(data.files),
|
||||
@@ -465,7 +465,7 @@ const DomandaEditPreInstructor = () => {
|
||||
} else if (data.evaluationVersion === 'V2') {
|
||||
const newFormValues = getTransformedSubmitData();
|
||||
const submitData = {
|
||||
applicationStatus: 'REJECTED',
|
||||
applicationStatus: newStatus,
|
||||
formFields: newFormValues,
|
||||
files: klona(data.files),
|
||||
evaluationDocument: klona(data.evaluationDocument.map(o => ({
|
||||
@@ -595,7 +595,7 @@ const DomandaEditPreInstructor = () => {
|
||||
|
||||
const shouldDisableField = useCallback((fieldName) => {
|
||||
return !['EVALUATION', 'ADMISSIBLE'].includes(data.applicationStatus)
|
||||
|| (['ADMISSIBLE'].includes(data.applicationStatus) && !['criteria', 'note'].includes(fieldName))
|
||||
|| (['ADMISSIBLE', 'TECHNICAL_EVALUATION'].includes(data.applicationStatus) && !['criteria', 'note'].includes(fieldName))
|
||||
|| (fieldName === 'files' && !isEmpty(data.amendmentDetails))
|
||||
}, [data.applicationStatus]);
|
||||
|
||||
@@ -612,12 +612,24 @@ const DomandaEditPreInstructor = () => {
|
||||
}
|
||||
|
||||
const footerCompleteDialog = useCallback(() => {
|
||||
let onSubmitAction;
|
||||
let isDisabled = loading;
|
||||
|
||||
if (operationType === 'approve') {
|
||||
onSubmitAction = doApprove;
|
||||
isDisabled = isDisabled || !amountAccepted || isEmpty(amountAccepted) || amountAccepted === 0;
|
||||
} else if (operationType === 'tf_reject') {
|
||||
onSubmitAction = () => doReject('TECHNICAL_EVALUATION_REJECTED');
|
||||
} else {
|
||||
onSubmitAction = () => doReject('REJECTED');
|
||||
}
|
||||
|
||||
return <div>
|
||||
<Button type="button" label={__('Annulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
|
||||
<Button
|
||||
type="button"
|
||||
disabled={loading || ('approve' === operationType && (!amountAccepted || isEmpty(amountAccepted) || amountAccepted === 0))}
|
||||
label={__('Invia', 'gepafin')} onClick={'approve' === operationType ? doApprove : doReject}/>
|
||||
disabled={isDisabled}
|
||||
label={__('Invia', 'gepafin')} onClick={onSubmitAction}/>
|
||||
</div>
|
||||
}, [amountAccepted, data, motivation]);
|
||||
|
||||
@@ -632,6 +644,11 @@ const DomandaEditPreInstructor = () => {
|
||||
setIsVisibleCompleteDialog(true);
|
||||
}
|
||||
|
||||
const initiateTFRejecting = () => {
|
||||
setOperationType('tf_reject');
|
||||
setIsVisibleCompleteDialog(true);
|
||||
}
|
||||
|
||||
const doCheckNDG = () => {
|
||||
doSaveDraft(doGetNDGRequest);
|
||||
}
|
||||
@@ -857,6 +874,14 @@ const DomandaEditPreInstructor = () => {
|
||||
severity={isAdmissible ? 'success' : 'warning'}
|
||||
label={__('Valutazione tecnico-finanziaria positiva', 'gepafin')}
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
disabled={!data.id || !['TECHNICAL_EVALUATION'].includes(data.applicationStatus) || evaluationBlockedForUser(data)}
|
||||
onClick={initiateTFRejecting}
|
||||
icon="pi pi-info-circle" iconPos="right"
|
||||
severity={isAdmissible ? 'success' : 'warning'}
|
||||
label={__('Respingi domanda per valutazione TF negativa', 'gepafin')}
|
||||
/>
|
||||
{data.id
|
||||
? <Button
|
||||
type="button"
|
||||
@@ -873,7 +898,7 @@ const DomandaEditPreInstructor = () => {
|
||||
type="button"
|
||||
disabled={['APPROVED', 'REJECTED'].includes(data.applicationStatus)
|
||||
|| (APP_EVALUATION_FLOW_ID === '1'
|
||||
&& (!['EVALUATION', 'ADMISSIBLE', 'APPOINTMENT', 'TECHNICAL_EVALUATION'].includes(data.applicationStatus)
|
||||
&& (!['EVALUATION', 'ADMISSIBLE', 'APPOINTMENT'].includes(data.applicationStatus)
|
||||
|| evaluationBlockedForUser(data)))
|
||||
}
|
||||
onClick={initiateRejecting}
|
||||
|
||||
@@ -25,4 +25,8 @@ export default class ApplicationEvaluationService {
|
||||
['evaluationFormId', formId]
|
||||
]);
|
||||
};
|
||||
|
||||
static updateStatus = (assignedApplicationId, body, callback, errCallback)=>{
|
||||
NetworkService.put(`${API_BASE_URL}/applicationEvaluation/${assignedApplicationId}`, body, callback, errCallback,);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,4 +67,8 @@ export default class ApplicationService {
|
||||
static reAdmitApplication = (id, callback, errCallback) => {
|
||||
NetworkService.put(`${API_BASE_URL}/application/${id}/readmit`, {}, callback, errCallback);
|
||||
};
|
||||
|
||||
static downloadRanking = (callId, callback, errCallback)=> {
|
||||
NetworkService.getBlob(`${API_BASE_URL}/application/call/${callId}/ranking-csv`, callback, errCallback);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user