- issue 122
- issue 123;
This commit is contained in:
@@ -62,6 +62,7 @@ const BandoApplication = () => {
|
|||||||
const [applicationStatus, setApplicationStatus] = useState('');
|
const [applicationStatus, setApplicationStatus] = useState('');
|
||||||
const [activeStep, setActiveStep] = useState(1);
|
const [activeStep, setActiveStep] = useState(1);
|
||||||
const [signedPdfFile, setSignedPdfFile] = useState([]);
|
const [signedPdfFile, setSignedPdfFile] = useState([]);
|
||||||
|
const [isRequestForApplData, setIsRequestForApplData] = useState(false);
|
||||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||||
const toast = useRef(null);
|
const toast = useRef(null);
|
||||||
const formMsgs = useRef(null);
|
const formMsgs = useRef(null);
|
||||||
@@ -390,10 +391,12 @@ const BandoApplication = () => {
|
|||||||
setFormInitialData(formDataInitial);
|
setFormInitialData(formDataInitial);
|
||||||
}
|
}
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
setIsRequestForApplData(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const errGetApplFormCallbacks = (data) => {
|
const errGetApplFormCallbacks = (data) => {
|
||||||
storeSet.main.unsetAsyncRequest();
|
storeSet.main.unsetAsyncRequest();
|
||||||
|
setIsRequestForApplData(false);
|
||||||
if (data.status === 'VALIDATION_ERROR') {
|
if (data.status === 'VALIDATION_ERROR') {
|
||||||
if (toast.current) {
|
if (toast.current) {
|
||||||
toast.current.show({
|
toast.current.show({
|
||||||
@@ -568,6 +571,15 @@ const BandoApplication = () => {
|
|||||||
}, [formValues]);
|
}, [formValues]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if ('DRAFT' === applicationStatus && !isRequestForApplData) {
|
||||||
|
const applId = getApplicationId();
|
||||||
|
|
||||||
|
if (applId) {
|
||||||
|
storeSet.main.setAsyncRequest();
|
||||||
|
ApplicationService.getApplicationForm(applId, getApplFormCallback, errGetApplFormCallbacks);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ('SUBMIT' === applicationStatus) {
|
if ('SUBMIT' === applicationStatus) {
|
||||||
setVisibleConfirmation(true);
|
setVisibleConfirmation(true);
|
||||||
}
|
}
|
||||||
@@ -595,6 +607,7 @@ const BandoApplication = () => {
|
|||||||
|
|
||||||
if (applId) {
|
if (applId) {
|
||||||
storeSet.main.setAsyncRequest();
|
storeSet.main.setAsyncRequest();
|
||||||
|
setIsRequestForApplData(true);
|
||||||
ApplicationService.getApplicationForm(applId, getApplFormCallback, errGetApplFormCallbacks);
|
ApplicationService.getApplicationForm(applId, getApplFormCallback, errGetApplFormCallbacks);
|
||||||
}
|
}
|
||||||
}, [id, chosenCompanyId]);
|
}, [id, chosenCompanyId]);
|
||||||
|
|||||||
@@ -324,6 +324,7 @@ const BandoViewBeneficiario = () => {
|
|||||||
]);
|
]);
|
||||||
if (REACT_APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE') {
|
if (REACT_APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE') {
|
||||||
storeSet.main.setAsyncRequest();
|
storeSet.main.setAsyncRequest();
|
||||||
|
setApplicationObj(true);
|
||||||
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
||||||
['callId', bandoId],
|
['callId', bandoId],
|
||||||
['companyId', chosenCompanyId]
|
['companyId', chosenCompanyId]
|
||||||
@@ -339,6 +340,8 @@ const BandoViewBeneficiario = () => {
|
|||||||
}
|
}
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
|
console.log('applicationObj', applicationObj)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="appPage">
|
<div className="appPage">
|
||||||
{!isAsyncRequest && !isEmpty(data)
|
{!isAsyncRequest && !isEmpty(data)
|
||||||
@@ -524,12 +527,14 @@ const BandoViewBeneficiario = () => {
|
|||||||
onClick={scaricaModulistica}
|
onClick={scaricaModulistica}
|
||||||
label={__('Scarica Bando Completo e Modulistica', 'gepafin')}
|
label={__('Scarica Bando Completo e Modulistica', 'gepafin')}
|
||||||
icon="pi pi-download" iconPos="right"/>
|
icon="pi pi-download" iconPos="right"/>
|
||||||
<Button
|
{applicationObj.status && applicationObj.status === 'APPROVED'
|
||||||
|
? null
|
||||||
|
: <Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={isExpired || isAsyncRequest || chosenCompanyId === 0}
|
disabled={isExpired || isAsyncRequest || chosenCompanyId === 0}
|
||||||
onClick={submitApplication}
|
onClick={submitApplication}
|
||||||
label={submitBtnLabel()}
|
label={submitBtnLabel()}
|
||||||
icon={submitBtnIcon()} iconPos="right"/>
|
icon={submitBtnIcon()} iconPos="right"/>}
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={isExpired}
|
disabled={isExpired}
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ const DomandaEditInstructorManager = () => {
|
|||||||
|
|
||||||
const updateFlagsForSoccorso = useCallback((data) => {
|
const updateFlagsForSoccorso = useCallback((data) => {
|
||||||
let nonRatedFilesLength = 0;
|
let nonRatedFilesLength = 0;
|
||||||
|
let nonRatedAmmendFilesLength = 0;
|
||||||
|
|
||||||
if (data.files) {
|
if (data.files) {
|
||||||
const nonRatedFiles = data.files
|
const nonRatedFiles = data.files
|
||||||
@@ -134,10 +135,10 @@ const DomandaEditInstructorManager = () => {
|
|||||||
const nonRatedFiles = data.amendmentDetails
|
const nonRatedFiles = data.amendmentDetails
|
||||||
.map(el => el.valid)
|
.map(el => el.valid)
|
||||||
.filter(v => isNil(v));
|
.filter(v => isNil(v));
|
||||||
nonRatedFilesLength = nonRatedFiles.length;
|
nonRatedAmmendFilesLength = nonRatedFiles.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
setAllFilesRated(nonRatedFilesLength === 0);
|
setAllFilesRated(nonRatedFilesLength === 0 && nonRatedAmmendFilesLength === 0);
|
||||||
|
|
||||||
if (data.evaluationVersion === 'V1') {
|
if (data.evaluationVersion === 'V1') {
|
||||||
if (data.checklist) {
|
if (data.checklist) {
|
||||||
@@ -891,7 +892,7 @@ const DomandaEditInstructorManager = () => {
|
|||||||
storeSet.main.setAsyncRequest();
|
storeSet.main.setAsyncRequest();
|
||||||
ApplicationEvaluationService.getEvaluationVersionByApplId(entityId, getVersion, errGetVersion);
|
ApplicationEvaluationService.getEvaluationVersionByApplId(entityId, getVersion, errGetVersion);
|
||||||
AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [
|
AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [
|
||||||
['statuses', 'AWAITING']
|
['statuses', ['AWAITING', 'RESPONSE_RECEIVED']]
|
||||||
]);
|
]);
|
||||||
}, [id]);
|
}, [id]);
|
||||||
|
|
||||||
|
|||||||
@@ -892,7 +892,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
storeSet.main.setAsyncRequest();
|
storeSet.main.setAsyncRequest();
|
||||||
ApplicationEvaluationService.getEvaluationVersionByApplId(entityId, getVersion, errGetVersion);
|
ApplicationEvaluationService.getEvaluationVersionByApplId(entityId, getVersion, errGetVersion);
|
||||||
AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [
|
AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [
|
||||||
['statuses', 'AWAITING']
|
['statuses', ['AWAITING', 'RESPONSE_RECEIVED']]
|
||||||
]);
|
]);
|
||||||
}, [id]);
|
}, [id]);
|
||||||
|
|
||||||
|
|||||||
@@ -324,10 +324,10 @@ const SoccorsoEditBeneficiario = () => {
|
|||||||
</div> : null}
|
</div> : null}
|
||||||
|
|
||||||
{data.id
|
{data.id
|
||||||
? <div className="appPageSection">
|
? <div className="appPageSection__emailTemplate">
|
||||||
<h2>{__('Dettagli richiesta', 'gepafin')}</h2>
|
<h2>{__('Dettagli richiesta', 'gepafin')}</h2>
|
||||||
<h3>{__('Note e spiegazioni', 'gepafin')}</h3>
|
<h3>{__('Note e spiegazioni', 'gepafin')}</h3>
|
||||||
<div>{getEmailTemplateForSoccorso(data.emailTemplate, data.note)}</div>
|
{getEmailTemplateForSoccorso(data.emailTemplate, data.note)}
|
||||||
</div> : null}
|
</div> : null}
|
||||||
|
|
||||||
{data.id
|
{data.id
|
||||||
|
|||||||
Reference in New Issue
Block a user