- updated page for instructor manager;
This commit is contained in:
@@ -28,11 +28,11 @@ import {
|
||||
isPIVA,
|
||||
isUrl, maxChecks, minChecks, nonEmptyTables
|
||||
} from '../../helpers/validators';
|
||||
import formatDateString from '../../helpers/formatDateString';
|
||||
import getTokens from '../../helpers/getTokens';
|
||||
import parseCommaDecimal from '../../helpers/parseCommaDecimal';
|
||||
import renderWithDataVars from '../../helpers/renderWithDataVars';
|
||||
import renderHtmlContent from '../../helpers/renderHtmlContent';
|
||||
import formatDateString from '../../helpers/formatDateString';
|
||||
|
||||
// components
|
||||
import { Skeleton } from 'primereact/skeleton';
|
||||
@@ -135,6 +135,7 @@ const DomandaEditPreInstructor = () => {
|
||||
|
||||
const updateFlagsForSoccorso = useCallback((data) => {
|
||||
let nonRatedFilesLength = 0;
|
||||
let nonRatedAmmendFilesLength = 0;
|
||||
|
||||
if (data.files) {
|
||||
const nonRatedFiles = data.files
|
||||
@@ -147,10 +148,10 @@ const DomandaEditPreInstructor = () => {
|
||||
const nonRatedFiles = data.amendmentDetails
|
||||
.map(el => el.valid)
|
||||
.filter(v => isNil(v));
|
||||
nonRatedFilesLength = nonRatedFiles.length;
|
||||
nonRatedAmmendFilesLength = nonRatedFiles.length;
|
||||
}
|
||||
|
||||
setAllFilesRated(nonRatedFilesLength === 0);
|
||||
setAllFilesRated(nonRatedFilesLength === 0 && nonRatedAmmendFilesLength === 0);
|
||||
|
||||
if (data.evaluationVersion === 'V1') {
|
||||
if (data.checklist) {
|
||||
@@ -165,7 +166,7 @@ const DomandaEditPreInstructor = () => {
|
||||
const formFieldsChecklist = formData
|
||||
.filter(o => head(o.settings.filter(s => s.name === 'isChecklistItem' && s.value)))
|
||||
.map(o => o.id);
|
||||
|
||||
|
||||
if (formFieldsChecklist.length >= minChecks) {
|
||||
const valuesTotal = formFieldsChecklist.map(v => formValues[v]);
|
||||
const valuesFirst = valuesTotal.toSpliced(minChecks);
|
||||
@@ -289,7 +290,7 @@ const DomandaEditPreInstructor = () => {
|
||||
label: __('Nessuna garanzia', 'gepafin'),
|
||||
icon: 'pi pi-pen-to-square',
|
||||
command: () => {
|
||||
setPreTecEvalData(prev => ({...prev, type: 1}));
|
||||
setPreTecEvalData(prev => ({ ...prev, type: 1 }));
|
||||
setIsVisiblePreTecEvalDialog(true);
|
||||
}
|
||||
},
|
||||
@@ -297,7 +298,7 @@ const DomandaEditPreInstructor = () => {
|
||||
label: __('Garanzia MCC', 'gepafin'),
|
||||
icon: 'pi pi-pen-to-square',
|
||||
command: () => {
|
||||
setPreTecEvalData(prev => ({...prev, type: 2}));
|
||||
setPreTecEvalData(prev => ({ ...prev, type: 2 }));
|
||||
setIsVisiblePreTecEvalDialog(true);
|
||||
}
|
||||
},
|
||||
@@ -305,7 +306,7 @@ const DomandaEditPreInstructor = () => {
|
||||
label: __('Garanzia MCC Start-Up', 'gepafin'),
|
||||
icon: 'pi pi-pen-to-square',
|
||||
command: () => {
|
||||
setPreTecEvalData(prev => ({...prev, type: 3}));
|
||||
setPreTecEvalData(prev => ({ ...prev, type: 3 }));
|
||||
setIsVisiblePreTecEvalDialog(true);
|
||||
}
|
||||
},
|
||||
@@ -313,7 +314,7 @@ const DomandaEditPreInstructor = () => {
|
||||
label: __('Altre garanzie (fideiussioni)', 'gepafin'),
|
||||
icon: 'pi pi-pen-to-square',
|
||||
command: () => {
|
||||
setPreTecEvalData(prev => ({...prev, type: 4}));
|
||||
setPreTecEvalData(prev => ({ ...prev, type: 4 }));
|
||||
setIsVisiblePreTecEvalDialog(true);
|
||||
}
|
||||
}
|
||||
@@ -460,6 +461,7 @@ const DomandaEditPreInstructor = () => {
|
||||
} else if (data.evaluationVersion === 'V2') {
|
||||
const newFormValues = getTransformedSubmitData();
|
||||
const submitData = {
|
||||
applicationStatus: 'APPROVED',
|
||||
formFields: newFormValues,
|
||||
files: klona(data.files),
|
||||
evaluationDocument: klona(data.evaluationDocument.map(o => ({
|
||||
@@ -858,17 +860,17 @@ const DomandaEditPreInstructor = () => {
|
||||
}, [isAdmissible]);
|
||||
|
||||
const evaluationBlockedForUser = (data = {}) => {
|
||||
const userData = storeGet('userData')
|
||||
const userData = storeGet('userData');
|
||||
return isAsyncRequest || userData.id !== data.assignedUserId;
|
||||
}
|
||||
|
||||
const shouldDisableNewSoccorso = () => {
|
||||
if (data.evaluationVersion === 'V1') {
|
||||
return !data.ndg || !data.appointmentId || !allFilesRated || !atLeastOneChecked;
|
||||
} else if (data.evaluationVersion === 'V2') {
|
||||
if (APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE') {
|
||||
return !data.ndg || !data.appointmentId || !allFilesRated || !atLeastOneChecked;
|
||||
} else if (APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE') {
|
||||
return !allFilesRated || !atLeastOneChecked;
|
||||
} else {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -879,7 +881,11 @@ const DomandaEditPreInstructor = () => {
|
||||
|
||||
const actionBtns = () => {
|
||||
return <div className="appPageSection__actions">
|
||||
{['SOCCORSO', 'CLOSE', 'EVALUATION', 'NDG', 'APPOINTMENT', 'ADMISSIBLE', 'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION'].includes(data.applicationStatus)
|
||||
{(['SOCCORSO', 'CLOSE', 'EVALUATION', 'NDG', 'APPOINTMENT', 'ADMISSIBLE',
|
||||
'AWAITING_TECHNICAL_EVALUATION', 'TECHNICAL_EVALUATION'].includes(data.applicationStatus)
|
||||
&& APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE')
|
||||
|| (['SOCCORSO', 'CLOSE', 'EVALUATION', 'ADMISSIBLE', 'TECHNICAL_EVALUATION'].includes(data.applicationStatus)
|
||||
&& APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE')
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={!data.id || data.status === 'CLOSE'
|
||||
@@ -925,41 +931,62 @@ const DomandaEditPreInstructor = () => {
|
||||
onClick={doCreateAppointment}
|
||||
label={__('Crea l\'appuntamento', 'gepafin')}
|
||||
/> : null}
|
||||
<Button
|
||||
type="button"
|
||||
disabled={!data.id || !allFilesRated || !allChecksChecked
|
||||
|| !['APPOINTMENT'].includes(data.applicationStatus) || evaluationBlockedForUser(data) || connectedSoccorsoId !== 0}
|
||||
onClick={doMakeAdmisible}
|
||||
label={__('Ammissibile formalmente', 'gepafin')}
|
||||
/>
|
||||
{data.applicationStatus === 'AWAITING_TECHNICAL_EVALUATION'
|
||||
{APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={!data.id || !['ADMISSIBLE'].includes(data.applicationStatus) || evaluationBlockedForUser(data) || connectedSoccorsoId !== 0}
|
||||
onClick={doPassTechnicalEvaluation}
|
||||
icon="pi pi-info-circle" iconPos="right"
|
||||
tooltip={isAdmissible
|
||||
? __('Punteggio sufficiente per passaggio alla valutazione tecnica ed economico finanziaria', 'gepafin')
|
||||
: __('Punteggio non sufficiente per passaggio alla valutazione tecnica ed economico finanziaria', 'gepafin')}
|
||||
severity={isAdmissible ? 'success' : 'warning'}
|
||||
label={__('Valutazione tecnico-finanziaria positiva', 'gepafin')}
|
||||
/>
|
||||
: <SplitButton
|
||||
ref={tecFinBtnRef}
|
||||
disabled={!data.id || !['ADMISSIBLE'].includes(data.applicationStatus) || evaluationBlockedForUser(data) || connectedSoccorsoId !== 0}
|
||||
label={__('Valutazione tecnico-finanziaria', 'gepafin')}
|
||||
onClick={(e) => {
|
||||
tecFinBtnRef.current.show(e);
|
||||
}}
|
||||
model={technicalEvalItems}/>}
|
||||
<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')}
|
||||
disabled={!data.id || !allFilesRated || !allChecksChecked
|
||||
|| !['APPOINTMENT'].includes(data.applicationStatus) || evaluationBlockedForUser(data) || connectedSoccorsoId !== 0}
|
||||
onClick={doMakeAdmisible}
|
||||
label={__('Ammissibile formalmente', 'gepafin')}
|
||||
/>
|
||||
: <Button
|
||||
type="button"
|
||||
disabled={!data.id || !allFilesRated || !allChecksChecked
|
||||
|| evaluationBlockedForUser(data) || connectedSoccorsoId !== 0}
|
||||
onClick={doMakeAdmisible}
|
||||
label={__('Ammissibile formalmente', 'gepafin')}
|
||||
/>}
|
||||
{APP_HUB_ID === 't7jh5wfg9QXylNaTZkPoE'
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={!data.id || !['ADMISSIBLE'].includes(data.applicationStatus) || evaluationBlockedForUser(data) || connectedSoccorsoId !== 0}
|
||||
onClick={doPassTechnicalEvaluation}
|
||||
icon="pi pi-info-circle" iconPos="right"
|
||||
tooltip={isAdmissible
|
||||
? __('Punteggio sufficiente per passaggio alla valutazione tecnica ed economico finanziaria', 'gepafin')
|
||||
: __('Punteggio non sufficiente per passaggio alla valutazione tecnica ed economico finanziaria', 'gepafin')}
|
||||
severity={isAdmissible ? 'success' : 'warning'}
|
||||
label={__('Valutazione tecnico-finanziaria positiva', 'gepafin')}
|
||||
/> : null}
|
||||
{APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE' && data.applicationStatus === 'AWAITING_TECHNICAL_EVALUATION'
|
||||
? <Button
|
||||
type="button"
|
||||
disabled={!data.id || !['ADMISSIBLE'].includes(data.applicationStatus) || evaluationBlockedForUser(data) || connectedSoccorsoId !== 0}
|
||||
onClick={doPassTechnicalEvaluation}
|
||||
icon="pi pi-info-circle" iconPos="right"
|
||||
tooltip={isAdmissible
|
||||
? __('Punteggio sufficiente per passaggio alla valutazione tecnica ed economico finanziaria', 'gepafin')
|
||||
: __('Punteggio non sufficiente per passaggio alla valutazione tecnica ed economico finanziaria', 'gepafin')}
|
||||
severity={isAdmissible ? 'success' : 'warning'}
|
||||
label={__('Valutazione tecnico-finanziaria positiva', 'gepafin')}
|
||||
/>
|
||||
: APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE'
|
||||
? <SplitButton
|
||||
ref={tecFinBtnRef}
|
||||
disabled={!data.id || !['ADMISSIBLE'].includes(data.applicationStatus) || evaluationBlockedForUser(data) || connectedSoccorsoId !== 0}
|
||||
label={__('Valutazione tecnico-finanziaria', 'gepafin')}
|
||||
onClick={(e) => {
|
||||
tecFinBtnRef.current.show(e);
|
||||
}}
|
||||
model={technicalEvalItems}/> : null}
|
||||
<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"
|
||||
|
||||
Reference in New Issue
Block a user