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':
|
case 'REJECTED':
|
||||||
return __('Respinto', 'gepafin');
|
return __('Respinto', 'gepafin');
|
||||||
|
|
||||||
|
case 'TECHNICAL_EVALUATION_REJECTED':
|
||||||
|
return __('Respinto', 'gepafin');
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import translationStrings from '../../../../translationStringsForComponents';
|
|||||||
|
|
||||||
// api
|
// api
|
||||||
import BandoService from '../../../../service/bando-service';
|
import BandoService from '../../../../service/bando-service';
|
||||||
|
import ApplicationService from '../../../../service/application-service';
|
||||||
|
|
||||||
// tools
|
// tools
|
||||||
import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString';
|
import getTimeParsedFromString from '../../../../helpers/getTimeParsedFromString';
|
||||||
@@ -23,6 +24,8 @@ import ProperBandoLabel from '../../../../components/ProperBandoLabel';
|
|||||||
import { Dropdown } from 'primereact/dropdown';
|
import { Dropdown } from 'primereact/dropdown';
|
||||||
import { Tag } from 'primereact/tag';
|
import { Tag } from 'primereact/tag';
|
||||||
import { Calendar } from 'primereact/calendar';
|
import { Calendar } from 'primereact/calendar';
|
||||||
|
import { storeGet, storeSet } from '../../../../store';
|
||||||
|
|
||||||
|
|
||||||
const AllBandiPreInstructorTableAsync = () => {
|
const AllBandiPreInstructorTableAsync = () => {
|
||||||
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
const [localAsyncRequest, setLocalAsyncRequest] = useState(false);
|
||||||
@@ -43,6 +46,8 @@ const AllBandiPreInstructorTableAsync = () => {
|
|||||||
});
|
});
|
||||||
const statuses = ['DRAFT','PUBLISH','EXPIRED'];
|
const statuses = ['DRAFT','PUBLISH','EXPIRED'];
|
||||||
|
|
||||||
|
const role = storeGet('getRole')
|
||||||
|
|
||||||
const getPaginationQuery = useCallback(() => getQueryParamsForPaginatedEndpoint(lazyState, statuses, 'id'), [lazyState]);
|
const getPaginationQuery = useCallback(() => getQueryParamsForPaginatedEndpoint(lazyState, statuses, 'id'), [lazyState]);
|
||||||
|
|
||||||
const onPage = (event) => {
|
const onPage = (event) => {
|
||||||
@@ -86,9 +91,40 @@ const AllBandiPreInstructorTableAsync = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const actionsBodyTemplate = (rowData) => {
|
const actionsBodyTemplate = (rowData) => {
|
||||||
return <Link to={`/bandi/${rowData.id}`}>
|
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" />
|
<Button severity="info" label={__('Mostra', 'gepafin')} icon="pi pi-eye" size="small" iconPos="right" />
|
||||||
</Link>
|
</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) => {
|
const statusBodyTemplate = (rowData) => {
|
||||||
|
|||||||
@@ -444,10 +444,10 @@ const DomandaEditInstructorManager = () => {
|
|||||||
}
|
}
|
||||||
}, [data, motivation]);
|
}, [data, motivation]);
|
||||||
|
|
||||||
const doReject = useCallback(() => {
|
const doReject = useCallback((newStatus) => {
|
||||||
if (data.evaluationVersion === 'V1') {
|
if (data.evaluationVersion === 'V1') {
|
||||||
const submitData = {
|
const submitData = {
|
||||||
applicationStatus: 'REJECTED',
|
applicationStatus: newStatus,
|
||||||
criteria: klona(data.criteria),
|
criteria: klona(data.criteria),
|
||||||
checklist: klona(data.checklist),
|
checklist: klona(data.checklist),
|
||||||
files: klona(data.files),
|
files: klona(data.files),
|
||||||
@@ -466,7 +466,7 @@ const DomandaEditInstructorManager = () => {
|
|||||||
} else if (data.evaluationVersion === 'V2') {
|
} else if (data.evaluationVersion === 'V2') {
|
||||||
const newFormValues = getTransformedSubmitData();
|
const newFormValues = getTransformedSubmitData();
|
||||||
const submitData = {
|
const submitData = {
|
||||||
applicationStatus: 'REJECTED',
|
applicationStatus: newStatus,
|
||||||
formFields: newFormValues,
|
formFields: newFormValues,
|
||||||
files: klona(data.files),
|
files: klona(data.files),
|
||||||
evaluationDocument: klona(data.evaluationDocument.map(o => ({
|
evaluationDocument: klona(data.evaluationDocument.map(o => ({
|
||||||
@@ -596,7 +596,7 @@ const DomandaEditInstructorManager = () => {
|
|||||||
|
|
||||||
const shouldDisableField = useCallback((fieldName) => {
|
const shouldDisableField = useCallback((fieldName) => {
|
||||||
return !['EVALUATION', 'ADMISSIBLE'].includes(data.applicationStatus)
|
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))
|
|| (fieldName === 'files' && !isEmpty(data.amendmentDetails))
|
||||||
}, [data.applicationStatus]);
|
}, [data.applicationStatus]);
|
||||||
|
|
||||||
@@ -613,12 +613,24 @@ const DomandaEditInstructorManager = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const footerCompleteDialog = useCallback(() => {
|
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>
|
return <div>
|
||||||
<Button type="button" label={__('Annulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
|
<Button type="button" label={__('Annulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={loading || ('approve' === operationType && (!amountAccepted || isEmpty(amountAccepted) || amountAccepted === 0))}
|
disabled={isDisabled}
|
||||||
label={__('Invia', 'gepafin')} onClick={'approve' === operationType ? doApprove : doReject}/>
|
label={__('Invia', 'gepafin')} onClick={onSubmitAction}/>
|
||||||
</div>
|
</div>
|
||||||
}, [amountAccepted, data, motivation]);
|
}, [amountAccepted, data, motivation]);
|
||||||
|
|
||||||
@@ -633,6 +645,11 @@ const DomandaEditInstructorManager = () => {
|
|||||||
setIsVisibleCompleteDialog(true);
|
setIsVisibleCompleteDialog(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const initiateTFRejecting = () => {
|
||||||
|
setOperationType('tf_reject');
|
||||||
|
setIsVisibleCompleteDialog(true);
|
||||||
|
}
|
||||||
|
|
||||||
const doCheckNDG = () => {
|
const doCheckNDG = () => {
|
||||||
doSaveDraft(doGetNDGRequest);
|
doSaveDraft(doGetNDGRequest);
|
||||||
}
|
}
|
||||||
@@ -858,6 +875,14 @@ const DomandaEditInstructorManager = () => {
|
|||||||
severity={isAdmissible ? 'success' : 'warning'}
|
severity={isAdmissible ? 'success' : 'warning'}
|
||||||
label={__('Valutazione tecnico-finanziaria positiva', 'gepafin')}
|
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
|
{data.id
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -873,7 +898,7 @@ const DomandaEditInstructorManager = () => {
|
|||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={APP_EVALUATION_FLOW_ID === '1'
|
disabled={APP_EVALUATION_FLOW_ID === '1'
|
||||||
&& (!['EVALUATION', 'ADMISSIBLE', 'NDG', 'APPOINTMENT', 'TECHNICAL_EVALUATION'].includes(data.applicationStatus)
|
&& (!['EVALUATION', 'ADMISSIBLE', 'NDG', 'APPOINTMENT'].includes(data.applicationStatus)
|
||||||
|| evaluationBlockedForUser(data))}
|
|| evaluationBlockedForUser(data))}
|
||||||
onClick={initiateRejecting}
|
onClick={initiateRejecting}
|
||||||
label={__('Respingi domanda', 'gepafin')}
|
label={__('Respingi domanda', 'gepafin')}
|
||||||
@@ -886,7 +911,8 @@ const DomandaEditInstructorManager = () => {
|
|||||||
<SoccorsoResendEmails
|
<SoccorsoResendEmails
|
||||||
emailsData={emailSendResponse}
|
emailsData={emailSendResponse}
|
||||||
setDataEmailsSoccorso={updateEmailSendResponses}/>
|
setDataEmailsSoccorso={updateEmailSendResponses}/>
|
||||||
<EvaluationReAdmit id={data.applicationId} status={data.applicationStatus} statusUpdateFn={updateStatusOfAppl}/>
|
<EvaluationReAdmit id={data.applicationId} status={data.applicationStatus}
|
||||||
|
statusUpdateFn={updateStatusOfAppl}/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1254,7 +1280,7 @@ const DomandaEditInstructorManager = () => {
|
|||||||
</tr>)}
|
</tr>)}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{__('Punteggio:', 'gepafin')}</td>
|
<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))
|
sum(data.criteria.map(o => o.score))
|
||||||
)}</td>
|
)}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -443,10 +443,10 @@ const DomandaEditPreInstructor = () => {
|
|||||||
}
|
}
|
||||||
}, [data, motivation]);
|
}, [data, motivation]);
|
||||||
|
|
||||||
const doReject = useCallback(() => {
|
const doReject = useCallback((newStatus) => {
|
||||||
if (data.evaluationVersion === 'V1') {
|
if (data.evaluationVersion === 'V1') {
|
||||||
const submitData = {
|
const submitData = {
|
||||||
applicationStatus: 'REJECTED',
|
applicationStatus: newStatus,
|
||||||
criteria: klona(data.criteria),
|
criteria: klona(data.criteria),
|
||||||
checklist: klona(data.checklist),
|
checklist: klona(data.checklist),
|
||||||
files: klona(data.files),
|
files: klona(data.files),
|
||||||
@@ -465,7 +465,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
} else if (data.evaluationVersion === 'V2') {
|
} else if (data.evaluationVersion === 'V2') {
|
||||||
const newFormValues = getTransformedSubmitData();
|
const newFormValues = getTransformedSubmitData();
|
||||||
const submitData = {
|
const submitData = {
|
||||||
applicationStatus: 'REJECTED',
|
applicationStatus: newStatus,
|
||||||
formFields: newFormValues,
|
formFields: newFormValues,
|
||||||
files: klona(data.files),
|
files: klona(data.files),
|
||||||
evaluationDocument: klona(data.evaluationDocument.map(o => ({
|
evaluationDocument: klona(data.evaluationDocument.map(o => ({
|
||||||
@@ -595,7 +595,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
|
|
||||||
const shouldDisableField = useCallback((fieldName) => {
|
const shouldDisableField = useCallback((fieldName) => {
|
||||||
return !['EVALUATION', 'ADMISSIBLE'].includes(data.applicationStatus)
|
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))
|
|| (fieldName === 'files' && !isEmpty(data.amendmentDetails))
|
||||||
}, [data.applicationStatus]);
|
}, [data.applicationStatus]);
|
||||||
|
|
||||||
@@ -612,12 +612,24 @@ const DomandaEditPreInstructor = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const footerCompleteDialog = useCallback(() => {
|
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>
|
return <div>
|
||||||
<Button type="button" label={__('Annulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
|
<Button type="button" label={__('Annulla', 'gepafin')} onClick={hideCompleteDialog} outlined/>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={loading || ('approve' === operationType && (!amountAccepted || isEmpty(amountAccepted) || amountAccepted === 0))}
|
disabled={isDisabled}
|
||||||
label={__('Invia', 'gepafin')} onClick={'approve' === operationType ? doApprove : doReject}/>
|
label={__('Invia', 'gepafin')} onClick={onSubmitAction}/>
|
||||||
</div>
|
</div>
|
||||||
}, [amountAccepted, data, motivation]);
|
}, [amountAccepted, data, motivation]);
|
||||||
|
|
||||||
@@ -632,6 +644,11 @@ const DomandaEditPreInstructor = () => {
|
|||||||
setIsVisibleCompleteDialog(true);
|
setIsVisibleCompleteDialog(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const initiateTFRejecting = () => {
|
||||||
|
setOperationType('tf_reject');
|
||||||
|
setIsVisibleCompleteDialog(true);
|
||||||
|
}
|
||||||
|
|
||||||
const doCheckNDG = () => {
|
const doCheckNDG = () => {
|
||||||
doSaveDraft(doGetNDGRequest);
|
doSaveDraft(doGetNDGRequest);
|
||||||
}
|
}
|
||||||
@@ -857,6 +874,14 @@ const DomandaEditPreInstructor = () => {
|
|||||||
severity={isAdmissible ? 'success' : 'warning'}
|
severity={isAdmissible ? 'success' : 'warning'}
|
||||||
label={__('Valutazione tecnico-finanziaria positiva', 'gepafin')}
|
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
|
{data.id
|
||||||
? <Button
|
? <Button
|
||||||
type="button"
|
type="button"
|
||||||
@@ -873,7 +898,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
type="button"
|
type="button"
|
||||||
disabled={['APPROVED', 'REJECTED'].includes(data.applicationStatus)
|
disabled={['APPROVED', 'REJECTED'].includes(data.applicationStatus)
|
||||||
|| (APP_EVALUATION_FLOW_ID === '1'
|
|| (APP_EVALUATION_FLOW_ID === '1'
|
||||||
&& (!['EVALUATION', 'ADMISSIBLE', 'APPOINTMENT', 'TECHNICAL_EVALUATION'].includes(data.applicationStatus)
|
&& (!['EVALUATION', 'ADMISSIBLE', 'APPOINTMENT'].includes(data.applicationStatus)
|
||||||
|| evaluationBlockedForUser(data)))
|
|| evaluationBlockedForUser(data)))
|
||||||
}
|
}
|
||||||
onClick={initiateRejecting}
|
onClick={initiateRejecting}
|
||||||
|
|||||||
@@ -25,4 +25,8 @@ export default class ApplicationEvaluationService {
|
|||||||
['evaluationFormId', formId]
|
['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) => {
|
static reAdmitApplication = (id, callback, errCallback) => {
|
||||||
NetworkService.put(`${API_BASE_URL}/application/${id}/readmit`, {}, 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