Merge branch 'develop' into feature/documents-page
This commit is contained in:
@@ -62,6 +62,7 @@ const BandoApplication = () => {
|
||||
const [applicationStatus, setApplicationStatus] = useState('');
|
||||
const [activeStep, setActiveStep] = useState(1);
|
||||
const [signedPdfFile, setSignedPdfFile] = useState([]);
|
||||
const [isRequestForApplData, setIsRequestForApplData] = useState(false);
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const toast = useRef(null);
|
||||
const formMsgs = useRef(null);
|
||||
@@ -390,10 +391,12 @@ const BandoApplication = () => {
|
||||
setFormInitialData(formDataInitial);
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
setIsRequestForApplData(false);
|
||||
}
|
||||
|
||||
const errGetApplFormCallbacks = (data) => {
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
setIsRequestForApplData(false);
|
||||
if (data.status === 'VALIDATION_ERROR') {
|
||||
if (toast.current) {
|
||||
toast.current.show({
|
||||
@@ -568,6 +571,15 @@ const BandoApplication = () => {
|
||||
}, [formValues]);
|
||||
|
||||
useEffect(() => {
|
||||
if ('DRAFT' === applicationStatus && !isRequestForApplData) {
|
||||
const applId = getApplicationId();
|
||||
|
||||
if (applId) {
|
||||
storeSet.main.setAsyncRequest();
|
||||
ApplicationService.getApplicationForm(applId, getApplFormCallback, errGetApplFormCallbacks);
|
||||
}
|
||||
}
|
||||
|
||||
if ('SUBMIT' === applicationStatus) {
|
||||
setVisibleConfirmation(true);
|
||||
}
|
||||
@@ -595,6 +607,7 @@ const BandoApplication = () => {
|
||||
|
||||
if (applId) {
|
||||
storeSet.main.setAsyncRequest();
|
||||
setIsRequestForApplData(true);
|
||||
ApplicationService.getApplicationForm(applId, getApplFormCallback, errGetApplFormCallbacks);
|
||||
}
|
||||
}, [id, chosenCompanyId]);
|
||||
|
||||
@@ -324,6 +324,7 @@ const BandoViewBeneficiario = () => {
|
||||
]);
|
||||
if (REACT_APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE') {
|
||||
storeSet.main.setAsyncRequest();
|
||||
setApplicationObj(true);
|
||||
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
||||
['callId', bandoId],
|
||||
['companyId', chosenCompanyId]
|
||||
@@ -339,6 +340,8 @@ const BandoViewBeneficiario = () => {
|
||||
}
|
||||
}, [data]);
|
||||
|
||||
console.log('applicationObj', applicationObj)
|
||||
|
||||
return (
|
||||
<div className="appPage">
|
||||
{!isAsyncRequest && !isEmpty(data)
|
||||
@@ -524,12 +527,14 @@ const BandoViewBeneficiario = () => {
|
||||
onClick={scaricaModulistica}
|
||||
label={__('Scarica Bando Completo e Modulistica', 'gepafin')}
|
||||
icon="pi pi-download" iconPos="right"/>
|
||||
<Button
|
||||
type="button"
|
||||
disabled={isExpired || isAsyncRequest || chosenCompanyId === 0}
|
||||
onClick={submitApplication}
|
||||
label={submitBtnLabel()}
|
||||
icon={submitBtnIcon()} iconPos="right"/>
|
||||
{applicationObj.status && applicationObj.status === 'APPROVED'
|
||||
? null
|
||||
: <Button
|
||||
type="button"
|
||||
disabled={isExpired || isAsyncRequest || chosenCompanyId === 0}
|
||||
onClick={submitApplication}
|
||||
label={submitBtnLabel()}
|
||||
icon={submitBtnIcon()} iconPos="right"/>}
|
||||
<Button
|
||||
type="button"
|
||||
disabled={isExpired}
|
||||
|
||||
@@ -122,6 +122,7 @@ const DomandaEditInstructorManager = () => {
|
||||
|
||||
const updateFlagsForSoccorso = useCallback((data) => {
|
||||
let nonRatedFilesLength = 0;
|
||||
let nonRatedAmmendFilesLength = 0;
|
||||
|
||||
if (data.files) {
|
||||
const nonRatedFiles = data.files
|
||||
@@ -134,10 +135,10 @@ const DomandaEditInstructorManager = () => {
|
||||
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) {
|
||||
@@ -891,7 +892,7 @@ const DomandaEditInstructorManager = () => {
|
||||
storeSet.main.setAsyncRequest();
|
||||
ApplicationEvaluationService.getEvaluationVersionByApplId(entityId, getVersion, errGetVersion);
|
||||
AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [
|
||||
['statuses', 'AWAITING']
|
||||
['statuses', ['AWAITING', 'RESPONSE_RECEIVED']]
|
||||
]);
|
||||
}, [id]);
|
||||
|
||||
|
||||
@@ -892,7 +892,7 @@ const DomandaEditPreInstructor = () => {
|
||||
storeSet.main.setAsyncRequest();
|
||||
ApplicationEvaluationService.getEvaluationVersionByApplId(entityId, getVersion, errGetVersion);
|
||||
AmendmentsService.getSoccorsoByApplId(entityId, getAmendmentsCallback, errGetAmendmentsCallback, [
|
||||
['statuses', 'AWAITING']
|
||||
['statuses', ['AWAITING', 'RESPONSE_RECEIVED']]
|
||||
]);
|
||||
}, [id]);
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import ApplicationService from '../../service/application-service';
|
||||
import set404FromErrorResponse from '../../helpers/set404FromErrorResponse';
|
||||
import getBandoLabel from '../../helpers/getBandoLabel';
|
||||
import getDateFromISOstring from '../../helpers/getDateFromISOstring';
|
||||
import getEmailTemplateForSoccorso from '../../helpers/getStrippedHtmlBodyTags';
|
||||
|
||||
// components
|
||||
import { Button } from 'primereact/button';
|
||||
@@ -26,7 +27,6 @@ import { Dialog } from 'primereact/dialog';
|
||||
import FormField from '../../components/FormField';
|
||||
import SoccorsoComunications from '../SoccorsoEditPreInstructor/components/SoccorsoComunications';
|
||||
import { Editor } from 'primereact/editor';
|
||||
import getEmailTemplateForSoccorso from '../../helpers/getStrippedHtmlBodyTags';
|
||||
|
||||
const SoccorsoEditBeneficiario = () => {
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
@@ -60,7 +60,7 @@ const SoccorsoEditBeneficiario = () => {
|
||||
const entityId = !isNaN(parsedId) ? parsedId : 0;
|
||||
|
||||
AmendmentsService.getSoccorsoByApplId(entityId, getCallback, errGetCallback, [
|
||||
['statuses', 'AWAITING']
|
||||
['statuses', 'AWAITING,RESPONSE_RECEIVED']
|
||||
]);
|
||||
}, [id]);
|
||||
|
||||
@@ -324,10 +324,10 @@ const SoccorsoEditBeneficiario = () => {
|
||||
</div> : null}
|
||||
|
||||
{data.id
|
||||
? <div className="appPageSection">
|
||||
? <div className="appPageSection__emailTemplate">
|
||||
<h2>{__('Dettagli richiesta', 'gepafin')}</h2>
|
||||
<h3>{__('Note e spiegazioni', 'gepafin')}</h3>
|
||||
<div>{getEmailTemplateForSoccorso(data.emailTemplate, data.note)}</div>
|
||||
{getEmailTemplateForSoccorso(data.emailTemplate, data.note)}
|
||||
</div> : null}
|
||||
|
||||
{data.id
|
||||
|
||||
Reference in New Issue
Block a user